Browse Source

Import upstream version 26

Alexander Barton 8 months ago
parent
commit
12d5ad5f27
100 changed files with 8110 additions and 6085 deletions
  1. 6 0
      .mailmap
  2. 8 1
      AUTHORS
  3. 132 3
      ChangeLog
  4. 0 367
      INSTALL
  5. 419 0
      INSTALL.md
  6. 10 12
      Makefile.am
  7. 211 166
      Makefile.in
  8. 68 3
      NEWS
  9. 0 89
      README
  10. 78 0
      README.md
  11. 722 368
      aclocal.m4
  12. 2 2
      ar-lib
  13. 3 1
      autogen.sh
  14. 348 0
      compile
  15. 282 84
      config.guess
  16. 1228 1236
      config.sub
  17. 850 485
      configure
  18. 11 4
      configure.ac
  19. 10 3
      configure.ng
  20. 94 40
      contrib/Debian/Makefile.in
  21. 18 0
      contrib/Debian/changelog
  22. 32 19
      contrib/Debian/control
  23. 167 132
      contrib/MacOSX/Makefile.in
  24. 2 0
      contrib/MacOSX/config.h
  25. 95 41
      contrib/MacOSX/ngIRCd.pmdoc/Makefile.in
  26. 95 41
      contrib/MacOSX/ngIRCd.xcodeproj/Makefile.in
  27. 49 25
      contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
  28. 5 4
      contrib/Makefile.am
  29. 172 135
      contrib/Makefile.in
  30. 8 5
      contrib/README
  31. 126 0
      contrib/de.barton.ngircd.metainfo.xml
  32. 0 17
      contrib/ngindent
  33. 46 0
      contrib/ngindent.sh
  34. 11 15
      contrib/ngircd.spec
  35. 28 0
      contrib/nglog.sh
  36. 0 77
      contrib/systrace.policy
  37. 272 189
      depcomp
  38. 10 5
      doc/Commands.txt
  39. 14 6
      doc/HowToRelease.txt
  40. 5 5
      doc/Makefile.am
  41. 174 138
      doc/Makefile.in
  42. 8 4
      doc/Platforms.txt
  43. 7 1
      doc/Protocol.txt
  44. 6 9
      doc/sample-ngircd.conf.tmpl
  45. 94 40
      doc/src/Makefile.in
  46. 198 214
      install-sh
  47. 99 58
      man/Makefile.in
  48. 8 5
      man/ngircd.8.tmpl
  49. 9 11
      man/ngircd.conf.5.tmpl
  50. 152 268
      missing
  51. 163 127
      src/Makefile.in
  52. 3 0
      src/config.h.in
  53. 1 1
      src/ipaddr/Makefile.am
  54. 167 95
      src/ipaddr/Makefile.in
  55. 1 1
      src/ngircd/Makefile.am
  56. 330 248
      src/ngircd/Makefile.in
  57. 54 10
      src/ngircd/channel.c
  58. 5 1
      src/ngircd/client.c
  59. 1 0
      src/ngircd/conf-ssl.h
  60. 21 190
      src/ngircd/conf.c
  61. 3 2
      src/ngircd/conf.h
  62. 6 2
      src/ngircd/conn-func.c
  63. 1 1
      src/ngircd/conn-func.h
  64. 92 15
      src/ngircd/conn-ssl.c
  65. 57 17
      src/ngircd/conn.c
  66. 11 3
      src/ngircd/conn.h
  67. 1 1
      src/ngircd/defines.h
  68. 2 1
      src/ngircd/irc-info.c
  69. 13 4
      src/ngircd/irc-login.c
  70. 5 4
      src/ngircd/irc-oper.c
  71. 12 2
      src/ngircd/irc-server.c
  72. 3 4
      src/ngircd/log.c
  73. 2 2
      src/ngircd/messages.h
  74. 24 24
      src/ngircd/ngircd.c
  75. 3 2
      src/ngircd/numeric.c
  76. 10 2
      src/ngircd/sighandlers.c
  77. 1 1
      src/portab/Makefile.am
  78. 215 139
      src/portab/Makefile.in
  79. 0 36
      src/portab/ansi2knr.1
  80. 0 738
      src/portab/ansi2knr.c
  81. 4 0
      src/portab/portab.h
  82. 4 1
      src/portab/portabtest.c
  83. 30 3
      src/testsuite/Makefile.am
  84. 149 77
      src/testsuite/Makefile.in
  85. 29 2
      src/testsuite/Makefile.ng
  86. 2 0
      src/testsuite/cleanup-server3
  87. 21 0
      src/testsuite/connect-ssl-cert1-test.e
  88. 22 0
      src/testsuite/connect-ssl-cert2-test.e
  89. 2 0
      src/testsuite/getpid.sh
  90. 43 0
      src/testsuite/join-test.e
  91. 6 0
      src/testsuite/ngircd-test1.conf
  92. 31 0
      src/testsuite/ngircd-test3.conf
  93. 4 0
      src/testsuite/prep-server3
  94. 31 0
      src/testsuite/reload-server.sh
  95. 7 0
      src/testsuite/reload-server3
  96. 1 1
      src/testsuite/server-login-test.e
  97. 24 0
      src/testsuite/ssl/cert-my-first-domain-tld.pem
  98. 24 0
      src/testsuite/ssl/cert-my-second-domain-tld.pem
  99. 77 0
      src/testsuite/ssl/dhparams-my-first-domain-tld.pem
  100. 0 0
      src/testsuite/ssl/dhparams-my-second-domain-tld.pem

+ 6 - 0
.mailmap

@@ -6,6 +6,8 @@ Alexander Barton <alex@barton.de> <alex@kfreebsd.barton.de>
 
 Ali Shemiran <ashemira@ucsd.edu>
 
+Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de> <debian.axhn@manchmal.in-ulm.de>
+
 Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana@cs.ucsd.edu>
 Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana+70@cs.ucsd.edu>
 
@@ -14,3 +16,7 @@ DNS <dns@rbose.org>
 Götz Hoffart <goetz@hoffart.de>
 
 LucentW <lucent@zebes.info> <LucentW@users.noreply.github.com>
+
+Michi <michi+ngircd@dataswamp.org>
+
+Sam James <sam@cmpct.info> <11667869+thesamesam@users.noreply.github.com>

+ 8 - 1
AUTHORS

@@ -2,7 +2,7 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2019 Alexander Barton and Contributors.
+               (c)2001-2020 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
@@ -40,21 +40,27 @@ Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu>
 David Kingston <deathking1337@aim.com>
 DNS <dns@rbose.org>
 Eric Grunow <egrunow@ucsd.edu>
+Fabrice Fontaine <fontaine.fabrice@gmail.com>
 Federico G. Schwindt <fgsch@lodoss.net>
 Gabor Adam Toth <tg@tgbit.net>
 Götz Hoffart <goetz@hoffart.de>
+Hilko Bengen <bengen@hilluzination.de>
 Ian Chard <ian@chard.org>
 Ilja Osthoff <i.osthoff@gmx.net>
 ItsOnlyBinary <ItsOnlyBinary@users.noreply.github.com>
 James Lu <james@overdrivenetworks.com>
 Jari Aalto <jari.aalto@cante.net>
+Johann Hartwig Hauschild <git@hauschild.it>
+JRMU <jrmu@lecturify.com>
 LucentW <lucent@zebes.info>
 Mantas Mikulėnas <grawity@gmail.com>
+Michi <michi+ngircd@dataswamp.org>
 Neale Pickett <neale@woozle.org>
 Peter Powell <petpow@saberuk.com>
 Rolf Eike Beer <eike@sf-mail.de>
 Rosen Penev <rosenp@gmail.com>
 Roy Sindre Norangshol <roy.sindre@norangshol.no>
+Sam James <sam@cmpct.info>
 Scott Perry <scperry@ucsd.edu>
 Sean Reifschneider <jafo-rpms@tummy.com>
 Sebastian Köhler <sebkoehler@whoami.org.uk>
@@ -63,6 +69,7 @@ Tassilo Schweyer <dev@welterde.de>
 Tom Ryder <tom@sanctum.geek.nz>
 Unit 193 <unit193@ubuntu.com>
 William Pitcock <nenolod@dereferenced.org>
+Windree <57554809+Windree@users.noreply.github.com>
 xor <xorboy@gmail.com>
 Yecheng Fu <cofyc.jackson@gmail.com>
 

+ 132 - 3
ChangeLog

@@ -2,12 +2,141 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2019 Alexander Barton and Contributors.
+               (c)2001-2020 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
                                -- ChangeLog --
 
