diff --git a/Changelog b/Changelog index 636c33f8..bf00a6f1 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,38 @@ Version Changes for Hypermail HYPERMAIL VERSION 3.0.0 ============================ +2026-07-15 Jose Kahan + * aclocale.m4 configure.ac + Upgraded to 1.17, 2.72, respectively + Added return type to main for C compiler test in configure.ac + + * hypermail.c setup.c setup.h file.c print.c print.h lang.h + Added a new CLI option, -y, to do a dry-run of hypermail, without + generating any archive; it will output to STDOUT the filenames + and associated Message-IDs it would have created. + +2024-11-08 Jose Kahan + * src/string.c + Truncate Content-Type and charset field values at first illegal + character + + * src/parse.c + Improve integration of libchardet for converting mail header values to + utf-8 / remove compiler warnings + + This change let's the parset detect the charset of a message when the + Content-Type: header is missing the charset field or if a header value + is in another charset and it's not encoded using RFC2047. To do so, + the parser calls a function that examines the To:, From: and Subject: + header values and, when they don't have valid ASCII or UTF-8 strings, + if it detects the charset, it will convert the header value to UTF-8 + and use that charset for the rest of the message. If it fails to detect + it, it will replace the whole header value with a "(invalid string)" + string. + + Fixed compiler warnings as reported by pedantic, unused variables + flags. src/parse.c + 2024-11-07 Jose Kahan * configure.ac, configure Improve detection of libchardet (system, local dir) and enable @@ -12,7 +44,7 @@ HYPERMAIL VERSION 3.0.0 * pkgconf, libiconv Make pkgconf and libiconv mandatory for compiling hypermail - + 2024-11-06 Jose Kahan * src/hypermail.c If hypermail was called with its default configuration values, @@ -189,7 +221,7 @@ HYPERMAIL VERSION 3.0.0 be taken into account internally (e.g., for threads). * src/{hypermail.h, struct.c} - When a message/rfc body part contained only a stored + When a message/rfc822 body part contained only a stored attachment (e.g., text/html), even if the attachment was being added to the attachments dir, both the message/rfc822 headers and the link to the stored attachment were not being diff --git a/RELEASE_NOTES b/RELEASE_NOTES index d17ed554..eeec798b 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,9 +1,11 @@ Hypermail 3.0.0 +* IMPORTANT * IMPORTANT * IMPORTANT * IMPORTANT + If you are migrating to 3.0.0 from 2.4.0, please consult the UPGRADE file. -*** NEW FEATURES +*** NEW FEATURES AND CHANGES - HTML5 @@ -63,11 +65,12 @@ anymore. - Switch to PCRE2 Up to now hypermail had been using PCRE behind the scenes of its -message filtering options (docs/hmrc.html#filters). PCRE being now -at end of life, and is no longer being actively maintained, we have now -updated hypermail to support its successor, PCRE2. If you were using any -of Hypermail's filtering options, we advise you to check out PCRE2's -doc to see if there have been any changes there that may impact you: +message filtering options (docs/hmrc.html#filters). PCRE being now at +end of life, and is no longer being actively maintained, we have now +updated hypermail to support its successor, PCRE2. If you were using +any of Hypermail's filtering options, we advise you to check out +PCRE2's doc to see if there have been any changes there that may +impact you: https://www.pcre.org/current/doc/html/pcre2pattern.html @@ -79,24 +82,30 @@ the future. - Other configuration option changes -Two new configuration options, "archive_date" and "hypermail_colophon", -allow you choose whether you want to display a line that says when the -archive was generated (only in the indexes) as well as a a line that -states that the archive was generated with hypermail and the -generation date (both in messages and indexes). Both these options may -be considered mutually exclusive as they both display the archive -generation date. You can disable both of them. +Two new configuration options, "archive_date" and +"hypermail_colophon", allow you choose whether you want to display a +line that says when the archive was generated (only in the indexes) as +well as a a line that states that the archive was generated with +hypermail and the generation date (both in messages and indexes). Both +these options may be considered mutually exclusive as they both +display the archive generation date. You can disable both of them. "empty_archive_notice" will let you customize the markup and text that is displayed in indices when you're converting a mbox that consists -exclusively of messages that have been annotated as 'spam' or 'deleted'. +exclusively of messages that have been annotated as 'spam' or +'deleted'. "show_headers_msg_rfc822" will let you customize the list of headers that you want to be shown in message/rfc822 attachments. If not defined, hypermail will use the value of "show_headers". -"archived_date" lets you control whether you want to add a line -in the indices giving the date the archive was generated. +"archived_date" lets you control whether you want to add a line in the +indices giving the date the archive was generated. + +"ignore_content_disposition" allows you ignore the Content-Disposition +header for a given list of MIME types. This is particularly useful for +old Apple Mail UA that associated Content-Type: attachment with +multipart/appledouble. Please refer to refer to hmrc.html hmrc.4 or use hypermail -v for a more detailed description of the configuration options. @@ -113,9 +122,25 @@ to. This new parser has allowed us to better handle message/rfc822 and multipart/alternative attachments, simplify hypermail's parsing code, and use better heuristics for determining the charset that will be -associated with a processed message. The new parser also greatly -simplifies adding new markup changes as it allowed to separate the -parsing from the markup generation. +associated with a processed message (some of these heuristics use +libchardet). The new parser also greatly simplifies adding new markup +changes as it allowed to separate the parsing from the markup +generation. + +- libchardet + +Hypermail now uses libchardet (if installed) to help detect a +message's character set when the message's Content-Type has no +declared charset, header values are not ASCII, and there are not +either RFC2047 encoded. + + https://github.com/Joungkyun/libchardet/ + +- libiconv + +Due to the predominance of UTF-8 and the wide availabilty of libiconv, +we have made this library mandatory, rather than optional, for the +compilation of hypermail. - Compiler warnings and memory leaks @@ -126,16 +151,31 @@ Although all major runtime cumulative memory leaks that gcc's code that were not tested as they depend on the use and combination of different hypermail configuration options. +- Sample configuration file + +An annotated configuration file and related files is now +available in docs/examples/hmrc.conf. + - Other code improvements -Read the Changelog for more details. +Please consult the Changelog + +*** UNMAINTAINED FEATURES, USE AT YOUR RISK + +It's been a while since Hypermail's support of gdbm (--with-gdbm) for +storing message's metadata and libfnv (--enable-libfnv) for creating +unique filenames have been reviewed and tested. + +They're now downgraded to UNMAINTAINED status and may be deprecated in +a future version unless users report they are using them and that they +work as expected. *** DEPRECATED FEATURES -The configuration variable "indextable", which let hypermail -generate message indexes using tables has been deprecated in favor of -using HTML and CSS. This option has been disabled. The pertaining -code will be removed from the code base in a future release. +The configuration variable "indextable", which let hypermail generate +message indexes using tables has been deprecated in favor of using +HTML and CSS. This option has been disabled. The pertaining code will +be removed from the code base in a future release. The "quotes" and "finequotes" options are now in the to be deprecated list. The code that handles these options hasn't been updated or @@ -184,6 +224,9 @@ those issue trackers to send your feedback. - translation of messages: some languagess are behind since years and need update. Unmaintained languages risk being dropped out in a future version of hypermail. Issue #78 on github. + All these messages should also probably be converted to UTF-8 and + have hypermail change them on-the-fly and hypermail should require + UTF-8 locales. - compilation: windows LCC support (not updated, seems very old). Issue #79 on github. @@ -203,3 +246,5 @@ facilitating discussions and work on this version of hypermail. Thanks to Baptiste Daroussin, Jim (@AverageGuy), @cacsar, @schlomif, and Andy Valencia (@vandys) for their bug reports and code contributions. + +Thanks to @Joungkyun for libchardet and insights into its use and status. diff --git a/UPGRADE b/UPGRADE index 12f15d93..599f48d9 100644 --- a/UPGRADE +++ b/UPGRADE @@ -4,76 +4,263 @@ Upgrade Notes From Hypermail 2.4.0 to Hypermail 3.0.0 ----------------------------------------- -Due to the markup changes to support HTML5 and enhance the WAI -support, it is strongly recommended that you delete all existing HTML -files and directories in the archive directory and that you rebuild -your archive completely using version 3.0.0 Failure to do so may -produce invalid markup in some of your messages or have duplicate -links that point to replies and other messages (the 2.4.0 + the 3.0.0 -ones) in your current messages. - -Except for some few exceptions related to specific options (see here -below), all generated markup was reviewed with the help of experts of -the WAI community to make sure it is accessible. We may have missed -some files that are only generated when using specific configuration -options; if that's the case, please open an issue and we'll look at -it. - -Hypermail is now using PCRE2. If you were using any of the filtering -options, you should check if your regular expressions need updating. -For more info see for example: +!!!!WARNING!!!! + +Read this section if you're planning to upgrade an existing archive from +Hypermail 2.4 to 3.0. Otherwise, you may skip it. + +* Important: potential backward incompatible changes when rebuilding a + 2.4 archive with 3.0 : Message-ID headers and attachments + +If you're going to migrate an existing hypermail 2.4 archive to 3.0 +you have two choices: + +- Freeze the 2.4 archive and start a new one with the new messages +- Upgrade your 2.4 archive to 3.0 + +We don't recommend having an archive which mixes both 2.4 and 3.0 +messages in an active period. + +If you plan to upgrade an existing 2.4 archive to 3.0 please take +notice that the parser in 3.0 has fixed issues on how it parses +the Message-ID header and a message attachment: from the same mailbox, +2.4 and 3.0 may generate different archives which may break existing links +to those archives. We go into detail here below. + +** Message-ID headers + +Hypermail uses the Message-ID associated with a message to identify if +it has already parsed a message. When hypermail parses a message that +has a Message-ID it has already seen, it will always skip that +message. + +Hypermail 3.0 changes and fixes issues related to the Message-ID. If +you are rebuilding an HTML archive that was created with hypermail +2.4, the resulting hypermail 3.0 archive may have messages that were +previously skipped existing in the new archive, or, conversely, +messages that exited in the 2.4 archive being skipped in the new +archive. This will break existing links to the archive. + +If this does matter to you, you will need to identify the messages +that have an issue and either patch them or, in some cases, move them +around or remove them from the archive, in order to preserve message +sequence and existing links. More information below. + +If you're upgrading a 2.4 archive to 3.0, we recommend you do a +dry-run of hypermail 3.0 by adding the -y CLI argument. This +will instruct hypermail to process your mailbox, without generating an +archive, and output to STDOUT the archive message number followed by +the message-id associated with it for each message in the mailbox. + +You can scrap the same info from an existing 2.4 archive by using the +contrib/hyparchive-msgid-scrapper.pl Perl script on that archive. + +Comparing both results will let you know which messages have been +moved around to help you plan your strategy in upgrading an existing +2.4 archive to 3.0. Note that in many cases, the errors come from +badly formed messages, often related to spam. + +Here's an example. Let's assume that your existing hypermail 2.4 +generated HTML archive directory is called "my-mailing-list" and that, +for simpliciy, it is stored under /var/www/. In addition, let's assume +that the mbox used to generate this archive is stored under +/var/mail/my-mailing-list.mbox. + +[[ +# 1. do a dry-run with hypermail 3.0 and store the result in a file +hypermail -y -m /var/lib/my-mailing-list.mbox >/tmp/30dryrun.txt + +# 2. scrap the filenames and msgid from the 2.4 archive +contrib/hyparchive-msgid-scrapper.pl /var/www/my-mailing-list \ + >/tmp/24scrapper.txt + +# 3. compare the dry-run output with the scrapper; if there are no differences +# you won't have any Message-ID issues. +diff /tmp/30dryrun.txt /tmp/24scrapper.txt +]] + +Keep in mind that the Message-IDs that both the dry-run and the +scrapper script return are partially escaped; if you want to find the +equivalent Message-Id in your source mailbox, you'll have to replace +the string '–' with the '-' character and replace the string +'_at_' with a '@' character. + +We give a summary of potential Message-ID issues in the sections here below + +The file tests/msgid-parsing.mbox is a sample and annoted mbox that +illustrates all these issues. You can use it to generate an archive +with both 2.4 and 3.0 to see the differences in context: + +[[ + # generate an archive with hypermail 2.4 + hypermail -m tests/msgid-parsing.mbox -d /tmp/24msgid + + # do a dry-run with hypermail 3.0 and store the result in a file + hypermail -y -m tests/msgid-parsing.mbox -d /tmp/30msgi >/tmp/30dryrun.txt + + # scrap the filenames and msgid from the 2.4 archive + contrib/hyp-msgid-scrapper.pl /tmp/24msgid >/tmp/24scrapper.txt + + # compare the dry-run output with the scrapper + diff /tmp/30dryrun.txt /tmp/24scrapper.txt +]] + +*** Issue: messages having more than one Message-ID header + +In 2.4, the last Message-ID will be the one associated with the message. + +In 3.0, the first Message-ID will be the one associated with the message. + +*** Issue: Mime attachment headers include a Message-ID header + +In 2.4, if found, this Message-ID would wrongly replace the Message-ID +associated with the parent message. + +In 3.0, this Message-Id header is ignored. + +Note that both 2.4 and 3.0 ignore Message-ID headers found in the body of +message/rfc822 attachments. + +*** Possible solutions for dealing with Message-ID issues when + upgrading an archive from 2.4 to 3.4, to preserve message numbering + and links: + +- If a message is being skipped due to having a duplicate Message-ID + and you want to retain it to preserve numbering (and its content), + edit the original message and slightly alter the Message-ID, e.g., + by adding a "dup-" prefix. You can also add a comment header + describing the modification you did: + + Original: + Message-ID: + + Edited: + Message-ID: + X-Comment: "Edited on 20260714 to port archive to hypermail 3.0" + +- If a message is being shown and you want to skip it to preserve + numbering, you can either: + + - remove the message from the archive if it's not relevant + + - edit its Message-ID to be a duplicate of a previous one so it + will be skipped + +Example: + Original: + Message-ID: + + Edited to use previously seen Message-ID value: + Message-ID: + X-Original-Message-ID: + X-Comment: "Edited on 20260714 to port archive to hypermail 3.0" + + Alternatively, you can move this message to the end of the period if + you still want to keep it visible and preserve numbering. + +** Attachment filenames + +When hypermail parses a message that has attachments, it will store +those attachments in a directory called att-nnnn, where nnnn is the +archive message number associated with that attachment. + +When hypermail wasn't able to correctly identify an attachments name +from its headers, it would generate its own; likewise, if an +attachment name already existed, it will add a number prefix to the +filename to differentiate it. + +Hypermail 3.0 has an improved parser that lets it detect attachment +names correctly. 3.0's parser also fixes issues that 2.4 had in +detecting and handling attachments, specially in message/rfc822 +attachments that themselves that contain multipart/mixed or +multipart/alternative attachments Due to this, the attachments that +3.0 stores in the attachment dir as well as their names may slightly +differ to those that 2.4 generates for the same archive. In this case, +if you want to upgrade a 2.4 archive to 3.0 and preserve existing +links to attachments, you should identify which attachment names (and +content) changed in 3.0 and add links pointing the old names to the +new ones in your server configuration. + +The dry-run won't generate this information. You'll need to create a +test 3.0 archive and compare the attachments it generates against the +2.4 archive. * IMPORTANT: Potential backward incompatibility between +2.4.x and 3.0.0. + +* Due to the markup changes to support HTML5 and enhance the WAI + support, it is strongly recommended that you delete all existing + HTML files and directories in the archive directory and that you + rebuild your archive completely using version 3.0.0 Failure to do so + may produce invalid markup in some of your messages or have + duplicate links that point to replies and other messages (the 2.4 + plus the 3.0 ones) in your current messages. + +* Except for some few cases related to specific options (see here + below), all generated markup was reviewed with the help of experts + of the WAI community to make sure it is accessible. We may have + missed some files that are only generated when using specific + configuration options; if that's the case, please open an issue and + we'll look at it. + +* Hypermail is now using PCRE2. If you were using any of the filtering + options, you should check if your regular expressions need updating. + For more info see for example: https://wiki.php.net/rfc/pcre2-migration: -All style that used to be embeeded in hypermail's generated archive -files was moved to an external stylesheet. This stylesheet, -hypermail.css, will be generated by default in your archive directory -unless you use options to give a link to an external one. Together -with this move, more markup was added to allow a better use of CSS and -better accessibility and use of screen readers. - -You can find hypermail's current stylesheet under docs/hypermail.css. -If you were already relying on an external stylesheet file, we advise -you to check hypermail's default shipped one to see if there are -changes you'd be interested in supporting in your own stylesheet file. - -The following configuration options are now considered deprecated and -will be ignored. They will be removed from the code base in the next -hypermail release: - -- showhr, usetable, iquotes. All of these options have been made - obsolete by markup changes in hypermail. You can emulate their - behavior by using CSS. - -The following options are being considered as future candidates for -deprecation: - -- showhtml. We are not sure if people are using this option with - values 1 and 2. The markup that's produced isn't so special and we - think that it'd be better to merge whatever features people deem - useful there to the normal markup and use CSS to control - presentation. Minimal work has been done with this option other than - to make sure the produced markup is valid. The markup that's - produced with this option was not given a WAI review. - -The following options are now considered unstable since version 2.4 -and are considered future candidates for deprecation unless people -state they are being used and someone proposes to adopt their code and -gives it more love and maintenance: - -- linkquotes, searchbackmsgnum, link_to_replies, quote_hide_threshold, - quote_link_string. Note that all these options are related to - linkquotes. No work was done in 3.0.0 regarding these options. - -By default, hypermail will warn you if your configuration file includes -deprecated or planned to be deprecated options. You can switch off this -warning by using the new "warn_deprecated_options" configuration option. - -The yearly and monthly summaries seem to have been broken since some -long time ago. Some few updates were done but they require more -love to make them more useful. In particular, messages are missing -links pointing back to the summaries. Note that you could do this -by using the different navbar options. +* All style that used to be embedded in hypermail's generated archive + files was moved to an external stylesheet. This stylesheet, + hypermail.css, will be generated by default in your archive + directory unless you use options to give a link to an external + one. Together with this move, more markup was added to allow a + better use of CSS and better accessibility and use of screen + readers. + + You can find hypermail's current stylesheet under docs/hypermail.css. + + If you were already relying on an external stylesheet file, we + advise you to check hypermail's default shipped one to see if there + are changes you'd be interested in supporting in your own stylesheet + file. + +* The following configuration options are now considered deprecated + and will be ignored. They will be removed from the code base in the + next hypermail release: + + - showhr, usetable, iquotes. All of these options have been made + obsolete by markup changes in hypermail. You can emulate their + behavior by using CSS. + +* The following options are being considered as future candidates for + deprecation: + + - showhtml. We are not sure if people are using this option with + values 1 and 2. The markup that's produced isn't so special and we + think that it'd be better to merge whatever features people deem + useful there to the normal markup and use CSS to control + presentation. Minimal work has been done with this option other + than to make sure the produced markup is valid. The markup that's + produced with this option was not given a WAI review. + +* The following options are now considered unstable since version 2.4 + and are considered future candidates for deprecation unless people + state they are being used and someone proposes to adopt their code + and gives it more love and maintenance: + + - linkquotes, searchbackmsgnum, link_to_replies, + quote_hide_threshold, quote_link_string. Note that all these + options are related to linkquotes. No work was done in 3.0.0 + regarding these options. + +* By default, hypermail will warn you if your configuration file + includes deprecated or planned to be deprecated options. You can + switch off this warning by using the new "warn_deprecated_options" + configuration option. + +* The yearly and monthly summaries seem to have been broken since some + long time ago. Some few updates were done but they require more love + to make them more useful. In particular, messages are missing links + pointing back to the summaries. Note that you could do this by using + the different navbar options. From Hypermail 2.3.0 to Hypermail 2.4.0 ----------------------------------------- @@ -92,6 +279,7 @@ with legacy archives, it will continue to be honored. From Hypermail 1.x to Hypermail 2.x ----------------------------------- + !!!!WARNING!!!! Hypermail 2.x HTML output files, indexes, etc are not compatible with 1.x diff --git a/aclocal.m4 b/aclocal.m4 index 460e78ff..c7d0846f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.17 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/config.h.in b/config.h.in index dec6ec2f..36dc5ad4 100644 --- a/config.h.in +++ b/config.h.in @@ -15,12 +15,6 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if your declares struct tm. */ -#undef TM_IN_SYS_TIME - /* Define if has a prototype for isblank. */ #undef HAVE_DECL_ISBLANK diff --git a/configure b/configure index c8aceae3..76d8314b 100755 --- a/configure +++ b/configure @@ -1,10 +1,10 @@ #! /bin/sh # From configure.ac Revision: 1.2 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71. +# Generated by GNU Autoconf 2.72. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -16,7 +16,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -25,12 +24,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -102,7 +102,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# 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 @@ -132,15 +132,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -148,12 +147,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -171,8 +171,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -186,14 +187,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -226,12 +228,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -253,7 +256,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -272,7 +275,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -311,14 +315,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -387,11 +383,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -405,21 +402,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -493,6 +483,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -541,7 +533,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -553,9 +544,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -580,10 +571,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). @@ -719,8 +712,6 @@ FNV_DEP PCRE2_DEP PCRE2_CONFIG TRIO_DEP -EGREP -GREP domainaddr defaultindex htmlsuffix @@ -736,6 +727,8 @@ LN_S INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +EGREP +GREP YACC_CHECK YFLAGS YACC @@ -934,7 +927,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -960,7 +953,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1173,7 +1166,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1189,7 +1182,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1219,8 +1212,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1228,7 +1221,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1278,7 +1271,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1346,7 +1339,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1374,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +'configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1388,11 +1381,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1400,10 +1393,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1482,14 +1475,14 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. + YACC The 'Yet Another Compiler 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. + default value of '-d' given by some make applications. -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1557,9 +1550,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1598,11 +1591,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1636,11 +1630,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1677,12 +1672,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1702,8 +1698,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1711,10 +1707,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1754,11 +1752,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1783,8 +1782,8 @@ printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1808,12 +1807,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1833,15 +1834,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1852,7 +1853,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1871,11 +1872,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1896,8 +1899,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1927,12 +1930,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1965,7 +1970,7 @@ 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.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2211,10 +2216,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2250,9 +2255,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2266,6 +2269,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2293,16 +2311,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2352,7 +2373,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2418,6 +2438,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2439,7 +2461,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2552,7 +2574,6 @@ as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" # Auxiliary files required by this configure script. ac_aux_files="install-sh config.guess config.sub" @@ -2632,8 +2653,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2661,12 +2683,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2675,18 +2697,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2702,11 +2724,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2750,15 +2772,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -2785,14 +2808,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -2819,14 +2843,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) 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` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -2862,8 +2887,9 @@ hostcheck="$host" if test ${ac_cv_hostcheck+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_hostcheck="$hostcheck" +else case e in #( + e) ac_cv_hostcheck="$hostcheck" ;; +esac fi if test "$ac_cv_hostcheck" != "$hostcheck"; then @@ -2900,8 +2926,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2923,7 +2949,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2945,8 +2972,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2968,7 +2995,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3003,8 +3031,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3026,7 +3054,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3048,8 +3077,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3088,7 +3117,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3112,8 +3142,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3135,7 +3165,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3161,8 +3192,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3184,7 +3215,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3222,8 +3254,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3245,7 +3277,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3267,8 +3300,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3290,7 +3323,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3319,10 +3353,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3394,8 +3428,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # 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. @@ -3415,7 +3449,7 @@ do 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' + # 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. @@ -3426,8 +3460,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -3436,13 +3471,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3466,10 +3502,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3479,11 +3515,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3499,6 +3536,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3538,26 +3577,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3589,16 +3629,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3609,8 +3651,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3627,12 +3669,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3650,8 +3694,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3669,8 +3713,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3685,8 +3729,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3703,12 +3747,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3735,8 +3782,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3753,25 +3800,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3781,8 +3831,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3799,25 +3849,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3827,8 +3880,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3845,25 +3898,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -3888,8 +3944,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -3907,9 +3963,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -3923,15 +3980,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -3940,7 +3998,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -3963,9 +4022,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -3979,24 +4039,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -4014,8 +4076,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$YACC"; then +else case e in #( + e) if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4037,7 +4099,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then @@ -4060,8 +4123,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC_CHECK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$YACC_CHECK"; then +else case e in #( + e) if test -n "$YACC_CHECK"; then ac_cv_prog_YACC_CHECK="$YACC_CHECK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4083,7 +4146,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi YACC_CHECK=$ac_cv_prog_YACC_CHECK if test -n "$YACC_CHECK"; then @@ -4099,6 +4163,154 @@ if test x"$YACC_CHECK" != x"yes" then : as_fn_error $? "Please install either bison or yacc and run configure again" "$LINENO" 5 fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -4120,8 +4332,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -4175,7 +4387,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -4216,8 +4429,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -4229,7 +4442,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -4248,8 +4462,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4272,7 +4486,8 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="echo" -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -4293,8 +4508,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4316,7 +4531,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -4338,8 +4554,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4361,7 +4577,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -4398,8 +4615,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PKGCONF+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PKGCONF"; then +else case e in #( + e) if test -n "$PKGCONF"; then ac_cv_prog_PKGCONF="$PKGCONF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4421,7 +4638,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PKGCONF=$ac_cv_prog_PKGCONF if test -n "$PKGCONF"; then @@ -4443,8 +4661,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_PKGCONF+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_PKGCONF"; then +else case e in #( + e) if test -n "$ac_ct_PKGCONF"; then ac_cv_prog_ac_ct_PKGCONF="$ac_ct_PKGCONF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4466,7 +4684,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_PKGCONF=$ac_cv_prog_ac_ct_PKGCONF if test -n "$ac_ct_PKGCONF"; then @@ -4526,22 +4745,24 @@ printf %s "checking that the compiler works... " >&6; } if test "$cross_compiling" = yes then : as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - main(int ac, char **av) { return 0; } + int main(int ac, char **av) { return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5 + as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -4564,9 +4785,10 @@ then : printf "%s\n" "adding -Wall to CFLAGS." >&6; } CFLAGS="$CFLAGS -Wall" fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -4575,8 +4797,9 @@ fi if test ${with_httpddir+y} then : withval=$with_httpddir; httpddir=$with_httpddir -else $as_nop - httpddir=/usr/local/apache +else case e in #( + e) httpddir=/usr/local/apache ;; +esac fi @@ -4586,8 +4809,9 @@ fi if test ${with_htmldir+y} then : withval=$with_htmldir; htmldir=$with_htmldir -else $as_nop - htmldir=$httpddir/htdocs/hypermail +else case e in #( + e) htmldir=$httpddir/htdocs/hypermail ;; +esac fi @@ -4597,8 +4821,9 @@ fi if test ${with_language+y} then : withval=$with_language; language=$with_language -else $as_nop - language=en +else case e in #( + e) language=en ;; +esac fi @@ -4608,8 +4833,9 @@ fi if test ${with_htmlsuffix+y} then : withval=$with_htmlsuffix; htmlsuffix=$with_htmlsuffix -else $as_nop - htmlsuffix=html +else case e in #( + e) htmlsuffix=html ;; +esac fi @@ -4618,8 +4844,9 @@ fi if test ${enable_defaultindex+y} then : enableval=$enable_defaultindex; defaultindex=$enableval -else $as_nop - defaultindex="thread" +else case e in #( + e) defaultindex="thread" ;; +esac fi @@ -4629,8 +4856,9 @@ fi if test ${with_domainaddr+y} then : withval=$with_domainaddr; domainaddr=$with_domainaddr -else $as_nop - domainaddr=NONE +else case e in #( + e) domainaddr=NONE ;; +esac fi @@ -4639,8 +4867,6 @@ fi -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. ac_header= ac_cache= for ac_item in $ac_header_c_list do @@ -4670,150 +4896,6 @@ then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - - ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" if test "x$ac_cv_header_alloca_h" = xyes then : @@ -4971,8 +5053,8 @@ printf %s "checking whether stat file-mode macros are broken... " >&6; } if test ${ac_cv_header_stat_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4997,10 +5079,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stat_broken=no -else $as_nop - ac_cv_header_stat_broken=yes +else case e in #( + e) ac_cv_header_stat_broken=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 printf "%s\n" "$ac_cv_header_stat_broken" >&6; } @@ -5012,14 +5096,14 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -5036,10 +5120,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -5047,7 +5133,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5061,15 +5147,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5100,11 +5192,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5121,15 +5215,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5160,11 +5260,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5177,15 +5279,19 @@ fi fi - - -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - -printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi -# End of obsolete code. +# m4_warn([obsolete], +# [Update your code to rely only on HAVE_SYS_TIME_H, +# then remove this warning and the obsolete code below it. +# All current systems provide time.h; it need not be checked for. +# Not all systems provide sys/time.h, but those that do, all allow +# you to include it and time.h simultaneously.])dnl +# AC_CHECK_HEADERS_ONCE([sys/time.h]) +# # Obsolete code to be removed. +# if test $ac_cv_header_sys_time_h = yes; then +# AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both +# and . This macro is obsolete.]) +# fi +# # End of obsolete code. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 @@ -5193,8 +5299,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -5213,8 +5319,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -5242,26 +5348,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -5272,24 +5381,27 @@ ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "$ac_includes_def if test "x$ac_cv_have_decl_isblank" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_strcasecmp" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_STRCASECMP $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "strcasestr" "ac_cv_have_decl_strcasestr" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_strcasestr" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_STRCASESTR $ac_have_decl" >>confdefs.h @@ -5300,8 +5412,8 @@ printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test ${ac_cv_struct_tm+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5319,10 +5431,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_struct_tm=time.h -else $as_nop - ac_cv_struct_tm=sys/time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 printf "%s\n" "$ac_cv_struct_tm" >&6; } @@ -5341,23 +5455,29 @@ if test "x$ac_cv_func_strftime" = xyes then : printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h -else $as_nop - # strftime is in -lintl on SCO UNIX. +else case e in #( + e) # strftime is in -lintl on SCO UNIX. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 printf %s "checking for strftime in -lintl... " >&6; } if test ${ac_cv_lib_intl_strftime+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char strftime (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (void); int main (void) { @@ -5369,12 +5489,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_intl_strftime=yes -else $as_nop - ac_cv_lib_intl_strftime=no +else case e in #( + e) ac_cv_lib_intl_strftime=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 printf "%s\n" "$ac_cv_lib_intl_strftime" >&6; } @@ -5384,7 +5506,8 @@ then : LIBS="-lintl $LIBS" fi - + ;; +esac fi done @@ -5487,8 +5610,8 @@ then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h -else $as_nop - for ac_type in 'int' 'long int' 'long long int'; do +else case e in #( + e) for ac_type in 'int' 'long int' 'long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -5512,7 +5635,8 @@ printf "%s\n" "#define intptr_t $ac_type" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break - done + done ;; +esac fi @@ -5520,10 +5644,11 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi @@ -5589,16 +5714,22 @@ printf %s "checking for gdbm_open in -lgdbm... " >&6; } if test ${ac_cv_lib_gdbm_gdbm_open+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgdbm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gdbm_open (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gdbm_open (void); int main (void) { @@ -5610,20 +5741,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gdbm_gdbm_open=yes -else $as_nop - ac_cv_lib_gdbm_gdbm_open=no +else case e in #( + e) ac_cv_lib_gdbm_gdbm_open=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5 printf "%s\n" "$ac_cv_lib_gdbm_gdbm_open" >&6; } if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes then : GDBM_LIB="-lgdbm" -else $as_nop - GDBM_INCLUDE="" +else case e in #( + e) GDBM_INCLUDE="" ;; +esac fi @@ -5667,45 +5801,49 @@ printf "%s\n" "$as_me: Trying /usr/include/gdbm.h" >&6;} if test "x$ac_cv_header_gdbm_h" = xyes then : GDBM_INCLUDE="" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Trying /usr/local/include/gdbm.h" >&5 printf "%s\n" "$as_me: Trying /usr/local/include/gdbm.h" >&6;} ac_fn_c_check_header_compile "$LINENO" "/usr/local/include/gdbm.h" "ac_cv_header__usr_local_include_gdbm_h" "$ac_includes_default" if test "x$ac_cv_header__usr_local_include_gdbm_h" = xyes then : GDBM_INCLUDE="-I/usr/local/include" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Trying /opt/local/include/gdbm.h" >&5 printf "%s\n" "$as_me: Trying /opt/local/include/gdbm.h" >&6;} ac_fn_c_check_header_compile "$LINENO" "/opt/local/include/gdbm.h" "ac_cv_header__opt_local_include_gdbm_h" "$ac_includes_default" if test "x$ac_cv_header__opt_local_include_gdbm_h" = xyes then : GDBM_INCLUDE="-I/opt/local/include" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Trying /usr/pkg/include/gdbm.h" >&5 printf "%s\n" "$as_me: Trying /usr/pkg/include/gdbm.h" >&6;} ac_fn_c_check_header_compile "$LINENO" "/usr/pkg/include/gdbm.h" "ac_cv_header__usr_pkg_include_gdbm_h" "$ac_includes_default" if test "x$ac_cv_header__usr_pkg_include_gdbm_h" = xyes then : GDBM_INCLUDE="" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gdbm.h not found" >&5 printf "%s\n" "gdbm.h not found" >&6; } gdbm_headers_found=0 - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi @@ -5715,16 +5853,22 @@ printf %s "checking for gdbm_open in -lgdbm... " >&6; } if test ${ac_cv_lib_gdbm_gdbm_open+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgdbm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gdbm_open (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gdbm_open (void); int main (void) { @@ -5736,20 +5880,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gdbm_gdbm_open=yes -else $as_nop - ac_cv_lib_gdbm_gdbm_open=no +else case e in #( + e) ac_cv_lib_gdbm_gdbm_open=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5 printf "%s\n" "$ac_cv_lib_gdbm_gdbm_open" >&6; } if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes then : DBM_TYPE=gdbm; GDBM_LIB=-lgdbm -else $as_nop - DBM_TYPE="" +else case e in #( + e) DBM_TYPE="" ;; +esac fi fi @@ -5804,8 +5951,9 @@ if test "x$ac_cv_header_iconv_h" = xyes then : printf "%s\n" "#define HAVE_ICONV_H 1" >>confdefs.h -else $as_nop - as_fn_error $? "unable to find iconv.h headers (libc6-dev may be missing)" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "unable to find iconv.h headers (libc6-dev may be missing)" "$LINENO" 5 ;; +esac fi done @@ -5817,8 +5965,9 @@ if test "x$ac_cv_func_iconv" = xyes then : printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h -else $as_nop - as_fn_error $? "unable to find iconv() function" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "unable to find iconv() function" "$LINENO" 5 ;; +esac fi done @@ -5839,15 +5988,21 @@ printf %s "checking for library containing trio_printf... " >&6; } if test ${ac_cv_search_trio_printf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char trio_printf (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char trio_printf (void); int main (void) { @@ -5878,11 +6033,13 @@ done if test ${ac_cv_search_trio_printf+y} then : -else $as_nop - ac_cv_search_trio_printf=no +else case e in #( + e) ac_cv_search_trio_printf=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_trio_printf" >&5 printf "%s\n" "$ac_cv_search_trio_printf" >&6; } @@ -5891,18 +6048,20 @@ if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -else $as_nop - as_fn_error $? "unable to find trio_copy() function" "$LINENO" 5 - +else case e in #( + e) as_fn_error $? "unable to find trio_copy() function" "$LINENO" 5 + ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "trio.h" "ac_cv_header_trio_h" "$ac_includes_default" if test "x$ac_cv_header_trio_h" = xyes then : -else $as_nop - as_fn_error $? "unable to find trio.h header file (dev version not installed?)" "$LINENO" 5 - +else case e in #( + e) as_fn_error $? "unable to find trio.h header file (dev version not installed?)" "$LINENO" 5 + ;; +esac fi else @@ -5984,8 +6143,8 @@ printf "%s\n" "$as_me: using bundled libtrio" >&6;} # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6015,14 +6174,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # '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. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -6216,8 +6375,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PCRE2_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PCRE2_CONFIG in +else case e in #( + e) case $PCRE2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PCRE2_CONFIG="$PCRE2_CONFIG" # Let the user override the test with a path. ;; @@ -6242,6 +6401,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PCRE2_CONFIG=$ac_cv_path_PCRE2_CONFIG @@ -6285,14 +6445,15 @@ fi if test "${PCRE2_CONFIG}" != false; then PCRE2_PATH=$(${PCRE2_CONFIG} --prefix) - as_ac_Header=`printf "%s\n" "ac_cv_header_"$PCRE2_PATH/include/pcre2.h"" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_"$PCRE2_PATH/include/pcre2.h"" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" ""$PCRE2_PATH/include/pcre2.h"" "$as_ac_Header" "#define PCRE2_CODE_UNIT_WIDTH 8 " if eval test \"x\$"$as_ac_Header"\" = x"yes" then : -else $as_nop - PCRE2_CONFIG=false +else case e in #( + e) PCRE2_CONFIG=false ;; +esac fi fi @@ -6400,8 +6561,8 @@ printf "%s\n" "$as_me: using bundled PCRE2 regular expressions library" >&6;} # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6431,14 +6592,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # '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. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -6552,8 +6713,9 @@ fi if test ${with_libchardet+y} then : withval=$with_libchardet; given_libchardet=$withval -else $as_nop - given_libchardet='yes' +else case e in #( + e) given_libchardet='yes' ;; +esac fi @@ -6750,8 +6912,8 @@ printf "%s\n" "yes" >&6; } # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6781,14 +6943,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # '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. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -6904,8 +7066,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6935,14 +7097,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # '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. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -7032,7 +7194,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -7041,12 +7202,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -7118,7 +7280,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# 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 @@ -7147,7 +7309,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -7187,11 +7348,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -7205,11 +7367,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -7292,9 +7455,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -7375,10 +7538,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -7394,7 +7559,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7425,7 +7590,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -7458,10 +7623,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7521,8 +7686,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -7530,8 +7695,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -7587,7 +7752,7 @@ do "tests/testhm") CONFIG_FILES="$CONFIG_FILES tests/testhm" ;; "src/defaults.h") CONFIG_FILES="$CONFIG_FILES src/defaults.h" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -7606,7 +7771,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -7630,7 +7795,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -7788,13 +7953,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -7904,7 +8069,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -7926,19 +8091,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # 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 '` @@ -8066,7 +8231,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -8096,9 +8261,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/configure.ac b/configure.ac index de6deb53..99f0de2a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ([2.71]) +AC_PREREQ([2.72]) AC_REVISION($Revision: 1.2 $)dnl AC_INIT AC_CONFIG_SRCDIR([src/hypermail.c]) @@ -49,6 +49,7 @@ AC_PROG_CPP AC_PROG_YACC AC_CHECK_PROG(YACC_CHECK,$YACC,yes) AS_IF([test x"$YACC_CHECK" != x"yes"], [AC_MSG_ERROR([Please install either bison or yacc and run configure again])]) +AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -90,7 +91,7 @@ export CFLAGS CC AC_SUBST(INSTALL) AC_MSG_CHECKING([that the compiler works]) -AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(int ac, char **av) { return 0; } ]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) +AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int ac, char **av) { return 0; } ]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.)],[AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.)]) dnl =========================================================================== @@ -160,16 +161,6 @@ dnl =========================================================================== dnl Checks headers dnl =========================================================================== -m4_warn([obsolete], -[The preprocessor macro `STDC_HEADERS' is obsolete. - Except in unusual embedded environments, you can safely include all - ISO C90 headers unconditionally.])dnl -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. -AC_CHECK_INCLUDES_DEFAULT -AC_PROG_EGREP - - AC_CHECK_HEADERS(alloca.h arpa/inet.h ctype.h dirent.h errno.h \ fcntl.h inttypes.h locale.h malloc.h netdb.h netinet/in.h pwd.h stdarg.h \ stdint.h stdio.h stdlib.h string.h sys/dir.h sys/param.h sys/socket.h \ @@ -177,20 +168,6 @@ AC_CHECK_HEADERS(alloca.h arpa/inet.h ctype.h dirent.h errno.h \ AC_HEADER_STAT AC_HEADER_DIRENT -m4_warn([obsolete], -[Update your code to rely only on HAVE_SYS_TIME_H, -then remove this warning and the obsolete code below it. -All current systems provide time.h; it need not be checked for. -Not all systems provide sys/time.h, but those that do, all allow -you to include it and time.h simultaneously.])dnl -AC_CHECK_HEADERS_ONCE([sys/time.h]) -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both - and . This macro is obsolete.]) -fi -# End of obsolete code. - AC_CHECK_DECLS([isblank, strcasecmp, strcasestr]) diff --git a/contrib/hyparchive-msgid-scrapper.pl b/contrib/hyparchive-msgid-scrapper.pl new file mode 100755 index 00000000..8ca90fc9 --- /dev/null +++ b/contrib/hyparchive-msgid-scrapper.pl @@ -0,0 +1,66 @@ +#!/usr/bin/env perl + +# This script goes thru a hypermail html archive and outputs the file +# name and the message-id associated with each message to stdout + +# usage hyparchive-msgid-scrapper /path/to/hypermail/archive + +use strict; +use warnings; + +sub usage_and_quit { + print "This script goes thru a hypermail html archive and outputs the file\n" + . "name and the message-id associated with each message to stdout\n\n"; + print "$0 /path/to/hypermail/archive\n\n"; + exit(0) +} + +sub get_msgid { + my $filename = shift; + my $msgid; + + open (my $FILE, "<$filename") || die "Cannot open $filename: $!\n"; + while (<$FILE>) { + chomp; + if (/^$/) { + $msgid = $_; + last; + } + } + close ($FILE); + + $msgid =~ s/^$//; + + return $msgid; +} + +my ($hm_archive_path) = @ARGV; + +if (not defined $hm_archive_path) { + usage_and_quit(); +} + +if ($hm_archive_path =~ /.*\/$/) { + $hm_archive_path =~ s/\/$//; +} + + +opendir(my $ARCHIVE, $hm_archive_path) || die "Can't open directory $hm_archive_path: $!\n"; +foreach my $cursor (sort readdir($ARCHIVE)) { + # skip files not created by hypermail + my $filename = "$hm_archive_path/$cursor"; + if ((-d $filename) + || (-l $filename) + || (-z $filename) + || ($filename !~ /\/?[0-9]+\.html$/)) { + next; + } + + # extract msgid from file + my $msgid = get_msgid($filename); + # replace @ substitution + print "$cursor:$msgid\n"; +} + +closedir($ARCHIVE); diff --git a/docs/hypermail.1 b/docs/hypermail.1 index c40959ab..a079cd74 100644 --- a/docs/hypermail.1 +++ b/docs/hypermail.1 @@ -137,6 +137,13 @@ to submit new messages to the list the hypermail archive serves. This is a means of setting any variable that can be specified in a config file. .TP +.B \-y +This tells Hypermail to do a +.B dry\-run +that won't generate any archive; however it will output +the file names and Message-IDs associated with the archive. It can help you visualize the +issues you may have when upgrading from an older Hypermail archive to a more recent one. +.TP .B \-p This shows a progress report as Hypermail reads in and writes out messages \- the number of files that Hypermail is reading and writing and the file names of the directory and files created are shown. .TP diff --git a/docs/hypermail.html b/docs/hypermail.html index a42cbc19..491e4591 100644 --- a/docs/hypermail.html +++ b/docs/hypermail.html @@ -272,9 +272,15 @@

Command-Line Options

last updated.

Miscellaneous Options

+
-y
-p
-v
-V
+

The -y option tells hypermail to do a dry-run; that is, it +won't generate any HTML archive; however it will output the file names and +Message-IDs associated to them that it would have generated in the archive. It +may help you see what issues you may have when upgrading from one hypermail +version to a newever one.

The -p option shows a progress report as Hypermail reads in and writes out messages - the number of files that Hypermail is reading and writing and the file names of the diff --git a/src/file.c b/src/file.c index 6917ca6c..cfc512ce 100644 --- a/src/file.c +++ b/src/file.c @@ -88,6 +88,10 @@ void check1dir(char *dir) { struct stat sbuf; + if (set_dry_run) { + return; + } + if (stat(dir, &sbuf)) { /* ** LCC only has the short mkdir(). Fortunately, we do a chmod diff --git a/src/getdate.h b/src/getdate.h index 006c61c6..b8f35a94 100644 --- a/src/getdate.h +++ b/src/getdate.h @@ -28,17 +28,13 @@ # include # endif # include -# ifdef TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H # include +# endif +# ifdef HAVE_TIME_H # include -# else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif # endif -#endif /* defined (vms) */ +#endif /* defined (vms) */ #ifdef NO_MACRO #undef isspace diff --git a/src/hypermail.c b/src/hypermail.c index 45a9f4fb..c1ee340a 100644 --- a/src/hypermail.c +++ b/src/hypermail.c @@ -153,6 +153,7 @@ void usage(void) printf(" -V : %s\n", lang[MSG_OPTION_VERSION]); printf(" -x : %s\n", lang[MSG_OPTION_X]); printf(" -X : %s\n", lang[MSG_OPTION_XML]); + printf(" -y : %s\n", lang[MSG_OPTION_Y]); printf(" -1 : %s\n", lang[MSG_OPTION_1]); printf(" -L lang : %s (", lang[MSG_OPTION_LANG]); @@ -196,7 +197,7 @@ int main(int argc, char **argv) opterr = 0; -#define GETOPT_OPTSTRING ("a:Ab:c:d:gil:L:m:n:o:ps:tTuvVxX0:1M?") +#define GETOPT_OPTSTRING ("a:Ab:c:d:gil:L:m:n:o:ps:tTuvVxXy0:1M?") /* get pre config options here */ while ((i = getopt(argc, argv, GETOPT_OPTSTRING)) != -1) { @@ -226,6 +227,7 @@ int main(int argc, char **argv) case 'u': case 'x': case 'X': + case 'y': case '0': case '1': case 'M': @@ -318,6 +320,9 @@ int main(int argc, char **argv) case 'X': set_writehaof = TRUE; break; + case 'y': + set_dry_run = TRUE; + break; case '0': set_delete_msgnum = add_list(set_delete_msgnum, optarg); break; @@ -603,12 +608,15 @@ int main(int argc, char **argv) * there first... */ - checkdir(set_dir); + if (!set_dry_run) { + checkdir(set_dir); + } /* write the default css if any of the two custom ones was not declared */ - if (! (set_icss_url && *set_icss_url) || - ! (set_mcss_url && *set_mcss_url)) { + if (!set_dry_run + && ( ! (set_icss_url && *set_icss_url) || + ! (set_mcss_url && *set_mcss_url))) { char *filename; @@ -625,7 +633,7 @@ int main(int argc, char **argv) * Let's do it. */ - if (set_uselock) + if (!set_dry_run && set_uselock) lock_archive(set_dir); if (set_increment == -1) { @@ -687,8 +695,15 @@ int main(int argc, char **argv) max_msgnum = set_startmsgnum - 1; loadoldheaders(set_dir); } + amount_new = parsemail(set_mbox, use_stdin, set_readone, set_increment, set_dir, set_inlinehtml, set_startmsgnum); /* number from 0 */ + + if (set_dry_run) { + printdryrun(0, max_msgnum + 1); + exit(0); + } + if (!set_mbox_shortened && !matches_existing(0)) { progerr("First message in mailbox does not " "match first message in archive\n" diff --git a/src/hypermail.h b/src/hypermail.h index 4f126f47..e2e6c968 100644 --- a/src/hypermail.h +++ b/src/hypermail.h @@ -52,9 +52,11 @@ #include #endif -#ifdef TM_IN_SYS_TIME +#ifdef HAVE_SYS_TIME_H #include -#else +#endif + +#ifdef HAVE_TIME_H #include #endif diff --git a/src/lang.h b/src/lang.h index ec265819..3d602554 100644 --- a/src/lang.h +++ b/src/lang.h @@ -261,6 +261,9 @@ struct language_entry { #define MSG_EMPTY_ARCHIVE_NOTICE 176 #define MSG_CSS_NORMAL_VIEW 177 +/* another option that should be in hypermail.c */ +#define MSG_OPTION_Y 178 + #ifdef MAIN_FILE /* @@ -462,6 +465,7 @@ char *de[] = { /* German */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -650,6 +654,7 @@ char *pl[] = { /* English */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -839,6 +844,7 @@ char *en[] = { /* English */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -1039,6 +1045,7 @@ char *es[] = { /* Espanol/Spanish */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table */ }; @@ -1230,6 +1237,7 @@ char *pt[] = { /* Brazilian Portuguese */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -1417,6 +1425,7 @@ char *fi[] = { /* Finnish */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -1607,6 +1616,7 @@ char *it[] = { /* Italian */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -1796,6 +1806,7 @@ char *fr[] = { /* French */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -1987,6 +1998,7 @@ char *is[] = { /* Icelandic */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -2181,6 +2193,7 @@ char *sv[] = { "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -2375,6 +2388,7 @@ char *no[] = { "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -2570,6 +2584,7 @@ char *gr[] = { /* Greek */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; @@ -2757,6 +2772,7 @@ char *ru[] = { /* Russian */ "Attachments for message", /* MSG_ATTACHMENTS_FOR_MESSAGE_NOTICE */ "(no messages are available in this archive)", /* MSG_EMPTY_ARCHIVE_NOTICE */ "Normal view", /* MSG_CSS_NORMAL_VIEW */ + "Do a dry-run of hypermail, without generating any file", /* MSG_OPTION_Y - STDOUT */ NULL, /* End Of Message Table - NOWHERE*/ }; diff --git a/src/parse.c b/src/parse.c index 18dba039..e7a81649 100644 --- a/src/parse.c +++ b/src/parse.c @@ -317,7 +317,7 @@ char *safe_filename(char *name) while (*np && (*np == ' ' || *np == '\t')) np++; - if (!*np || !*np == '\n' || *np == '\r') { + if (!*np || !(*np == '\n') || *np == '\r') { /* filename is made of only spaces; replace them with REPLACEMENT_CHAR */ np = name; @@ -352,7 +352,7 @@ create_attachname(char *attachname, int max_len) if(max_i >= max_len) max_i = max_len - 1; i = max_i; - while(i >= 0 && i > max_i - sizeof(suffix) && attachname[i] != '.') + while( i >= 0 && i > (max_i - (int) sizeof(suffix)) && attachname[i] != '.' ) --i; if(i >= 0 && attachname[i] == '.') strncpy(suffix, attachname + i, sizeof(suffix) - 1); @@ -902,6 +902,135 @@ char *getreply(char *line) RETURN_PUSH(buff); } +/* Converts an RFC-822 header line to UTF-8. If there's no declared +** charset, it will try to use the Content-Type charset. If it fails, +** it will call the chardet library. +** If the function fails to detect the charset, it will return an +** "(invalid string)" string. +** Input: +** string: RFC-822 header line to convert +** ct_charset: charset as declared in the Content-Type line +** charsetsave: the previous detected charset for this message +** Output +** converted line (must be freed by caller) + +** charsetsave: If libchardet detects a chardet that is different from +** the current charsetsave for this message, charsetsave will be +** update to the newly detected charset. +*/ +static char * +header_detect_charset_and_convert_to_utf8 (char *string, char *ct_charset, char *charsetsave) +{ + if ( i18n_is_valid_us_ascii(string) ) { + /* nothing to do, passing thru */ + } + + /* RFC6532 allows for using UTF-8 as a header value; we make + sure that it is valid UTF-8 */ + else if ( i18n_is_valid_utf8(string) ) { + /* "default" UTF-8 charset */ + strcpy(charsetsave, "UTF-8"); + + } else { + char header_name[129]; + char *header_value; + struct Push pbuf; + + /* + ** save the header_name:\s + */ + INIT_PUSH(pbuf); + + sscanf(string, "%127[^:]", header_name); + PushString(&pbuf, header_name); + + header_value = string + strlen(header_name); + PushByte(&pbuf, *header_value); + header_value++; + PushByte(&pbuf, *header_value); + header_value++; + +#if defined HAVE_CHARDET && HAVE_ICONV + { + /* + * try to detect the charset of the string and convert it to UTF-8; + * in case of failure, replace the header value with "(invalid string)" + */ + bool did_anything = FALSE; + + + char *detected_charset; + char *conv_string; + + size_t conv_string_sz; + + /* + **consider the header_value everything after header_name:\s + */ + + /* let's try the charset if present in Content-Type */ + if (ct_charset && *ct_charset) { + conv_string = i18n_convstring(header_value, ct_charset, "UTF-8", &conv_string_sz); + if (conv_string) { + if ( i18n_is_valid_utf8(conv_string) ) { + PushString(&pbuf, conv_string); + did_anything = TRUE; + } + free(conv_string); + } + } + + /* nope, let's try the previous saved_charset */ + if ( !did_anything && charsetsave && *charsetsave) { + conv_string = i18n_convstring(header_value, ct_charset, "UTF-8", &conv_string_sz); + if (conv_string) { + if ( i18n_is_valid_utf8(conv_string) ) { + PushString(&pbuf, conv_string); + did_anything = TRUE; + } + free(conv_string); + } + } + + /* nope, let's try to libchardet */ + if ( !did_anything ) { + detected_charset = i18n_charset_detect(header_value); + + if ( detected_charset ) { + /* we detected a charset */ + if ( detected_charset[0] != '\0' ) { + conv_string = i18n_convstring(header_value, + detected_charset, "UTF-8", &conv_string_sz); + if ( conv_string) { + if ( i18n_is_valid_utf8(conv_string) ) { + int detected_charsetlen = + strlen(detected_charset) < 255 ? strlen(detected_charset) : 255; + memcpy(charsetsave, detected_charset, detected_charsetlen); + charsetsave[detected_charsetlen] = '\0'; + PushString(&pbuf, conv_string); + did_anything = TRUE; + } + free(conv_string); + } + } + free(detected_charset); + } + } + + if (!did_anything) { + PushString (&pbuf, "(invalid string)"); + } + } +#else /* ! CHARDET && ICONV */ + PushString (&pbuf, "(invalid string)"); +#endif + free(string); + string = PUSH_STRING(pbuf); + } + + return string; +} + static char * extract_rfc2047_content(char *iptr) { @@ -1121,75 +1250,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave) } else { free(storage); - - if ( i18n_is_valid_us_ascii(string) ) { - /* nothing to do, passing thru */ - } - - /* RFC6532 allows for using UTF-8 as a header value; we make - sure that it is valid UTF-8 */ - else if ( i18n_is_valid_utf8(string) ) { - /* "default" UTF-8 charset */ - strcpy(charsetsave, "UTF-8"); - - } else { - - /* - * try to detect the charset of the string and convert it to UTF-8; - * in case of failure, replace the header value with "(invalid string)" - */ - -#if defined HAVE_CHARDET && HAVE_ICONV - char *charset; - char *conv_string; - char header_name[129]; - char *header_value; - struct Push pbuf; - - INIT_PUSH(pbuf); - - sscanf(string, "%127[^:]", header_name); - - /* save the header_name:\s */ - PushString(&pbuf, header_name); - - header_value = string + strlen(header_name); - PushByte(&pbuf, *header_value); - header_value++; - PushByte(&pbuf, *header_value); - header_value++; - - /* consider the header_value everything after header_name:\s */ - charset = i18n_charset_detect(header_value); - - if (!charset || charset[0] == '\0' && !strcmp(charset, "UTF-8") ) { - PushString (&pbuf, "(invalid string)"); - } - else { - size_t conv_string_sz; - conv_string = i18n_convstring(header_value, charset, "UTF-8", &conv_string_sz); - if ( !i18n_is_valid_utf8(conv_string) ) { - free(conv_string); - PushString (&pbuf, "(invalid string)"); - } else { - int charsetlen = strlen(charset) < 255 ? strlen(charset) : 255; - memcpy(charsetsave,charset,charsetlen); - charsetsave[charsetlen] = '\0'; - PushString(&pbuf, conv_string); - free(conv_string); - } - free(charset); - } - - free(string); - string = PUSH_STRING(pbuf); -#else - free(string); - string = strsav("(invalid string)"); -#endif - } - - return string; + return string; } } @@ -2157,7 +2218,6 @@ int parsemail(char *mbox, /* file name */ /* skip the mime epilogue until we find a known boundary or a new message */ if (skip_mime_epilogue) { - int l = strlen(line); if ((strncmp(line, "--", 2) || _is_signature_separator(line) || !boundary_stack_has_id(boundp, line)) @@ -2228,6 +2288,171 @@ int parsemail(char *mbox, /* file name */ * variables */ + /* the first header we'll extract is Content-Type + so that we can get the charset and use it if we + get messages that are not using UTF-8 but encoding + their header values with 8-bit */ + + /* testing separating parsing from post-processing */ + /* extract content-type and other values from the headers */ + content_type_ptr = NULL; + + /* @@ we were using headp and here it is bp... test with attachments */ + + for (head = bp; head; head = head->next) { + if (head->parsedheader || !head->header || head->invalid_header) + continue; + + if (!strncasecmp(head->line, "Content-Type:", 13)) { + char *ptr = head->line + 13; +#define DISP_HREF 1 +#define DISP_IMG 2 +#define DISP_IGNORE 3 + /* we must make sure this is not parsed more times + than this */ + head->parsedheader = TRUE; + + while (isspace(*ptr)) + ptr++; + + /* @@ if ptr is bogus, initialize it to default text/plain? */ + /* some bogus mail messages have empty Content-Type headers */ + if (*ptr) { + content_type_ptr = ptr; + sscanf(ptr, "%128[^;]", type); + filter_content_type_values(type); + } + + /* now, check if there's a charset indicator here too! */ + cp = strcasestr(ptr, "charset="); + if (cp) { + cp += 8; /* pass charset= */ + if ('\"' == *cp) + cp++; /* pass a quote too if one is there */ + + sscanf(cp, "%128[^;\"\n\r]", charbuffer); + /* @@ we need a better filter here, to remove all non US-ASCII */ + filter_content_type_values(charbuffer); + /* some old messages use DEFAULT_CHARSET or foo_CHARSET, + we strip it out */ + filter_charset_value(charbuffer); + /* save the charset info */ + if (charbuffer[0] != '\0') { + charset = strsav(charbuffer); + } + } + + /* now check if there's a format indicator */ + if (set_format_flowed) { + cp = strcasestr(ptr, "format="); + if (cp) { + cp += 7; /* pass charset= */ + if ('\"' == *cp) + cp++; /* pass a quote too if one is there */ + + sscanf(cp, "%128[^;\"\n\r]", charbuffer); + /* save the format info */ + if (!strcasecmp (charbuffer, "flowed")) + textplain_format = FORMAT_FLOWED; + } + + /* now check if there's a delsp indicator */ + cp = strcasestr(ptr, "delsp="); + if (cp) { + cp += 6; /* pass charset= */ + if ('\"' == *cp) + cp++; /* pass a quote too if one is there */ + + sscanf(cp, "%128[^;\"\n\r]", charbuffer); + /* save the delsp info */ + if (!strcasecmp (charbuffer, "yes")) + delsp_flag = TRUE; + } + } + break; + } + + } /* for content-type */ + + /* post-processing Content-Type: + check if we have the a Content=Type, a boundary parameter, + and a corresponding start bondary + revert to a default type otherwise. + */ + if (content_type_ptr == NULL) { + /* missing Content-Type header, use default text/plain unless + immediate parent is multipart/digest; in that case, use + message/rfc822 (RFC 2046) */ + if (multipart_stack_top_has_type(multipartp, "multipart/digest") + && !attachment_rfc822) { + strcpy(type, "message/rfc822"); + } else { + strcpy(type, "text/plain"); + } + content_type_ptr = type; +#if DEBUG_PARSE + printf("Missing Content-Type header, defaulting to %s\n", type); +#endif + } else if (!strncasecmp(type, "multipart/", 10)) { + boundary_id = strcasestr(content_type_ptr, "boundary="); +#if DEBUG_PARSE + printf("boundary found in %s\n", content_type_ptr); +#endif + if (boundary_id) { + boundary_id = strchr(boundary_id, '='); + if (boundary_id) { + boundary_id++; + while (isspace(*boundary_id)) + boundary_id++; + *boundbuffer ='\0'; + if ('\"' == *boundary_id) { + sscanf(++boundary_id, "%255[^\"]", + boundbuffer); + } + else + sscanf(boundary_id, "%255[^;\n]", + boundbuffer); + boundary_id = (*boundbuffer) ? boundbuffer : NULL; + } + } + + /* if we have multipart/ but there's no missing + boundary attribute, downgrade the content type to + text/plain */ + if (!boundary_id) { + strcpy(type, "text/plain"); + content_type_ptr = type; +#if DEBUG_PARSE + printf("Missing boundary attribute in multipart/*, downgrading to text/plain\n"); +#endif + } + } + + /* have we reached the too many attachments per message limit? + this protects against the message_node tree growing + uncontrollably */ + if ((set_max_attach_per_msg != 0) + && (att_counter > set_max_attach_per_msg)) { + content = CONTENT_IGNORE; +#if DEBUG_PARSE + printf("Hit max_attach_per_msg limit; ignoring further attachments for msgid %s\n", msgid); +#endif + } + + if (content == CONTENT_IGNORE) { + continue; + } else if (ignorecontent(type)) { + /* don't save this */ + content = CONTENT_IGNORE; + continue; + } +#if 0 + /* not sure if we should add charset save here or wait until later */ + if (charset[0] == NULL) { + strcpy(charset, set_default_charset); + } +#endif + /* parsing of all headers except for Content-* related ones */ for (head = bp; head; head = head->next) { char head_name[129]; @@ -2241,7 +2466,6 @@ int parsemail(char *mbox, /* file name */ } if (head->header && !head->demimed) { - char *ptr; /* control that we have a valid header line */ if ( !_validate_header(head->line) ) { @@ -2351,6 +2575,10 @@ int parsemail(char *mbox, /* file name */ ignore them */ continue; } + head->line = header_detect_charset_and_convert_to_utf8 (head->line, + charset, + charsetsave); + getname(head->line, &namep, &emailp); if (set_spamprotect) { char *tmp; @@ -2371,6 +2599,9 @@ int parsemail(char *mbox, /* file name */ processing it over and over here below */ head->parsedheader = TRUE; + head->line = header_detect_charset_and_convert_to_utf8 (head->line, + charset, + charsetsave); strlftonl(head->line); } else if (!strncasecmp(head->line, "Message-Id:", 11)) { @@ -2387,6 +2618,9 @@ int parsemail(char *mbox, /* file name */ } else if (!strncasecmp(head->line, "Subject:", 8)) { head->parsedheader = TRUE; + head->line = header_detect_charset_and_convert_to_utf8 (head->line, + charset, + charsetsave); strlftonl(head->line); if (!message_headers_parsed) { if (hassubject) { @@ -2512,6 +2746,7 @@ int parsemail(char *mbox, /* file name */ attach_force = FALSE; #if NEW_PARSER +#if 0 /* testing separating parsing from post-processing */ /* extract content-type and other values from the headers */ content_type_ptr = NULL; @@ -2640,7 +2875,7 @@ int parsemail(char *mbox, /* file name */ #endif } } - +#endif /* 0 */ /* a limit to avoid having the message_node tree growing uncontrollably */ if ((set_max_attach_per_msg != 0) @@ -5707,7 +5942,7 @@ void fixreplyheader(char *dir, int num, int remove_maybes, int max_update) the replies anchor */ trio_snprintf(current_maybe_pattern, sizeof(current_maybe_pattern), "
  • %s: %s: %s: %s: %s: %s: msgid, "--")) { + msgid = convdash(email->msgid); + } else { + msgid = email->msgid; + } + + printf("%s.%s:%s\n", message_name(email), set_htmlsuffix, msgid); + + if (msgid != email->msgid) { + free (msgid); + } + + num++; + } +} /* end printdryrun() */ + /* ** Write the date index... ** If email != NULL, write index for the subdir in which that email is. diff --git a/src/print.h b/src/print.h index dc724724..cf3ba899 100644 --- a/src/print.h +++ b/src/print.h @@ -39,6 +39,7 @@ char *print_leading_whitespace(FILE *, char *); void update_deletions(int); void writearticles(int, int); +void printdryrun(int, int); void writedates(int, struct emailinfo *); void writesubjects(int, struct emailinfo *); void writethreads(int, struct emailinfo *); diff --git a/src/setup.c b/src/setup.c index 2d69db50..58d0fb32 100644 --- a/src/setup.c +++ b/src/setup.c @@ -77,6 +77,7 @@ bool set_gmtime; bool set_isodate; bool set_require_msgids; bool set_discard_dup_msgids; +bool set_dry_run; bool set_usemeta; bool set_userobotmeta; bool set_uselock; @@ -441,6 +442,13 @@ struct Config cfg[] = { "# Set this to Off to accept messages without a Message-ID header.\n" "# By default such messages are discarded.\n", FALSE}, + {"dry_run", &set_dry_run, BFALSE, CFG_SWITCH, + "# Set this to On if you want to do a dry-run of hypermail,\n" + "# This will output to stdout the archive filenames and their\n" + "# associated Message-ID that hypermail would have created.\n" + "# This can be useful to detect differences between two hypermail\n" + "# versions.\n", FALSE}, + {"usemeta", &set_usemeta, BFALSE, CFG_SWITCH, "# Set this to On to store the content type of a MIME attachment in\n" "# a metadata file.\n", FALSE}, diff --git a/src/setup.h b/src/setup.h index 04c97d01..34b17ca0 100644 --- a/src/setup.h +++ b/src/setup.h @@ -93,6 +93,7 @@ extern bool set_gmtime; extern bool set_isodate; extern bool set_require_msgids; extern bool set_discard_dup_msgids; +extern bool set_dry_run; extern bool set_usemeta; extern bool set_userobotmeta; extern bool set_uselock; diff --git a/src/string.c b/src/string.c index 7346c715..47ea5f81 100644 --- a/src/string.c +++ b/src/string.c @@ -1176,7 +1176,7 @@ bool filter_content_type_values(char *_string) value and the ; char, if yes, cut the string there; some spam messages craft this kind of msgs. */ cp = _string; - while (*cp && !isspace(*cp) && !iscntrl(*cp)) { + while (*cp && !isspace(*cp) && *cp > 0x20 && *cp < 0x7E) { cp++; } if (*cp != '\0') { @@ -1200,6 +1200,22 @@ bool filter_charset_value(char *_string) char *filters[] = {"DEFAULT_CHARSET", "_CHARSET", NULL}; int i; + if (!cp) + return FALSE; + + cp = _string; + /* truncates charset at first invalid character */ + while (*cp) { + /* these seem to be the only valid characters for charset names + according to IANA + https://www.iana.org/assignments/character-sets/character-sets.xhtml */ + if (!isalnum(*cp) && *cp != '_' && *cp != '-' && *cp !=':' && !isspace(*cp)) { + *cp = '\0'; + break; + } + cp++; + } + for (i = 0; filters[i] != NULL; i++) { cp = strcasestr(_string, filters[i]); if (cp) { diff --git a/tests/msgid-parsing.mbox b/tests/msgid-parsing.mbox new file mode 100644 index 00000000..2525882b --- /dev/null +++ b/tests/msgid-parsing.mbox @@ -0,0 +1,155 @@ +From foo.bar@example.org Tue Oct 20 03:47:43 2015 +Date: Tue, 20 Oct 2015 03:47:14 +0000 +From: Foo Bar +To: sample-list@example.org +Message-ID: <5625b942877b0_66b486533020897@example.org> +Message-ID: +Mime-Version: 1.0 +Content-Type: text/plain; UTF-8 +Subject: Message-1 : Malformed message with two Message-IDs +Status: O +Content-Length: 391 +Lines: 14 + +This message is malformed and has two Message-ID headers. + + Message-ID: <5625b942877b0_66b486533020897@example.org> + Message-ID: + +In hypermail 2.4, the parser takes into account only the last found +Message-ID it finds: + + tmp@example.org + +In hypermail 3.0, the parser takes into account only the first +Message-ID it finds: + + 5625b942877b0_66b486533020897@example.org + +From foo.bar@example.org Tue Oct 20 03:48:43 2015 +Date: Tue, 20 Oct 2015 03:48:14 +0000 +From: Foo Bar +To: sample-list@example.org +Message-ID: +In-Reply-To: <5625b942877b0_66b486533020897@example.org> +Mime-Version: 1.0 +Content-Type: text/plain; UTF-8 +Subject: Message-2 : duplicate message ID effect +Status: O +Content-Length: 548 +Lines: 13 + +The Message-ID of this message has the same value as the second Message-ID +of Message-1. + +Hypermail's parser uses the Message-ID to identify each message. If it +finds a message with a Message-ID it parsed, it assumes it is a duplicate +message and skips the message. + +In hypermail 2.4, this message won't be added to the HTML archive; It already +parsed Message-1, which has the same Message-ID value; the parser will skip +this message. + +In hypermail 3.0, this message will be added to the HTML archive; the +parser hasn't yet parsed this Message-ID. + +From foo.bar@example.org Tue Oct 20 03:50:43 2015 +Date: Tue, 20 Oct 2015 03:50:14 +0000 +From: Foo Bar +To: sample-list@example.org +Message-ID: <5625b942877b0_66b486533020899@example.org> +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="boundary" +Subject: Message-3: malformed attachment that includes a Message-ID +Status: O +Content-Length: 1102 +Lines: 36 + +This is a multi-part message in MIME format. + +--boundary +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This message has a text/plain attachment that is malformed; that +attachment's headers include includes a Message-ID that has the same +value as the second Message-ID of Message-1; it is also the same +Message-ID as that of Message-2: + + tmp@example.org + +This message has a unique Message-ID that hasn't yet been parsed: + + 5625b942877b0_66b486533020899@example.org + +Hypermail 2.4 parser will wrongly replace the Message-ID of the main +message with that of the attachment. It will then skip the message +because it already saw it when it parsed Message-1. + +Hypermail 3.0's parser doesn't have this issue. It only uses the main +message's Message-ID, sees it has not yet seen it and parses and adds +Message-3 to the HTML archive. + +--boundary +Message-Id: tmp@example.org +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encodig: 8bit + +Second attachment for Message 3. + +It is malformed because it contains a Message-ID header that has already +been parsed. + +--boundary-- + +From foo.bar@example.org Tue Oct 20 03:50:43 2015 +Date: Tue, 20 Oct 2015 03:50:14 +0000 +From: Foo Bar +To: sample-list@example.org +Message-ID: <5625b942877b0_66b486533020900@example.org> +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="boundary" +Subject: Message 3 showing different parsing of Message-ID between hypermail 2.4 and 3.0 +Status: RO +Content-Length: 1285 +Lines: 38 + +This is a multi-part message in MIME format. + +--boundary +Content-Type: text/plain; charset=UTF-8 +Content-Disposition: inline + +This message has a message/rfc822 attachment that is forwarding +Message 1 in this mailbox. + +Hypermail 2.4's parser will not add it to the archive because it will +incorrectly use that attachment's MessageID as the one associated with +Message 3, which it has already processed; that is, it will consider +this message a duplicate. + +Hypermail 3.0's parser doesn't make that confusion and will add this message +to the archive: Message 1 and Message 3 have different Message-ID values. + +--boundary +Content-Type: message/rfc822 +Content-Description: (FWD) Message 1 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + +Date: Tue, 20 Oct 2015 03:49:14 +0000 +From: Foo Bar +To: sample-list@example.org +Message-ID: <5625b942877b0_66b486533020897@example.org> +Message-ID: +Mime-Version: 1.0 +Content-Type: text/plain; UTF-8 +Subject: Message 1 showing different parsing of Message-ID between hypermail 2.4 and 3.0 + +In hypermail 2.4, the Message-ID for this message is tmp@example.org +(last one found) + +In hypermail 3.0 the Message-ID for this message is +5625b942877b0_66b486533020897@example.org (first one found) + +--boundary--