+ngIRCd 26 (2020-06-20)
+
+  ngIRCd 26~rc2 (2020-06-11)
+  - Add AppStream metadata file (contrib/de.barton.ngircd.metainfo.xml).
+  - Don't send invalid CHANINFO commands when a channel has mode +k set but no
+    key is known to the server. This can happen with a misconfigured predefined
+    channel, for example, and looked like this: "CHANINFO #test +Pk  0 :" --
+    note the unset key represented by the two spaces. Fix this by sending a
+    "*" in this case and update the CHANINFO documentation, too.
+  - ngircd.spec: Fix names of README.md and INSTALL.md, add ".md" extension.
+  - Update description texts in the README.md file, the RPM and Debian package
+    files and the manual page: bring them in line with the updated homepage.
+  - Server-Server protocol: Fix use-after-free when unregistering a directly
+    connected server sending a SQUIT for itself.
+  - Server-Server protocol: Detect bogus SERVER commands lacking a prefix.
+    Thanks Hilko Bengen (hillu) for finding & reporting this as well for the
+    patch & pull request (even if fixed differently).
+    Closes #275.
+  - Fix the PING-PONG logic: In ngIRCd 26~rc1 this was completely broken (while
+    trying to fix timeouts during server handshakes in bigger networks): the
+    daemon never disconnected any stale peers but kept sending out PINGs over
+    and over again ...
+  - Test suite: Add missing files needed to test SSL support to "EXTRA_DIST",
+    so that they are included in distribution archives: in rc1, "make check"
+    fails when using sources from an archive and enabling SSL support.
+    Thanks to Hilko Bengen <bengen@hilluzination.de> for the patch!
+
+  ngIRCd 26~rc1 (2020-05-10)
+  - Tweak & update doc/HowToRelease.txt, .mailmap and AUTHORS files.
+  - Allow up to 512 characters per line in MOTD and help text files (but keep
+    in mind that lines can't get that long, because they have to be prefixed
+    before being sent to the client). But this allows for more fancy MOTDs :-)
+    Closes #271.
+  - Show the actually allowed channel types in the ISUPPORT(005) numeric which
+    are configured by the "AllowedChannelTypes" configuration variable.
+    Closes #273.
+  - Handle commands in the read buffer before reading more data and don't wait
+    for the network in this case: If there are more bytes in the read buffer
+    already than a single valid IRC command can get long (513 bytes), wait for
+    this/those command(s) to be handled first and don't try to read even more
+    data from the network (which most probably would overflow the read buffer
+    of this connection soon).
+  - Update Travis-CI configuration, "sudo" is deprecated.
+  - Log G-/K-Line changes only when not initiated by a server: this prevents
+    the log from becoming spammed during "net bursts".
+  - Update test suite to include SSL tests, including checking for reloading
+    certificates during runtime.
+  - Makefile.am: Replace "make" with "${MAKE}". This fixes warnings like this:
+    "warning: jobserver unavailable: using -j1. Add `+' to parent make rule."
+    Thanks to Sam James (sam_c) <sam@cmpct.info>!
+    Closes #270.
+  - Add support for GnuTLS certificate reload, which is quite handy when using
+    Let's Encrypt, for example. Until now this was only supported when linked
+    with OpenSSL. Thanks a lot, Hilko Bengen <bengen@hilluzination.de>!
+  - Remove deprecated legacy configuration options and related functions that
+    have been marked for removal for quite some time:
+    - PredefChannelsOnly (v22)
+    - NoticeAuth (v24)
+    - NoXXX (v19)
+    - Old '[GLOBAL]' section handling (v19)
+    Thanks to Michi <michi+ngircd@dataswamp.org> for the patch!
+  - Fix recursion bug on write errors: Depending on the stack size, too many
+    clients on the same channel quitting at the same time would trigger a crash
+    due to too many recursive calls to Conn_Close(). Thanks to Michi
+    <michi+ngircd@dataswamp.org> for the patch!
+  - Fix builds using GCC option -fno-common, which is the default starting with
+    GCC 10. Thanks to Michi <michi+ngircd@dataswamp.org> for the patch!
+    Closes #266.
+  - Convert INSTALL and README files to Markdown.
+  - Allow setting arbitrary channel modes in the configuration file by handling
+    them like in MODE commands, and allow multiple "Modes =" lines per [Channel]
+    section. Thanks to Michi <michi+ngircd@dataswamp.org>!
+    Closes #55.
+  - Add "FNC" (forced nick changes) to ISUPPORT(005) numeric. Most probably
+    this doesn't make any difference to any client, but it seems correct.
+    See <http://www.irc.org/tech_docs/005.html> for details.
+  - Reuse old SSL key if loading a new one failed.
+  - Remove outdated OpenBSD/NetBSD systrace.policy.
+  - Enhance handling of command line errors, and return with exit code 0 ("no
+    error") when "--help" or "--version" is used (which resulted in exit code 1,
+    "error" before). Exit with code 2 ("command line error") for all other
+    invalid command line options, and show the error message itself on stderr
+    (instead of stdout and exit code 1, "generic error", as before).
+    This new behaviour is more in line with the GNU "coding standards",
+    see <https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html>.
+  - Fix and update Xcode project: Reference correct contrib/Makefile.am file,
+    correctly sort contrib/nglog.sh and add "ORGANIZATIONNAME" setting.
+  - contrib/ngindent.sh: Add more GNU indent options for better results, and
+    add the ".sh" suffix to bring this script in line with the others in the
+    contrib/ folder.
+  - Add ./contrib/nglog.sh: This script parses the log output of ngircd(8),
+    and colorizes the messages according to their log level. Example usage:
+    ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
+  - Log received signals with their names using strsignal(3), when available.
+  - Make test suite compatible with Haiku OS.
+  - Fix host mask cloaking bug, don't cloak multiple times: Previously, each
+    server would cloak every user's host mask. The problem is that if a network
+    has more than one server, then a user's host mask would get cloaked twice.
+    This patch ensures that a server only cloaks the host mask if it has not yet
+    been cloaked (the period indicates it's still an IP address). Thanks to
+    JRMU <jrmu@lecturify.com> for the patch!
+    Closes #228.
+  - Enlarge buffers of info texts to 128 bytes. This includes:
+    - "Real name" of a client (4th filed of the USER command).
+    - Server info text ("Info" configuration option).
+    - Admin info texts and email address ("AdminInfo1", "AdminInfo2" and
+      "AdminEmail" configuration options).
+    - Network name ("Network" configuration option).
+    The limit was 64 bytes before ...
+    Closes #258.
+  - Streamline handling of invalid and unset server name: Don't exit during
+    runtime (REHASH command, HUP signal), because the server name can't be
+    changed in this case anyway and the new invalid name will be ignored.
+  - Fix and extend documentation: Fix some typos, fix syntax of LINKS and LIST
+    commands, whitespace and spelling fixes, update dependencies and add some
+    more information about IRCv3 support.
+    Thanks to Thanks Windree, Étienne Mollier <etienne.mollier@mailoo.org> and
+    Christoph Biedl <debian.axhn@manchmal.in-ulm.de>.
+    Closes #264.
+  - Slightly reorder startup steps, and enhance logging:
+    - Show name of configuration file at the beginning of start up.
+    - Add a message when ngIRCd is ready, including its host name.
+    - Show name of configuration file on REHASH (SIGHUP), too.
+    - Change level of "done message" to NOTICE, like "starting" & "ready".
+    - Initialize IO functions before channels, connections, clients, ...
+  - configure.ng: OpenSSL can depends on lz or latomic so use pkg-config to
+    find those dependencies and fallback to existing mechanism.
+    Closes #256.
+  - ngircd.conf.5: Fix wording as suggested by lintian.
 
 ngIRCd 25 (2019-01-23)
 
@@ -201,7 +330,7 @@ ngIRCd 23 (2015-11-16)
     Idea and implementation by LucentW, Thanks! Closes #207.
   - Update ngircd.conf.5: "CloakUserToNick" hides user _and_ real name.
     This closes #208.
-  - Fix case insensitive pattern matching: Up to now, only the the input
+  - Fix case insensitive pattern matching: Up to now, only the input
     string became lowercased and was then compared to the pattern -- which
     failed when the pattern itself wasn't all lowercase!
   - Streamline the effect of "MorePrivacy" option: Update documentation
@@ -554,7 +683,7 @@ ngIRCd 20.3 (2013-08-23)
 ngIRCd 20.2 (2013-02-15)
 
   - Security: Fix a denial of service bug in the function handling KICK
-    commands that could be used by arbitrary users to to crash the daemon
+    commands that could be used by arbitrary users to crash the daemon
     (CVE-2013-1747).
   - WHO command: Use the currently "displayed hostname" (which can be cloaked!)
     for hostname matching, not the real one. In other words: don't display all

+ 0 - 367
INSTALL

@@ -1,367 +0,0 @@
-
-                     ngIRCd - Next Generation IRC Server
-                           http://ngircd.barton.de/
-
-               (c)2001-2019 Alexander Barton and Contributors.
-               ngIRCd is free software and published under the
-                   terms of the GNU General Public License.
-
-                                -- INSTALL --
-
-
-I. Upgrade Information
-~~~~~~~~~~~~~~~~~~~~~~
-
-Differences to version 22.x
-
-- The "NoticeAuth" ngircd.conf configuration variable has been renamed to
-  "NoticeBeforeRegistration". The old "NoticeAuth" variable still works but
-  is deprecated now.
-
-- The default value of the SSL "CipherList" variable has been changed to
-  "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
-  (GnuTLS) to disable the old SSLv3 protocol by default.
-  To enable connections of clients still requiring the weak SSLv3 protocol,
-  the "CipherList" must be set to its old value (not recommended!), which
-  was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
-
-Differences to version 20.x
-
-- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
-  default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
-  Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
-  and "NORMAL" respectively.
-
-- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
-  the new mask will be KILL'ed. This was not the case with earlier versions
-  that only added the mask but didn't kill already connected users.
-
-- The "PredefChannelsOnly" configuration variable has been superseded by the
-  new "AllowedChannelTypes" variable. It is still supported and translated to
-  the appropriate "AllowedChannelTypes" setting but is deprecated now.
-
-Differences to version 19.x
-
-- Starting with ngIRCd 20, users can "cloak" their hostname only when the
-  configuration variable "CloakHostModeX" (introduced in 19.2) is set.
-  Otherwise, only IRC operators, other servers, and services are allowed to
-  set mode +x. This prevents regular users from changing their hostmask to
-  the name of the IRC server itself, which confused quite a few people ;-)
-
-Differences to version 17.x
-
-- Support for ZeroConf/Bonjour/Rendezvous service registration has been
-  removed. The configuration option "NoZeroconf" is no longer available.
-
-- The structure of ngircd.conf has been cleaned up and three new configuration
-  sections have been introduced: [Limits], [Options], and [SSL].
-  Lots of configuration variables stored in the [Global] section are now
-  deprecated there and should be stored in one of these new sections (but
-  still work in [Global]):
-    "AllowRemoteOper"    -> [Options]
-    "ChrootDir"          -> [Options]
-    "ConnectIPv4"        -> [Options]
-    "ConnectIPv6"        -> [Options]
-    "ConnectRetry"       -> [Limits]
-    "MaxConnections"     -> [Limits]
-    "MaxConnectionsIP"   -> [Limits]
-    "MaxJoins"           -> [Limits]
-    "MaxNickLength"      -> [Limits]
-    "NoDNS"              -> [Options], and renamed to "DNS"
-    "NoIdent"            -> [Options], and renamed to "Ident"
-    "NoPAM"              -> [Options], and renamed to "PAM"
-    "OperCanUseMode"     -> [Options]
-    "OperServerMode"     -> [Options]
-    "PingTimeout"        -> [Limits]
-    "PongTimeout"        -> [Limits]
-    "PredefChannelsOnly" -> [Options]
-    "SSLCertFile"        -> [SSL], and renamed to "CertFile"
-    "SSLDHFile"          -> [SSL], and renamed to "DHFile"
-    "SSLKeyFile"         -> [SSL], and renamed to "KeyFile"
-    "SSLKeyFilePassword" -> [SSL], and renamed to "KeyFilePassword"
-    "SSLPorts"           -> [SSL], and renamed to "Ports"
-    "SyslogFacility"     -> [Options]
-    "WebircPassword"     -> [Options]
-  You should adjust your ngircd.conf and run "ngircd --configtest" to make
-  sure that your settings are correct and up to date!
-
-Differences to version 16.x
-
-- Changes to the "MotdFile" specified in ngircd.conf now require a ngircd
-  configuration reload to take effect (HUP signal, REHASH command).
-
-Differences to version 0.9.x
-
-- The option of the configure script to enable support for Zeroconf/Bonjour/
-  Rendezvous/WhateverItIsNamedToday has been renamed:
-    --with-rendezvous  ->  --with-zeroconf
-
-Differences to version 0.8.x
-
-- The maximum length of passwords has been raised to 20 characters (instead
-  of 8 characters). If your passwords are longer than 8 characters then they
-  are cut at an other position now.
-
-Differences to version 0.6.x
-
-- Some options of the configure script have been renamed:
-    --disable-syslog  ->  --without-syslog
-    --disable-zlib    ->  --without-zlib
-  Please call "./configure --help" to review the full list of options!
-
-Differences to version 0.5.x
-
-- Starting with version 0.6.0, other servers are identified using asynchronous
-  passwords: therefore the variable "Password" in [Server]-sections has been
-  replaced by "MyPassword" and "PeerPassword".
-
-- New configuration variables, section [Global]: MaxConnections, MaxJoins
-  (see example configuration file "doc/sample-ngircd.conf"!).
-
-
-II. Standard Installation
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-ngIRCd is developed for UNIX-based systems, which means that the installation
-on modern UNIX-like systems that are supported by GNU autoconf and GNU
-automake ("configure") should be no problem.
-
-The normal installation procedure after getting (and expanding) the source
-files (using a distribution archive or GIT) is as following:
-
-  0) Satisfy prerequisites
-  1) ./autogen.sh  [only necessary when using GIT]
-  2) ./configure
-  3) make
-  4) make install
-
-(Please see details below!)
-
-Now the newly compiled executable "ngircd" is installed in its standard
-location, /usr/local/sbin/.
-
-The next step is to configure and afterwards starting the daemon. Please
-have a look at the ngircd(8) and ngircd.conf(5) manual pages for details
-and all possible options -- and don't forget to run "ngircd --configtest"
-to validate your configuration file!
-
-If no previous version of the configuration file exists (the standard name
-is /usr/local/etc/ngircd.conf), a sample configuration file containing all
-possible options will be installed there. You'll find its template in the
-doc/ directory: sample-ngircd.conf.
-
-
-0): Satisfy prerequisites
-
-When building from source, you'll need some other software to build ngIRCd:
-for example a working C compiler, make tool, GNU automake and autoconf (only
-when not using a distribution archive), and a few libraries depending on the
-features you want to compile in (like IDENT support, SSL, and PAM).
-
-If you are using one of the "big" operating systems or Linux distributions,
-you can use the following commands to install all the required packages to
-build the sources including all optional features and to run the test suite:
-
-* Red Hat / Fedora based distributions:
-
-  yum install \
-    autoconf automake expect gcc glibc-devel gnutls-devel \
-    libident-devel make pam-devel tcp_wrappers-devel telnet zlib-devel
-
-* Debian / Ubuntu based distributions:
-
-  apt-get install \
-    autoconf automake build-essential expect libgnutls-dev \
-    libident-dev libpam-dev libwrap0-dev libz-dev telnet
-
-
-1): "autogen.sh"
-
-The first step, autogen.sh, is only necessary if the configure-script isn't
-already generated. This never happens in official ("stable") releases in
-tar.gz-archives, but when using GIT.
-
-This step is therefore only interesting for developers.
-
-autogen.sh produces the Makefile.in's, which are necessary for the configure
-script itself, and some more files for make. To run autogen.sh you'll need
-GNU autoconf and GNU automake: at least autoconf 2.61 and automake 1.10 are
-required, newer is better. But don't use automake 1.12 or newer for creating
-distribution archives: it will work but lack "de-ANSI-fication" support in the
-generated Makefile's! Stick with automake 1.11.x for this purpose ...
-So automake 1.11.x and autoconf 2.67+ is recommended.
-
-Again: "end users" do not need this step and neither need GNU autoconf nor GNU
-automake at all!
-
-
-2): "./configure"
-
-The configure-script is used to detect local system dependencies.
-
-In the perfect case, configure should recognize all needed libraries, header
-files and so on. If this shouldn't work, "./configure --help" shows all
-possible options.
-
-In addition, you can pass some command line options to "configure" to enable
-and/or disable some features of ngIRCd. All these options are shown using
-"./configure --help", too.
-
-Compiling a static binary will avoid you the hassle of feeding a chroot dir
-(if you want use the chroot feature). Just do something like:
-  CFLAGS=-static ./configure [--your-options ...]
-Then you can use a void directory as ChrootDir (like OpenSSH's /var/empty).
-
-
-3): "make"
-
-The make command uses the Makefiles produced by configure and compiles the
-ngIRCd daemon.
-
-
-4): "make install"
-
-Use "make install" to install the server and a sample configuration file on
-the local system. Normally, root privileges are necessary to complete this
-step. If there is already an older configuration file present, it won't be
-overwritten.
-
-These files and folders will be installed by default:
-
-- /usr/local/sbin/ngircd: executable server
-- /usr/local/etc/ngircd.conf: sample configuration (if not already present)
-- /usr/local/share/doc/ngircd/: documentation
-- /usr/local/share/man/: manual pages
-
-
-III. Additional features
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-The following optional features can be compiled into the daemon by passing
-options to the "configure" script. Most options can handle a <path> argument
-which will be used to search for the required libraries and header files in
-the given paths ("<path>/lib/...", "<path>/include/...") in addition to the
-standard locations.
-
-* Syslog Logging (autodetected by default):
-  --with-syslog[=<path>] / --without-syslog
-
-  Enable (disable) support for logging to "syslog", which should be
-  available on most modern UNIX-like operating systems by default.
-
-* ZLib Compression (autodetected by default):
-  --with-zlib[=<path>] / --without-zlib
-
-  Enable (disable) support for compressed server-server links.
-  The Z compression library ("libz") is required for this option.
-
-* IO Backend (autodetected by default):
-  --with-select[=<path>] / --without-select
-  --with-poll[=<path>] / --without-poll
-  --with-devpoll[=<path>] / --without-devpoll
-  --with-epoll[=<path>] / --without-epoll
-  --with-kqueue[=<path>] / --without-kqueue
-
-  ngIRCd can use different IO "backends": the "old school" select() and poll()
-  API which should be supported by most UNIX-like operating systems, or the
-  more efficient and flexible epoll() (Linux >=2.6), kqueue() (BSD) and
-  /dev/poll APIs.
-  By default the IO backend is autodetected, but you can use "--without-xxx"
-  to disable a more enhanced API.
-  When using the epoll() API, support for select() is compiled in as well by
-  default to enable the binary to run on older Linux kernels (<2.6), too.
-
-* IDENT-Support:
-  --with-ident[=<path>]
-
-  Include support for IDENT ("AUTH") lookups. The "ident" library is
-  required for this option.
-
-* TCP-Wrappers:
-  --with-tcp-wrappers[=<path>]
-
-  Include support for Wietse Venemas "TCP Wrappers" to limit client access
-  to the daemon, for example by using "/etc/hosts.{allow|deny}".
-  The "libwrap" is required for this option.
-
-* PAM:
-  --with-pam[=<path>]
-
-  Enable support for PAM, the Pluggable Authentication Modules library.
-  See doc/PAM.txt for details.
-
-* SSL:
-  --with-openssl[=<path>]
-  --with-gnutls[=<path>]
-
-  Enable support for SSL/TLS using OpenSSL or gnutls libraries.
-  See doc/SSL.txt for details.
-
-* IPv6:
-  --enable-ipv6
-
-  Adds support for version 6 of the Internet Protocol.
-
-
-IV. Useful make-targets
-~~~~~~~~~~~~~~~~~~~~~~~
-
-The Makefile produced by the configure-script contains always these useful
-targets:
-
- - clean: delete every product from the compiler/linker
-   next step: -> make
-
- - distclean: the above plus erase all generated Makefiles
-   next step: -> ./configure
-
- - maintainer-clean: erase all automatic generated files
-   next step: -> ./autogen.sh
-
-
-V. Sample configuration file ngircd.conf
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In the sample configuration file, there are comments beginning with "#" OR
-";" -- this is only for the better understanding of the file.
-
-The file is separated in five blocks: [Global], [Features], [Operator],
-[Server], and [Channel].
-
-In the [Global] section, there is the main configuration like the server
-name and the ports, on which the server should be listening. Options in
-the [Features] section enable or disable functionality in the daemon.
-IRC operators of this server are defined in [Operator] blocks, remote
-servers are configured in [Server] sections, and [Channel] blocks are
-used to configure pre-defined ("persistent") IRC channels.
-
-The meaning of the variables in the configuration file is explained in the
-"doc/sample-ngircd.conf", which is used as sample configuration file in
-/usr/local/etc after running "make install" (if you don't already have one)
-and in the ngircd.conf(5) manual page.
-
-
-VI. Command line options
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-These parameters could be passed to the ngIRCd:
-
--f, --config <file>
-	The daemon uses the file <file> as configuration file rather than
-	the standard configuration /usr/local/etc/ngircd.conf.
-
--n, --nodaemon
-	ngIRCd should be running as a foreground process.
-
--p, --passive
-	Server-links won't be automatically established.
-
--t, --configtest
-	Reads, validates and dumps the configuration file as interpreted
-	by the server. Then exits.
-
-Use "--help" to see a short help text describing all available parameters
-the server understands, with "--version" the ngIRCd shows its version
-number. In both cases the server exits after the output.
-
-Please see the ngircd(8) manual page for complete details!

+ 419 - 0
INSTALL.md

@@ -0,0 +1,419 @@
+# [ngIRCd](https://ngircd.barton.de) - Internet Relay Chat Server
+
+This document explains how to install ngIRCd, the lightweight Internet Relay
+Chat (IRC) server.
+
+The first section lists noteworthy changes to earlier releases; you definitely
+should read this when upgrading your setup! But you can skip over this section
+when you do a fresh installation.
+
+All the subsequent sections describe the steps required to install and
+configure ngIRCd.
+
+## Upgrade Information
+
+Differences to version 25
+
+- **Attention**:
+  All already deprecated legacy options (besides the newly deprecated *Key* and
+  *MaxUsers* settings, see below) were removed in ngIRCd 26, so make sure to
+  update your configuration before upgrading, if you haven't done so already
+  (you got a warning on daemon startup when using deprecated options): you can
+  check your configuration using `ngircd --configtest` -- which is a good idea
+  anyway ;-)
+
+- Setting modes for predefined channels in *[Channel]* sections has been
+  enhanced: now you can set *all* modes, like in IRC "MODE" commands, and have
+  this setting multiple times per *[Channel]* block. Modifying lists (ban list,
+  invite list, exception list) is supported, too.
+
+  Both the *Key* and *MaxUsers* settings are now deprecated and should be
+  replaced by `Modes = +l <limit>` and `Modes = +k <key>` respectively.
+
+Differences to version 22.x
+
+- The *NoticeAuth* `ngircd.conf` configuration variable has been renamed to
+  *NoticeBeforeRegistration*. The old *NoticeAuth* variable still works but
+  is deprecated now.
+
+- The default value of the SSL *CipherList* variable has been changed to
+  "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
+  (GnuTLS) to disable the old SSLv3 protocol by default.
+
+  To enable connections of clients still requiring the weak SSLv3 protocol,
+  the *CipherList* must be set to its old value (not recommended!), which
+  was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
+
+Differences to version 20.x
+
+- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
+  default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
+  Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
+  and "NORMAL" respectively.
+
+- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
+  the new mask will be KILL'ed. This was not the case with earlier versions
+  that only added the mask but didn't kill already connected users.
+
+- The *PredefChannelsOnly* configuration variable has been superseded by the
+  new *AllowedChannelTypes* variable. It is still supported and translated to
+  the appropriate *AllowedChannelTypes* setting but is deprecated now.
+
+Differences to version 19.x
+
+- Starting with ngIRCd 20, users can "cloak" their hostname only when the
+  configuration variable *CloakHostModeX* (introduced in 19.2) is set.
+  Otherwise, only IRC operators, other servers, and services are allowed to
+  set mode +x. This prevents regular users from changing their hostmask to
+  the name of the IRC server itself, which confused quite a few people ;-)
+
+Differences to version 17.x
+
+- Support for ZeroConf/Bonjour/Rendezvous service registration has been
+  removed. The configuration option *NoZeroconf* is no longer available.
+
+- The structure of `ngircd.conf` has been cleaned up and three new configuration
+  sections have been introduced: *[Limits]*, *[Options]*, and *[SSL]*.
+
+  Lots of configuration variables stored in the *[Global]* section are now
+  deprecated there and should be stored in one of these new sections (but
+  still work in *[Global]*):
+
+  - *AllowRemoteOper*    -> [Options]
+  - *ChrootDir*          -> [Options]
+  - *ConnectIPv4*        -> [Options]
+  - *ConnectIPv6*        -> [Options]
+  - *ConnectRetry*       -> [Limits]
+  - *MaxConnections*     -> [Limits]
+  - *MaxConnectionsIP*   -> [Limits]
+  - *MaxJoins*           -> [Limits]
+  - *MaxNickLength*      -> [Limits]
+  - *NoDNS*              -> [Options], and renamed to *DNS*
+  - *NoIdent*            -> [Options], and renamed to *Ident*
+  - *NoPAM*              -> [Options], and renamed to *PAM*
+  - *OperCanUseMode*     -> [Options]
+  - *OperServerMode*     -> [Options]
+  - *PingTimeout*        -> [Limits]
+  - *PongTimeout*        -> [Limits]
+  - *PredefChannelsOnly* -> [Options]
+  - *SSLCertFile*        -> [SSL], and renamed to *CertFile*
+  - *SSLDHFile*          -> [SSL], and renamed to *DHFile*
+  - *SSLKeyFile*         -> [SSL], and renamed to *KeyFile*
+  - *SSLKeyFilePassword* -> [SSL], and renamed to *KeyFilePassword*
+  - *SSLPorts*           -> [SSL], and renamed to *Ports*
+  - *SyslogFacility*     -> [Options]
+  - *WebircPassword*     -> [Options]
+
+  You should adjust your `ngircd.conf` and run `ngircd --configtest` to make
+  sure that your settings are correct and up to date!
+
+Differences to version 16.x
+
+- Changes to the *MotdFile* specified in `ngircd.conf` now require a ngIRCd
+  configuration reload to take effect (HUP signal, *REHASH* command).
+
+Differences to version 0.9.x
+
+- The option of the configure script to enable support for Zeroconf/Bonjour/
+  Rendezvous/WhateverItIsNamedToday has been renamed:
+
+  - `--with-rendezvous`  ->  `--with-zeroconf`
+
+Differences to version 0.8.x
+
+- The maximum length of passwords has been raised to 20 characters (instead
+  of 8 characters). If your passwords are longer than 8 characters then they
+  are cut at an other position now.
+
+Differences to version 0.6.x
+
+- Some options of the configure script have been renamed:
+
+  - `--disable-syslog`  ->  `--without-syslog`
+  - `--disable-zlib`    ->  `--without-zlib`
+
+  Please call `./configure --help` to review the full list of options!
+
+Differences to version 0.5.x
+
+- Starting with version 0.6.0, other servers are identified using asynchronous
+  passwords: therefore the variable *Password* in *[Server]*-sections has been
+  replaced by *MyPassword* and *PeerPassword*.
+
+- New configuration variables, section *[Global]*: *MaxConnections*, *MaxJoins*
+  (see example configuration file `doc/sample-ngircd.conf`!).
+
+## Standard Installation
+
+*Note*: This sections describes installing ngIRCd *from sources*. If you use
+packages available for your operating system distribution you should skip over
+and continue with the *Configuration* section, see below.
+
+ngIRCd is developed for UNIX-based systems, which means that the installation
+on modern UNIX-like systems that are supported by GNU autoconf and GNU
+automake ("`configure` script") should be no problem.
+
+The normal installation procedure after getting (and expanding) the source
+files (using a distribution archive or Git) is as following:
+
+1) Satisfy prerequisites
+2) `./autogen.sh` [only necessary when using "raw" sources with Git]
+3) `./configure`
+4) `make`
+5) `make install`
+
+(Please see details below!)
+
+Now the newly compiled executable "ngircd" is installed in its standard
+location, `/usr/local/sbin/`.
+
+If no previous version of the configuration file exists (the standard name
+is `/usr/local/etc/ngircd.conf)`, a sample configuration file containing all
+possible options will be installed there. You'll find its template in the
+`doc/` directory: `sample-ngircd.conf`.
+
+The next step is to configure and afterwards start the daemon. See the section
+*Configuration* below.
+
+### Satisfy prerequisites
+
+When building from source, you'll need some other software to build ngIRCd:
+for example a working C compiler, make tool, and a few libraries depending on
+the feature set you want to enable at compile time (like IDENT, SSL, and PAM).
+
+And if you aren't using a distribution archive ("tar.gz" file), but cloned the
+plain source archive, you need a few additional tools to generate the build
+system itself: GNU automake and autoconf, as well as pkg-config.
+
+If you are using one of the "big" operating systems or Linux distributions,
+you can use the following commands to install all the required packages to
+build the sources including all optional features and to run the test suite:
+
+#### Red Hat / Fedora based distributions
+
+``` shell
+  yum install \
+    autoconf automake expect gcc glibc-devel gnutls-devel \
+    libident-devel make pam-devel pkg-config tcp_wrappers-devel \
+    telnet zlib-devel
+```
+
+#### Debian / Ubuntu based distributions
+
+``` shell
+  apt-get install \
+    autoconf automake build-essential expect libgnutls28-dev \
+    libident-dev libpam-dev pkg-config libwrap0-dev libz-dev telnet
+```
+
+#### ArchLinux based distributions
+
+``` shell
+  pacman -S --needed \
+    autoconf automake expect gcc gnutls inetutils libident libwrap \
+    make pam pkg-config zlib
+```
+
+### `./autogen.sh`
+
+The first step, to run `./autogen.sh`, is *only* necessary if the `configure`
+script itself isn't already generated and available. This never happens in
+official ("stable") releases in "tar.gz" archives, but when cloning the source
+code repository using Git.
+
+**This step is therefore only interesting for developers!**
+
+The `autogen.sh` script produces the `Makefile.in`'s, which are necessary for
+the configure script itself, and some more files for `make(1)`.
+
+To run `autogen.sh` you'll need GNU autoconf, GNU automake and pkg-config: at
+least autoconf 2.61 and automake 1.10 are required, newer is better. But don't
+use automake 1.12 or newer for creating distribution archives: it will work
+but lack "de-ANSI-fication" support in the generated Makefile's! Stick with
+automake 1.11.x for this purpose ...
+
+So *automake 1.11.x* and *autoconf 2.67+* is recommended.
+
+Again: "end users" do not need this step and neither need GNU autoconf nor GNU
+automake at all!
+
+### `./configure`
+
+The `configure` script is used to detect local system dependencies.
+
+In the perfect case, `configure` should recognize all needed libraries, header
+files and so on. If this shouldn't work, `./configure --help` shows all
+possible options.
+
+In addition, you can pass some command line options to `configure` to enable
+and/or disable some features of ngIRCd. All these options are shown using
+`./configure --help`, too.
+
+Compiling a static binary will avoid you the hassle of feeding a chroot dir
+(if you want use the chroot feature). Just do something like:
+
+``` shell
+  CFLAGS=-static ./configure [--your-options ...]
+```
+
+Then you can use a void directory as ChrootDir (like OpenSSH's `/var/empty`).
+
+### `make`
+
+The `make(1)` command uses the `Makefile`'s produced by `configure` and
+compiles the ngIRCd daemon.
+
+### `make install`
+
+Use `make install` to install the server and a sample configuration file on
+the local system. Normally, root privileges are necessary to complete this
+step. If there is already an older configuration file present, it won't be
+overwritten.
+
+These files and folders will be installed by default:
+
+- `/usr/local/sbin/ngircd`: executable server
+- `/usr/local/etc/ngircd.conf`: sample configuration (if not already present)
+- `/usr/local/share/doc/ngircd/`: documentation
+- `/usr/local/share/man/`: manual pages
+
+### Additional features
+
+The following optional features can be compiled into the daemon by passing
+options to the `configure` script. Most options can handle a `<path>` argument
+which will be used to search for the required libraries and header files in
+the given paths (`<path>/lib/...`, `<path>/include/...`) in addition to the
+standard locations.
+
+- Syslog Logging (autodetected by default):
+
+  `--with-syslog[=<path>]` / `--without-syslog`
+
+  Enable (disable) support for logging to "syslog", which should be
+  available on most modern UNIX-like operating systems by default.
+
+- ZLib Compression (autodetected by default):
+
+  `--with-zlib[=<path>]` / `--without-zlib`
+
+  Enable (disable) support for compressed server-server links.
+  The Z compression library ("libz") is required for this option.
+
+- IO Backend (autodetected by default):
+
+  - `--with-select[=<path>]` / `--without-select`
+  - `--with-poll[=<path>]` / `--without-poll`
+  - `--with-devpoll[=<path>]` / `--without-devpoll`
+  - `--with-epoll[=<path>]` / `--without-epoll`
+  - `--with-kqueue[=<path>]` / `--without-kqueue`
+
+  ngIRCd can use different IO "backends": the "old school" `select(2)` and
+  `poll(2)` API which should be supported by most UNIX-like operating systems,
+  or the more efficient and flexible `epoll(7)` (Linux >=2.6), `kqueue(2)`
+  (BSD) and `/dev/poll` APIs.
+
+  By default the IO backend is autodetected, but you can use `--without-xxx`
+  to disable a more enhanced API.
+
+  When using the `epoll(7)` API, support for `select(2)` is compiled in as
+  well by default, to enable the binary to run on older Linux kernels (<2.6),
+  too.
+
+- IDENT-Support:
+
+  `--with-ident[=<path>]`
+
+  Include support for IDENT ("AUTH") lookups. The "ident" library is
+  required for this option.
+
+- TCP-Wrappers:
+
+  `--with-tcp-wrappers[=<path>]`
+
+  Include support for Wietse Venemas "TCP Wrappers" to limit client access
+  to the daemon, for example by using `/etc/hosts.{allow|deny}`.
+  The "libwrap" is required for this option.
+
+- PAM:
+
+  `--with-pam[=<path>]`
+
+  Enable support for PAM, the Pluggable Authentication Modules library.
+  See `doc/PAM.txt` for details.
+
+- SSL:
+
+  - `--with-openssl[=<path>]`
+  - `--with-gnutls[=<path>]`
+
+  Enable support for SSL/TLS using OpenSSL or GnuTLS libraries.
+  See `doc/SSL.txt` for details.
+
+- IPv6:
+
+  `--enable-ipv6`
+
+  Adds support for version 6 of the Internet Protocol.
+
+## Configuration
+
+Please have a look at the `ngircd(8)` and `ngircd.conf(5)` manual pages for
+details and all possible command line and configuration options -- **and don't
+forget to run `ngircd --configtest` to validate your configuration file!**
+
+After installing ngIRCd, a sample configuration file will be set up (if it
+does not exist already). By default, when installing from sources, the file is
+named `/usr/local/etc/ngircd.conf` (other common names, especially for
+distribution packages, are `/etc/ngircd.conf` or `/etc/ngircd/ngircd.conf`).
+
+You can find the template of the sample configuration file in the `doc/`
+directory as `sample-ngircd.conf` and
+[online](https://ngircd.barton.de/doc/sample-ngircd.conf) on the homepage. It
+contains all available options.
+
+In the sample configuration file, there are comments beginning with `#` *or*
+`;` -- this is only for the better understanding of the file, both comment
+styles are equal.
+
+The file is separated in five blocks: *[Global]*, *[Features]*, *[Operator]*,
+*[Server]*, and *[Channel]*.
+
+In the *[Global]* section, there is the main configuration like the server
+name and the ports, on which the server should be listening. Options in
+the *[Features]* section enable or disable functionality in the daemon.
+IRC operators of this server are defined in *[Operator]* blocks, remote
+servers are configured in *[Server]* sections, and *[Channel]* blocks are
+used to configure pre-defined ("persistent") IRC channels.
+
+### Manual Pages Online
+
+- Daemon: [ngircd.8](https://manpages.debian.org/ngircd.8)
+- Configutation file: [ngircd.conf.5](https://manpages.debian.org/ngircd.conf.5)
+
+## Command line options
+
+ngIRCd supports the following command line options:
+
+- `-f`, `--config <file>`
+
+  The daemon uses the file `<file>` as configuration file rather than
+  the standard configuration `/usr/local/etc/ngircd.conf`.
+
+- `-n`, `--nodaemon`
+
+  ngIRCd should be running as a foreground process.
+
+- `-p`, `--passive`
+
+  Server-links won't be automatically established.
+
+- `-t`, `--configtest`
+
+  Reads, validates and dumps the configuration file as interpreted
+  by the server. Then exits.
+
+Use `--help` to see a short help text describing all available parameters
+the server understands, with `--version` the ngIRCd shows its version
+number. In both cases the server exits after the output.
+
+Please see the `ngircd(8)` manual page for more details!

+ 10 - 12
Makefile.am

@@ -9,11 +9,9 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 
-AUTOMAKE_OPTIONS = gnu
-
 SUBDIRS = doc src man contrib
 
-EXTRA_DIST = autogen.sh configure.ng .clang_complete .mailmap
+EXTRA_DIST = README.md INSTALL.md autogen.sh configure.ng .clang_complete .mailmap
 
 clean-local: osxpkg-clean
 	rm -f build-stamp*
@@ -25,13 +23,13 @@ maintainer-clean-local:
 	rm -f config.log debian
 
 testsuite:
-	cd src/testsuite && make check
+	cd src/testsuite && ${MAKE} check
 
 lint:
-	cd src/ngircd && make lint
+	cd src/ngircd && ${MAKE} lint
 
 srcdoc:
-	cd doc && make srcdoc
+	cd doc && ${MAKE} srcdoc
 
 have-xcodebuild:
 	@xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
@@ -66,7 +64,7 @@ osxpkg: have-packagemaker osxpkg-dest
 	 --out ../../$(distdir).mpkg
 	rm -f $(distdir).mpkg.zip
 	zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
-	make osxpkg-clean
+	${MAKE} osxpkg-clean
 
 osxpkg-clean:
 	[ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest
@@ -74,12 +72,12 @@ osxpkg-clean:
 
 osxpkg-dest: have-xcodebuild osxpkg-clean clean
 	./configure --prefix=/opt/ngircd
-	make xcode
-	make -C contrib/MacOSX de.barton.ngircd.plist
+	${MAKE} xcode
+	${MAKE} -C contrib/MacOSX de.barton.ngircd.plist
 	mkdir -p ngircd.dest/opt/ngircd/sbin
-	DESTDIR="$$PWD/ngircd.dest" make -C doc install
-	DESTDIR="$$PWD/ngircd.dest" make -C contrib install
-	DESTDIR="$$PWD/ngircd.dest" make -C man install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C doc install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C contrib install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C man install
 	cp contrib/MacOSX/build/Default/ngIRCd \
 	 ngircd.dest/opt/ngircd/sbin/ngircd
 	rm ngircd.dest/opt/ngircd/etc/ngircd.conf

+ 211 - 166
Makefile.in

@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -26,23 +25,61 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -62,35 +99,40 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
-	ChangeLog INSTALL NEWS ar-lib config.guess config.sub depcomp \
-	install-sh missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
 AM_V_GEN = $(am__v_GEN_@AM_V@)
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN   " $@;
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
 AM_V_at = $(am__v_at_@AM_V@)
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -98,12 +140,35 @@ am__can_run_installinfo = \
   esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog NEWS \
+	ar-lib compile config.guess config.sub install-sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -113,6 +178,7 @@ am__remove_distdir = \
       && rm -rf "$(distdir)" \
       || { sleep 5 && rm -rf "$(distdir)"; }; \
   else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -140,6 +206,7 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -179,6 +246,8 @@ LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -187,11 +256,13 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 RANLIB = @RANLIB@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-U = @U@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -245,9 +316,8 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = gnu
 SUBDIRS = doc src man contrib
-EXTRA_DIST = autogen.sh configure.ng .clang_complete .mailmap
+EXTRA_DIST = README.md INSTALL.md autogen.sh configure.ng .clang_complete .mailmap
 all: all-recursive
 
 .SUFFIXES:
@@ -257,24 +327,23 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
-	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
+	  $(AUTOMAKE) --foreign Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
 	    echo ' $(SHELL) ./config.status'; \
 	    $(SHELL) ./config.status;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -287,22 +356,25 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -317,57 +389,12 @@ $(RECURSIVE_TARGETS):
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -383,12 +410,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -400,15 +422,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -417,11 +435,36 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	$(am__remove_distdir)
 	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -486,41 +529,43 @@ distdir: $(DISTFILES)
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-lzip: distdir
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
-	$(am__remove_distdir)
-
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-xz: distdir
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -528,11 +573,9 @@ dist dist-all: distdir
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
 	*.tar.lz*) \
 	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
@@ -540,22 +583,23 @@ distcheck: dist
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod u+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -578,7 +622,7 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
@@ -713,13 +757,12 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-local ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-cscope clean-generic \
+	clean-local cscope cscopelist-am ctags ctags-am dist dist-all \
+	dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
 	dist-zip distcheck distclean distclean-generic distclean-tags \
 	distcleancheck distdir distuninstallcheck dvi dvi-am html \
 	html-am info info-am install install-am install-data \
@@ -729,8 +772,10 @@ uninstall-am:
 	install-ps install-ps-am install-strip installcheck \
 	installcheck-am installdirs installdirs-am maintainer-clean \
 	maintainer-clean-generic maintainer-clean-local mostlyclean \
-	mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am
+
+.PRECIOUS: Makefile
 
 
 clean-local: osxpkg-clean
@@ -743,13 +788,13 @@ maintainer-clean-local:
 	rm -f config.log debian
 
 testsuite:
-	cd src/testsuite && make check
+	cd src/testsuite && ${MAKE} check
 
 lint:
-	cd src/ngircd && make lint
+	cd src/ngircd && ${MAKE} lint
 
 srcdoc:
-	cd doc && make srcdoc
+	cd doc && ${MAKE} srcdoc
 
 have-xcodebuild:
 	@xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
@@ -784,7 +829,7 @@ osxpkg: have-packagemaker osxpkg-dest
 	 --out ../../$(distdir).mpkg
 	rm -f $(distdir).mpkg.zip
 	zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
-	make osxpkg-clean
+	${MAKE} osxpkg-clean
 
 osxpkg-clean:
 	[ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest
@@ -792,12 +837,12 @@ osxpkg-clean:
 
 osxpkg-dest: have-xcodebuild osxpkg-clean clean
 	./configure --prefix=/opt/ngircd
-	make xcode
-	make -C contrib/MacOSX de.barton.ngircd.plist
+	${MAKE} xcode
+	${MAKE} -C contrib/MacOSX de.barton.ngircd.plist
 	mkdir -p ngircd.dest/opt/ngircd/sbin
-	DESTDIR="$$PWD/ngircd.dest" make -C doc install
-	DESTDIR="$$PWD/ngircd.dest" make -C contrib install
-	DESTDIR="$$PWD/ngircd.dest" make -C man install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C doc install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C contrib install
+	DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C man install
 	cp contrib/MacOSX/build/Default/ngIRCd \
 	 ngircd.dest/opt/ngircd/sbin/ngircd
 	rm ngircd.dest/opt/ngircd/etc/ngircd.conf

+ 68 - 3
NEWS

@@ -2,12 +2,77 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2019 Alexander Barton and Contributors.
+               (c)2001-2020 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
                                   -- NEWS --
 
+ngIRCd 26 (2020-06-20)
+
+  ngIRCd 26~rc2 (2020-06-11)
+  - Add AppStream metadata file (contrib/de.barton.ngircd.metainfo.xml).
+  - Various bug fixes, see the ChangeLog. No new or changed functionality.
+
+  ngIRCd 26~rc1 (2020-05-10)
+  - Allow up to 512 characters per line in MOTD and help text files (but keep
+    in mind that lines can't get that long, because they have to be prefixed
+    before being sent to the client). But this allows for more fancy MOTDs :-)
+    Closes #271.
+  - Show the actually allowed channel types in the ISUPPORT(005) numeric which
+    are configured by the "AllowedChannelTypes" configuration variable.
+    Closes #273.
+  - Handle commands in the read buffer before reading more data and don't wait
+    for the network in this case: If there are more bytes in the read buffer
+    already than a single valid IRC command can get long (513 bytes), wait for
+    this/those command(s) to be handled first and don't try to read even more
+    data from the network (which most probably would overflow the read buffer
+    of this connection soon).
+  - Log G-/K-Line changes only when not initiated by a server: this prevents
+    the log from becoming spammed during "net bursts".
+  - Update test suite to include SSL tests, including checking for reloading
+    certificates during runtime.
+  - Add support for GnuTLS certificate reload, which is quite handy when using
+    Let's Encrypt, for example. Until now this was only supported when linked
+    with OpenSSL. Thanks a lot, Hilko Bengen <bengen@hilluzination.de>!
+  - Allow setting arbitrary channel modes in the configuration file by handling
+    them like in MODE commands, and allow multiple "Modes =" lines per [Channel]
+    section. Thanks to Michi <michi+ngircd@dataswamp.org>!
+    Closes #55.
+  - Add "FNC" (forced nick changes) to ISUPPORT(005) numeric. Most probably
+    this doesn't make any difference to any client, but it seems correct.
+    See <http://www.irc.org/tech_docs/005.html> for details.
+  - Enhance handling of command line errors, and return with exit code 0 ("no
+    error") when "--help" or "--version" is used (which resulted in exit code 1,
+    "error" before). Exit with code 2 ("command line error") for all other
+    invalid command line options, and show the error message itself on stderr
+    (instead of stdout and exit code 1, "generic error", as before).
+    This new behaviour is more in line with the GNU "coding standards",
+    see <https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html>.
+  - Add ./contrib/nglog.sh: This script parses the log output of ngircd(8),
+    and colorizes the messages according to their log level. Example usage:
+    ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
+  - Enlarge buffers of info texts to 128 bytes. This includes:
+    - "Real name" of a client (4th filed of the USER command).
+    - Server info text ("Info" configuration option).
+    - Admin info texts and email address ("AdminInfo1", "AdminInfo2" and
+      "AdminEmail" configuration options).
+    - Network name ("Network" configuration option).
+    The limit was 64 bytes before ...
+    Closes #258.
+  - Streamline handling of invalid and unset server name: Don't exit during
+    runtime (REHASH command, HUP signal), because the server name can't be
+    changed in this case anyway and the new invalid name will be ignored.
+  - Slightly reorder startup steps, and enhance logging:
+    - Show name of configuration file at the beginning of start up.
+    - Add a message when ngIRCd is ready, including its host name.
+    - Show name of configuration file on REHASH (SIGHUP), too.
+    - Change level of "done message" to NOTICE, like "starting" & "ready".
+    - Initialize IO functions before channels, connections, clients, ...
+  - configure.ng: OpenSSL can depends on lz or latomic so use pkg-config to
+    find those dependencies and fallback to existing mechanism.
+    Closes #256.
+
 ngIRCd 25 (2019-01-23)
 
   - Implement new configuration option "MaxPenaltyTime", which configures the
@@ -29,7 +94,7 @@ ngIRCd 25 (2019-01-23)
 
   ngIRCd 25~rc1 (2018-08-11)
   - Only send TOPIC updates to a channel when the topic actually changed:
-    This prevents the channel from becoming flooded by unecessary TOPIC update
+    This prevents the channel from becoming flooded by unnecessary TOPIC update
     messages, that can happen when IRC services try to enforce a certain topic
     but which is already set (at least on the local server), for example.
     Therefore still forward it to all servers, but don't inform local clients
@@ -297,7 +362,7 @@ ngIRCd 20.2 (2013-02-15)
 
   - This release is a bugfix release only, without new features.
   - Security: Fix a denial of service bug in the function handling KICK
-    commands that could be used by arbitrary users to to crash the daemon
+    commands that could be used by arbitrary users to crash the daemon
     (CVE-2013-1747).
 
 ngIRCd 20.1 (2013-01-02)

+ 0 - 89
README

@@ -1,89 +0,0 @@
-
-                     ngIRCd - Next Generation IRC Server
-                           http://ngircd.barton.de/
-
-               (c)2001-2019 Alexander Barton and Contributors.
-               ngIRCd is free software and published under the
-                   terms of the GNU General Public License.
-
-                                -- README --
-
-
-I. Introduction
-~~~~~~~~~~~~~~~
-
-ngIRCd is a free, portable and lightweight Internet Relay Chat server for
-small or private networks, developed under the GNU General Public License
-(GPL; please see the file COPYING for details). It is simple to configure,
-can cope with dynamic IP addresses, and supports IPv6 as well as SSL. It is
-written from scratch and not based on the original IRCd.
-
-The name ngIRCd means next generation IRC daemon, which is a little bit
-exaggerated: lightweight Internet Relay Chat server most probably would be a
-better name :-)
-
-Please see the INSTALL document for installation and upgrade information!
-
-
-II. Status
-~~~~~~~~~~~
-
-ngIRCd should be quite feature complete and stable to be used as daemon in
-real world IRC networks.
-
-It is not the goal of ngIRCd to implement all the nasty behaviors of the
-original ircd, but to implement most of the useful commands and semantics
-specified by the RFCs that are used by existing clients.
-
-
-III. Features (or: why use ngIRCd?)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-- Well arranged (lean) configuration file.
-- Simple to build, install, configure, and maintain.
-- Supports IPv6 and SSL.
-- Can use PAM for user authentication.
-- Lots of popular user and channel modes are implemented.
-- Supports "cloaking" of users.
-- No problems with servers that have dynamic IP addresses.
-- Freely available, modern, portable and tidy C source.
-- Wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX,
-  IRIX, Linux, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin.
-- ngIRCd is being actively developed since 2001.
-
-
-IV. Documentation
-~~~~~~~~~~~~~~~~~
-
-More documentation can be found in the "doc/" directory and the homepage of
-ngIRCd: <http://ngircd.barton.de/>.
-
-
-V. Download
-~~~~~~~~~~~
-
-The homepage of the ngIRCd is <http://ngircd.barton.de/>; you will find
-the newest information about the ngIRCd and the most recent ("stable")
-releases there.
-
-Visit our source code repository at GitHub if you are interested in the
-latest development version: <https://github.com/ngircd/ngircd>.
-
-
-VI. Problems, Bugs, Patches
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Please don't hesitate to contact us if you encounter problems:
-
-- On IRC: <irc://irc.barton.de/ngircd>
-- Via the mailing list: <ngircd-ml@ngircd.barton.de>
-
-See <http://ngircd.barton.de/support.php> for details.
-
-If you find bugs in ngIRCd (which will be there most probably ...), please
-report them to our issue tracker at GitHub:
-
-- Bug tracker: <https://github.com/ngircd/ngircd/issues>
-- Patches, "pull requests": <https://github.com/ngircd/ngircd/pulls>
-
-There you can read about known bugs and limitations, too.

+ 78 - 0
README.md

@@ -0,0 +1,78 @@
+# [ngIRCd](https://ngircd.barton.de) - Internet Relay Chat Server
+
+## Introduction
+
+*ngIRCd* is a free, portable and lightweight *Internet Relay Chat* ([IRC])
+server for small or private networks, developed under the terms of the GNU
+General Public License ([GPL]); please see the file `COPYING` for licensing
+information.
+
+The server is quite easy to configure, can handle dynamic IP addresses, and
+optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+user authentication as well as character set conversion for legacy clients. The
+server has been written from scratch and is not based on the "forefather", the
+daemon of the IRCNet.
+
+The name ngIRCd means *next-generation IRC daemon*, which is a little bit
+exaggerated: *lightweight Internet Relay Chat server* most probably would have
+been a better name :-)
+
+Please see the `INSTALL.md` document for installation and upgrade information,
+online available here: <https://ngircd.barton.de/doc/INSTALL.md>!
+
+## Status
+
+ngIRCd should be quite feature-complete and stable to be used as a daemon in
+real-world IRC networks.
+
+It is not the goal of ngIRCd to implement all the nasty behaviors of the
+original ircd, but to implement most of the useful commands and semantics
+specified by the RFCs that are used by existing clients.
+
+## Features (or: why use ngIRCd?)
+
+- Well arranged (lean) configuration file.
+- Simple to build, install, configure, and maintain.
+- Supports IPv6 and SSL.
+- Can use PAM for user authentication.
+- Lots of popular user and channel modes are implemented.
+- Supports "cloaking" of users.
+- No problems with servers that have dynamic IP addresses.
+- Freely available, modern, portable and tidy C source.
+- Wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX,
+  IRIX, Linux, macOS, NetBSD, OpenBSD, Solaris, and Windows with Cygwin.
+- ngIRCd is being actively developed since 2001.
+
+## Documentation
+
+The **homepage** of the ngIRCd project is <https://ngircd.barton.de>.
+
+More documentation can be found in the `doc/` directory and
+[online](https://ngircd.barton.de/documentation).
+
+## Downloads & Source Code
+
+You can find the latest information about the ngIRCd and the most recent
+stable release on the [news](https://ngircd.barton.de/news) and
+[downloads](https://ngircd.barton.de/download) pages of the homepage.
+
+Visit our source code repository at [GitHub](https://github.com) if you are
+interested in the latest development code: <https://github.com/ngircd/ngircd>.
+
+## Problems, Bugs, Patches
+
+Please don't hesitate to contact us if you encounter problems:
+
+- On IRC: <irc://irc.barton.de/ngircd>
+- Via the mailing list: <ngircd-ml@ngircd.barton.de>
+
+See <http://ngircd.barton.de/support> for details.
+
+If you find any bugs in ngIRCd (which most probably will be there ...), please
+report them to our issue tracker at GitHub:
+
+- Bug tracker: <https://github.com/ngircd/ngircd/issues>
+- Patches, "pull requests": <https://github.com/ngircd/ngircd/pulls>
+
+[IRC]: https://wikipedia.org/wiki/Internet_Relay_Chat
+[GPL]: https://wikipedia.org/wiki/GNU_General_Public_License

File diff suppressed because it is too large
+ 722 - 368
aclocal.m4


+ 2 - 2
ar-lib

@@ -4,7 +4,7 @@
 me=ar-lib
 scriptversion=2012-03-01.08; # UTC
 
-# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
 # Written by Peter Rosin <peda@lysator.liu.se>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a

+ 3 - 1
autogen.sh

@@ -103,7 +103,8 @@ Search()
 Notfound()
 {
 	echo "Error: $* not found!"
-	echo "Please install recent versions of GNU autoconf and GNU automake."
+	echo 'Please install supported versions of GNU autoconf, GNU automake'
+	echo 'and pkg-config: see the INSTALL file for details.'
 	exit 1
 }
 
@@ -161,6 +162,7 @@ AUTOMAKE_VERSION=$(echo $AUTOMAKE | cut -d'-' -f2-)
 [ -z "$GO" ] && [ -n "$CONFIGURE_ARGS" ] && GO=1
 
 # Verify that all tools have been found
+command -v pkg-config >/dev/null || Notfound pkg-config
 [ -z "$ACLOCAL" ] && Notfound aclocal
 [ -z "$AUTOHEADER" ] && Notfound autoheader
 [ -z "$AUTOMAKE" ] && Notfound automake

+ 348 - 0
compile

@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:

+ 282 - 84
config.guess

@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2018 Free Software Foundation, Inc.
+#   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2018-03-08'
+timestamp='2020-04-26'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2018 Free Software Foundation, Inc.
+Copyright 1992-2020 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > "$dummy.c" ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    # prevent multiple calls if $tmp is already set
+    test "$tmp" && return 0
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+	,,)    echo "int x;" > "$dummy.c"
+	       for driver in cc gcc c89 c99 ; do
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+		       CC_FOR_BUILD="$driver"
+		       break
+		   fi
+	       done
+	       if test x"$CC_FOR_BUILD" = x ; then
+		   CC_FOR_BUILD=no_compiler_found
+	       fi
+	       ;;
+	,,*)   CC_FOR_BUILD=$CC ;;
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -138,7 +142,7 @@ Linux|GNU|GNU/*)
 	# We could probably try harder.
 	LIBC=gnu
 
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	cat <<-EOF > "$dummy.c"
 	#include <features.h>
 	#if defined(__UCLIBC__)
@@ -199,7 +203,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
 		os=netbsdelf
 		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval "$set_cc_for_build"
+		set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
 		then
@@ -237,7 +241,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "$machine-${os}${release}${abi}"
+	echo "$machine-${os}${release}${abi-}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -260,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:SolidBSD:*:*)
 	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
 	exit ;;
+    *:OS108:*:*)
+	echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
+	exit ;;
     macppc:MirBSD:*:*)
 	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
@@ -269,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:Sortix:*:*)
 	echo "$UNAME_MACHINE"-unknown-sortix
 	exit ;;
+    *:Twizzler:*:*)
+	echo "$UNAME_MACHINE"-unknown-twizzler
+	exit ;;
     *:Redox:*:*)
 	echo "$UNAME_MACHINE"-unknown-redox
 	exit ;;
     mips:OSF1:*.*)
-        echo mips-dec-osf1
-        exit ;;
+	echo mips-dec-osf1
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -389,7 +399,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
 	echo i386-pc-auroraux"$UNAME_RELEASE"
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	SUN_ARCH=i386
 	# If there is a compiler, see if it is configured for 64-bit objects.
 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -482,7 +492,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
 	echo clipper-intergraph-clix"$UNAME_RELEASE"
 	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
@@ -579,7 +589,7 @@ EOF
 	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval "$set_cc_for_build"
+		set_cc_for_build
 		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
 
@@ -660,7 +670,7 @@ EOF
 		    esac
 		fi
 		if [ "$HP_ARCH" = "" ]; then
-		    eval "$set_cc_for_build"
+		    set_cc_for_build
 		    sed 's/^		//' << EOF > "$dummy.c"
 
 		#define _HPUX_SOURCE
@@ -700,7 +710,7 @@ EOF
 	esac
 	if [ "$HP_ARCH" = hppa2.0w ]
 	then
-	    eval "$set_cc_for_build"
+	    set_cc_for_build
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -726,7 +736,7 @@ EOF
 	echo ia64-hp-hpux"$HPUX_REV"
 	exit ;;
     3050*:HI-UX:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
 	int
@@ -840,6 +850,17 @@ EOF
     *:BSD/OS:*:*)
 	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
+    arm:FreeBSD:*:*)
+	UNAME_PROCESSOR=`uname -p`
+	set_cc_for_build
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_PCS_VFP
+	then
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+	else
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+	fi
+	exit ;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	case "$UNAME_PROCESSOR" in
@@ -881,7 +902,7 @@ EOF
 	echo "$UNAME_MACHINE"-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
+	echo x86_64-pc-cygwin
 	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
@@ -894,8 +915,8 @@ EOF
 	# other systems with GNU libc and userland
 	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
-    i*86:Minix:*:*)
-	echo "$UNAME_MACHINE"-pc-minix
+    *:Minix:*:*)
+	echo "$UNAME_MACHINE"-unknown-minix
 	exit ;;
     aarch64:Linux:*:*)
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -905,7 +926,7 @@ EOF
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
 	  EV56)  UNAME_MACHINE=alphaev56 ;;
 	  PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -922,7 +943,7 @@ EOF
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arm*:Linux:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
@@ -971,23 +992,51 @@ EOF
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
+	IS_GLIBC=0
+	test x"${LIBC}" = xgnu && IS_GLIBC=1
 	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
+	#undef mips
+	#undef mipsel
+	#undef mips64
+	#undef mips64el
+	#if ${IS_GLIBC} && defined(_ABI64)
+	LIBCABI=gnuabi64
+	#else
+	#if ${IS_GLIBC} && defined(_ABIN32)
+	LIBCABI=gnuabin32
+	#else
+	LIBCABI=${LIBC}
+	#endif
+	#endif
+
+	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa64r6
+	#else
+	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa32r6
+	#else
+	#if defined(__mips64)
+	CPU=mips64
+	#else
+	CPU=mips
+	#endif
+	#endif
+	#endif
+
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
+	MIPS_ENDIAN=el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
+	MIPS_ENDIAN=
 	#else
-	CPU=
+	MIPS_ENDIAN=
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
-	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
 	;;
     mips64el:Linux:*:*)
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -1100,7 +1149,7 @@ EOF
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
@@ -1284,38 +1333,39 @@ EOF
 	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval "$set_cc_for_build"
-	if test "$UNAME_PROCESSOR" = unknown ; then
-	    UNAME_PROCESSOR=powerpc
+	UNAME_PROCESSOR=`uname -p`
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	if command -v xcode-select > /dev/null 2> /dev/null && \
+		! xcode-select --print-path > /dev/null 2> /dev/null ; then
+	    # Avoid executing cc if there is no toolchain installed as
+	    # cc will be a stub that puts up a graphical alert
+	    # prompting the user to install developer tools.
+	    CC_FOR_BUILD=no_compiler_found
+	else
+	    set_cc_for_build
 	fi
-	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
-	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		       grep IS_64BIT_ARCH >/dev/null
-		then
-		    case $UNAME_PROCESSOR in
-			i386) UNAME_PROCESSOR=x86_64 ;;
-			powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		    esac
-		fi
-		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
-		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
-		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		       grep IS_PPC >/dev/null
-		then
-		    UNAME_PROCESSOR=powerpc
-		fi
+	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_PPC >/dev/null
+	    then
+		UNAME_PROCESSOR=powerpc
 	    fi
 	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # Avoid executing cc on OS X 10.9, as it ships with a stub
-	    # that puts up a graphical alert prompting to install
-	    # developer tools.  Any system running Mac OS X 10.7 or
-	    # later (Darwin 11 and later) is required to have a 64-bit
-	    # processor. This is not true of the ARM version of Darwin
-	    # that Apple uses in portable devices.
-	    UNAME_PROCESSOR=x86_64
+	    # uname -m returns i386 or x86_64