From 25c216cbdf0a5db739bdf0551db16a510e8ac4a1 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:13:17 +0200 Subject: [PATCH 01/18] configure.in: sort some lists (templates, output, ...) --- configure.in | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index 52435fd4..7a15b2ba 100644 --- a/configure.in +++ b/configure.in @@ -25,17 +25,17 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # -- Templates for config.h -- AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled]) +AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists]) AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists]) +AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests]) +AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used]) +AH_TEMPLATE([PAM], [Define if PAM should be used]) AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled]) AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant]) AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging]) -AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled]) AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used]) -AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used]) AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled]) -AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests]) -AH_TEMPLATE([PAM], [Define if PAM should be used]) -AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists]) +AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled]) AH_TEMPLATE([TARGET_OS], [Target operating system name]) AH_TEMPLATE([TARGET_VENDOR], [Target system vendor]) @@ -57,9 +57,9 @@ AC_PROG_RANLIB # -- Compiler Features -- -AM_C_PROTOTYPES AC_C_CONST AC_C_INLINE +AM_C_PROTOTYPES # -- Hard coded system and compiler dependencies/features/options ... -- @@ -101,8 +101,8 @@ CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'" # -- Headers -- AC_HEADER_STDC -AC_HEADER_TIME AC_HEADER_SYS_WAIT +AC_HEADER_TIME AC_CHECK_HEADERS([ \ ctype.h errno.h fcntl.h netdb.h netinet/in.h netinet/in_systm.h \ @@ -544,21 +544,21 @@ test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END" AC_OUTPUT([ \ Makefile \ - doc/Makefile \ - doc/src/Makefile \ - src/Makefile \ - src/portab/Makefile \ - src/ipaddr/Makefile \ - src/tool/Makefile \ - src/ngircd/Makefile \ - src/testsuite/Makefile \ - man/Makefile \ - contrib/Makefile \ contrib/Anope/Makefile \ contrib/Debian/Makefile \ contrib/MacOSX/Makefile \ - contrib/MacOSX/ngIRCd.xcodeproj/Makefile \ contrib/MacOSX/ngIRCd.pmdoc/Makefile \ + contrib/MacOSX/ngIRCd.xcodeproj/Makefile \ + contrib/Makefile \ + doc/Makefile \ + doc/src/Makefile \ + man/Makefile \ + src/ipaddr/Makefile \ + src/Makefile \ + src/ngircd/Makefile \ + src/portab/Makefile \ + src/testsuite/Makefile \ + src/tool/Makefile \ ]) type dpkg >/dev/null 2>&1 From 67e882d4bbda97fb65ed4d58ae44e6c79d4cb708 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:30:49 +0200 Subject: [PATCH 02/18] configure.in: require autoconf 2.67 and automake 1.11 And use newer features such as bug reporting address and project URL. --- configure.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 7a15b2ba..0f0cac02 100644 --- a/configure.in +++ b/configure.in @@ -13,12 +13,15 @@ define(VERSION_ID,esyscmd(git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'|tr -d # -- Initialisation -- -AC_PREREQ(2.50) -AC_INIT(ngircd, VERSION_ID) -AC_CONFIG_SRCDIR(src/ngircd/ngircd.c) +AC_PREREQ([2.67]) +AC_INIT([ngIRCd], VERSION_ID, + [ngircd-ml@ngircd.barton.de], [ngircd], [http://ngircd.barton.de/]) + +AC_CONFIG_SRCDIR([src/ngircd/ngircd.c]) +AC_CONFIG_HEADER([src/config.h]) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE(1.6) -AC_CONFIG_HEADER(src/config.h) + +AM_INIT_AUTOMAKE([1.11]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) From 47ad9afcf38d91059dd23dc2e6f6c2d9d4c3ad80 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:32:17 +0200 Subject: [PATCH 03/18] configure.in: Update checks for required and optional features Update checks for required and optional header files, data types, and functions. --- configure.in | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/configure.in b/configure.in index 0f0cac02..c7265964 100644 --- a/configure.in +++ b/configure.in @@ -107,25 +107,17 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME +# Required header files AC_CHECK_HEADERS([ \ - ctype.h errno.h fcntl.h netdb.h netinet/in.h netinet/in_systm.h \ - stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h \ + fcntl.h inttypes.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h \ + string.h strings.h sys/socket.h sys/time.h unistd.h \ ],,AC_MSG_ERROR([required C header missing!])) +# Optional header files AC_CHECK_HEADERS([ \ - arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \ - ],[],[],[[ - #ifdef HAVE_SYS_TYPES_H - #include - #endif - #ifdef HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_NETINET_IN_H - #include - #endif - ]] -) + arpa/inet.h malloc.h netinet/ip.h stdbool.h stddef.h stdint.h \ + varargs.h \ + ]) # -- Datatypes -- @@ -142,8 +134,14 @@ AC_TRY_COMPILE([ AC_MSG_RESULT(no) ]) +AC_TYPE_PID_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT8_T AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),, [#include ]) @@ -159,16 +157,22 @@ AC_CHECK_LIB(socket,bind) # -- Functions -- AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_REALLOC AC_FUNC_STRFTIME +# Required functions AC_CHECK_FUNCS([ \ - bind gethostbyaddr gethostbyname gethostname inet_ntoa \ - setsid setsockopt socket strcasecmp waitpid],, + alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \ + gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \ + strchr strcspn strerror strncasecmp strrchr strspn strstr \ + ],, AC_MSG_ERROR([required function missing!])) +# Optional functions AC_CHECK_FUNCS([ \ - gai_strerror getaddrinfo getnameinfo inet_aton sigaction \ - sigprocmask snprintf vsnprintf strdup strlcpy strlcat strtok_r]) + gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \ + snprintf vsnprintf strdup strlcpy strlcat strtok_r waitpid]) # -- Configuration options -- From 2478c5816bca01c73b7c832945ddbeb815922ce0 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:34:30 +0200 Subject: [PATCH 04/18] configure.in: Don't use AC_C_PROTOTYPES Don't use AC_C_PROTOTYPES, AM_C_PROTOTYPES is already used. --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index c7265964..d3cc86b6 100644 --- a/configure.in +++ b/configure.in @@ -48,7 +48,6 @@ AH_TEMPLATE([TARGET_CPU], [Target CPU name]) AC_PROG_CC AC_PROG_CC_STDC -AC_C_PROTOTYPES # -- Helper programs -- From 2e13e821f89d38ebb3b6b90d44f1a40f9c61fb31 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:36:02 +0200 Subject: [PATCH 05/18] configure.in: Use AC_CONFIG_FILES macro --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d3cc86b6..20102d4e 100644 --- a/configure.in +++ b/configure.in @@ -548,7 +548,7 @@ test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END" # -- Generate files -- -AC_OUTPUT([ \ +AC_CONFIG_FILES([ \ Makefile \ contrib/Anope/Makefile \ contrib/Debian/Makefile \ @@ -567,6 +567,8 @@ AC_OUTPUT([ \ src/tool/Makefile \ ]) +AC_OUTPUT + type dpkg >/dev/null 2>&1 if test $? -eq 0; then # Generate debian/ link if the dpkg command exists From 4dd1c31dc70e97015f6bff4344de30742db073e8 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:36:34 +0200 Subject: [PATCH 06/18] Don't check type.h availability, it is required --- src/ngircd/conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 627e6d3f..5853926e 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -18,6 +18,7 @@ #include "imp.h" #include +#include #include #ifdef PROTOTYPES # include @@ -34,9 +35,6 @@ #include #include -#ifdef HAVE_CTYPE_H -# include -#endif #include "array.h" #include "ngircd.h" From 74c7d7131f6754e1afa9b1ec7b95e95824475c97 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:37:31 +0200 Subject: [PATCH 07/18] Don't include , it is included by "portab.h" --- src/ngircd/conn.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 6091ebe2..f4511642 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -47,10 +47,6 @@ # include #endif -#ifdef HAVE_STDINT_H -# include /* e.g. for Mac OS X */ -#endif - #ifdef TCPWRAP # include /* for TCP Wrappers */ #endif From b2482b39e40bd5355cb6ea935d7dc1f1bd18f7ab Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 11 Sep 2012 14:38:19 +0200 Subject: [PATCH 08/18] Use HAVE_SETSID #define when testing for setsid() --- src/ngircd/ngircd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index 8a93bcb0..67bc4df4 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -715,7 +715,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon) } /* New child process */ -#ifndef NeXT +#ifdef HAVE_SETSID (void)setsid(); #else setpgrp(0, getpid()); From d53d58fff21a306ac0de20153a215121547bcd84 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 12 Sep 2012 16:01:11 +0200 Subject: [PATCH 09/18] configure.in: inttypes.h is an optional header file --- configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 20102d4e..b65d1558 100644 --- a/configure.in +++ b/configure.in @@ -108,14 +108,14 @@ AC_HEADER_TIME # Required header files AC_CHECK_HEADERS([ \ - fcntl.h inttypes.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h \ - string.h strings.h sys/socket.h sys/time.h unistd.h \ + fcntl.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h \ + strings.h sys/socket.h sys/time.h unistd.h \ ],,AC_MSG_ERROR([required C header missing!])) # Optional header files AC_CHECK_HEADERS([ \ - arpa/inet.h malloc.h netinet/ip.h stdbool.h stddef.h stdint.h \ - varargs.h \ + arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \ + stdint.h varargs.h \ ]) # -- Datatypes -- From 82bf4eb0591631e638120e0540fbbb7ceb4e19a9 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 13 Sep 2012 00:06:08 +0200 Subject: [PATCH 10/18] configure.in: use AC_CANONICAL_HOST (not AC_CANONICAL_TARGET) See the autoconf manual for details: http://www.gnu.org/software/autoconf/manual/autoconf.html#Specifying-Target-Triplets --- configure.in | 19 +++++++++---------- src/ngircd/login.c | 4 ++-- src/ngircd/ngircd.c | 6 +++--- src/portab/portab.h | 14 +++++++------- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/configure.in b/configure.in index b65d1558..0f6af2a0 100644 --- a/configure.in +++ b/configure.in @@ -19,7 +19,7 @@ AC_INIT([ngIRCd], VERSION_ID, AC_CONFIG_SRCDIR([src/ngircd/ngircd.c]) AC_CONFIG_HEADER([src/config.h]) -AC_CANONICAL_TARGET +AC_CANONICAL_HOST AM_INIT_AUTOMAKE([1.11]) @@ -40,9 +40,9 @@ AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used]) AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled]) AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled]) -AH_TEMPLATE([TARGET_OS], [Target operating system name]) -AH_TEMPLATE([TARGET_VENDOR], [Target system vendor]) -AH_TEMPLATE([TARGET_CPU], [Target CPU name]) +AH_TEMPLATE([HOST_OS], [Target operating system name]) +AH_TEMPLATE([HOST_VENDOR], [Target system vendor]) +AH_TEMPLATE([HOST_CPU], [Target CPU name]) # -- C Compiler -- @@ -87,7 +87,7 @@ if test "$GCC" = "yes"; then GCC_STACK_PROTECT_CC fi -case "$target_os" in +case "$host_os" in hpux*) # This is HP/UX, we need to define _XOPEN_SOURCE_EXTENDED # (tested with HP/UX 11.11) @@ -538,9 +538,9 @@ AC_ARG_ENABLE(strict-rfc, # -- Definitions -- -AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" ) -AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" ) -AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" ) +AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" ) +AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" ) +AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" ) # Add additional CFLAGS, eventually specified on the command line, but after # running this configure script. Useful for "-Werror" for example. @@ -590,8 +590,7 @@ C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}` M=`eval echo ${mandir}` ; M=`eval echo ${M}` D=`eval echo ${docdir}` ; D=`eval echo ${D}` -echo " Target: ${target}" -test "$target" != "$host" && echo " Host: ${host}" +echo " Host: ${host}" echo " Compiler: ${CC}" test -n "$CFLAGS" && echo " Compiler flags: ${CFLAGS}" test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}" diff --git a/src/ngircd/login.c b/src/ngircd/login.c index 460fcd1e..d79344b5 100644 --- a/src/ngircd/login.c +++ b/src/ngircd/login.c @@ -163,8 +163,8 @@ Login_User_PostAuth(CLIENT *Client) return false; if (!IRC_WriteStrClient (Client, RPL_YOURHOST_MSG, Client_ID(Client), - Client_ID(Client_ThisServer()), PACKAGE_VERSION, TARGET_CPU, - TARGET_VENDOR, TARGET_OS)) + Client_ID(Client_ThisServer()), PACKAGE_VERSION, HOST_CPU, + HOST_VENDOR, HOST_OS)) return false; if (!IRC_WriteStrClient (Client, RPL_CREATED_MSG, Client_ID(Client), NGIRCd_StartStr)) diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index 67bc4df4..44c4ca79 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -405,11 +405,11 @@ Fill_Version( void ) if( NGIRCd_VersionAddition[0] ) strlcat( NGIRCd_VersionAddition, "-", sizeof( NGIRCd_VersionAddition )); - strlcat( NGIRCd_VersionAddition, TARGET_CPU, sizeof( NGIRCd_VersionAddition )); + strlcat( NGIRCd_VersionAddition, HOST_CPU, sizeof( NGIRCd_VersionAddition )); strlcat( NGIRCd_VersionAddition, "/", sizeof( NGIRCd_VersionAddition )); - strlcat( NGIRCd_VersionAddition, TARGET_VENDOR, sizeof( NGIRCd_VersionAddition )); + strlcat( NGIRCd_VersionAddition, HOST_VENDOR, sizeof( NGIRCd_VersionAddition )); strlcat( NGIRCd_VersionAddition, "/", sizeof( NGIRCd_VersionAddition )); - strlcat( NGIRCd_VersionAddition, TARGET_OS, sizeof( NGIRCd_VersionAddition )); + strlcat( NGIRCd_VersionAddition, HOST_OS, sizeof( NGIRCd_VersionAddition )); snprintf(NGIRCd_Version, sizeof NGIRCd_Version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition); diff --git a/src/portab/portab.h b/src/portab/portab.h index 90f36a0e..1c6e3f85 100644 --- a/src/portab/portab.h +++ b/src/portab/portab.h @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2010 Alexander Barton (alex@barton.de) + * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. * * 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 @@ -120,16 +120,16 @@ typedef unsigned char bool; /* target constants */ -#ifndef TARGET_OS -#define TARGET_OS "unknown" +#ifndef HOST_OS +#define HOST_OS "unknown" #endif -#ifndef TARGET_CPU -#define TARGET_CPU "unknown" +#ifndef HOST_CPU +#define HOST_CPU "unknown" #endif -#ifndef TARGET_VENDOR -#define TARGET_VENDOR "unknown" +#ifndef HOST_VENDOR +#define HOST_VENDOR "unknown" #endif From a451cb22f1906de2c0ed354b1e79eaae654b3abd Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 13 Sep 2012 00:25:09 +0200 Subject: [PATCH 11/18] configure.in: use AS_HELP_STRING macro --- configure.in | 51 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index 0f6af2a0..5be4a541 100644 --- a/configure.in +++ b/configure.in @@ -179,7 +179,8 @@ AC_CHECK_FUNCS([ \ x_syslog_on=no AC_ARG_WITH(syslog, - [ --without-syslog disable syslog (autodetected by default)], + AS_HELP_STRING([--without-syslog], + [disable syslog (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -206,7 +207,8 @@ fi x_zlib_on=no AC_ARG_WITH(zlib, - [ --without-zlib disable zlib compression (autodetected by default)], + AS_HELP_STRING([--without-zlib], + [disable zlib compression (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -233,7 +235,8 @@ fi x_io_backend=none AC_ARG_WITH(select, - [ --without-select disable select IO support (autodetected by default)], + AS_HELP_STRING([--without-select], + [disable select IO support (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -251,7 +254,8 @@ AC_ARG_WITH(select, ) AC_ARG_WITH(poll, - [ --without-poll disable poll support (autodetected by default)], + AS_HELP_STRING([--without-poll], + [disable poll support (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -277,7 +281,8 @@ AC_ARG_WITH(poll, ) AC_ARG_WITH(devpoll, - [ --without-devpoll disable /dev/poll IO support (autodetected by default)], + AS_HELP_STRING([--without-devpoll], + [disable /dev/poll IO support (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -294,7 +299,8 @@ AC_ARG_WITH(devpoll, ) AC_ARG_WITH(epoll, - [ --without-epoll disable epoll IO support (autodetected by default)], + AS_HELP_STRING([--without-epoll], + [disable epoll IO support (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -312,7 +318,8 @@ AC_ARG_WITH(epoll, ) AC_ARG_WITH(kqueue, - [ --without-kqueue disable kqueue IO support (autodetected by default)], + AS_HELP_STRING([--without-kqueue], + [disable kqueue IO support (autodetected by default)]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -352,7 +359,8 @@ fi # use SSL? AC_ARG_WITH(openssl, - [ --with-openssl enable SSL support using OpenSSL], + AS_HELP_STRING([--with-openssl], + [enable SSL support using OpenSSL]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -369,7 +377,8 @@ AC_ARG_WITH(openssl, ) AC_ARG_WITH(gnutls, - [ --with-gnutls enable SSL support using gnutls], + AS_HELP_STRING([--with-gnutls], + [enable SSL support using gnutls]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -399,7 +408,8 @@ fi x_tcpwrap_on=no AC_ARG_WITH(tcp-wrappers, - [ --with-tcp-wrappers enable TCP wrappers support], + AS_HELP_STRING([--with-tcp-wrappers], + [enable TCP wrappers support]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -430,7 +440,8 @@ int deny_severity = 0; x_identauth_on=no AC_ARG_WITH(ident, - [ --with-ident enable "IDENT" ("AUTH") protocol support], + AS_HELP_STRING([--with-ident], + [enable "IDENT" ("AUTH") protocol support]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -453,7 +464,8 @@ fi x_pam_on=no AC_ARG_WITH(pam, - [ --with-pam enable user authentication using PAM], + AS_HELP_STRING([--with-pam], + [enable user authentication using PAM]), [ if test "$withval" != "no"; then if test "$withval" != "yes"; then CFLAGS="-I$withval/include $CFLAGS" @@ -480,7 +492,8 @@ fi x_ircplus_on=yes AC_ARG_ENABLE(ircplus, - [ --disable-ircplus disable IRC+ protocol], + AS_HELP_STRING([--disable-ircplus], + [disable IRC+ protocol]), if test "$enableval" = "no"; then x_ircplus_on=no; fi ) if test "$x_ircplus_on" = "yes"; then @@ -490,7 +503,8 @@ fi # enable support for IPv6? x_ipv6_on=no AC_ARG_ENABLE(ipv6, - [ --enable-ipv6 enable IPv6 protocol support], + AS_HELP_STRING([--enable-ipv6], + [enable IPv6 protocol support]), if test "$enableval" = "yes"; then x_ipv6_on=yes; fi ) if test "$x_ipv6_on" = "yes"; then @@ -506,7 +520,8 @@ fi x_sniffer_on=no; x_debug_on=no AC_ARG_ENABLE(sniffer, - [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)], + AS_HELP_STRING([--enable-sniffer], + [enable IRC traffic sniffer (enables debug mode)]), if test "$enableval" = "yes"; then AC_DEFINE(SNIFFER, 1) x_sniffer_on=yes; x_debug_on=yes @@ -516,7 +531,8 @@ AC_ARG_ENABLE(sniffer, # enable additional debugging code? AC_ARG_ENABLE(debug, - [ --enable-debug show additional debug output], + AS_HELP_STRING([--enable-debug], + [show additional debug output]), if test "$enableval" = "yes"; then x_debug_on=yes; fi ) if test "$x_debug_on" = "yes"; then @@ -529,7 +545,8 @@ fi x_strict_rfc_on=no AC_ARG_ENABLE(strict-rfc, - [ --enable-strict-rfc strict RFC conformance -- may break clients!], + AS_HELP_STRING([--enable-strict-rfc], + [strict RFC conformance -- may break clients!]), if test "$enableval" = "yes"; then AC_DEFINE(STRICT_RFC, 1) x_strict_rfc_on=yes From ebf2f991b58372e01e018e0f769762b85360ed3e Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 13 Sep 2012 16:40:04 +0200 Subject: [PATCH 12/18] configure.in: use AC_SEARCH_LIBS (not AC_CHECK_LIB) Use the AC_SEARCH_LIBS macro to test for "sometimes but not always" required libraries, not AC_CHECK_LIB. --- configure.in | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/configure.in b/configure.in index 5be4a541..468e927b 100644 --- a/configure.in +++ b/configure.in @@ -147,11 +147,18 @@ AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),, # -- Libraries -- -# A/UX needs this. -AC_CHECK_LIB(UTIL,memmove) -# needed on solaris. GNU libc also has a libnsl, but we do not need it. -AC_SEARCH_LIBS(gethostbyname,nsl) -AC_CHECK_LIB(socket,bind) +# memmove: A/UX libUTIL +AC_SEARCH_LIBS([memmove], [UTIL], [], [ + AC_MSG_ERROR([unable to find the memmove() function]) +]) +# gethostbyname: Solaris libnsl +AC_SEARCH_LIBS([gethostbyname], [nsl], [], [ + AC_MSG_ERROR([unable to find the gethostbyname() function]) +]) +# bind: SVR4 libsocket +AC_SEARCH_LIBS([bind], [socket], [], [ + AC_MSG_ERROR([unable to find the bind() function]) +]) # -- Functions -- @@ -187,15 +194,12 @@ AC_ARG_WITH(syslog, CPPFLAGS="-I$withval/include $CPPFLAGS" LDFLAGS="-L$withval/lib $LDFLAGS" fi - AC_CHECK_LIB(be, syslog) - AC_CHECK_FUNCS(syslog, x_syslog_on=yes, + AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes], [ AC_MSG_ERROR([Can't enable syslog!]) - ) + ]) fi ], - [ - AC_CHECK_LIB(be, syslog) - AC_CHECK_FUNCS(syslog, x_syslog_on=yes) + [ AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes]) ] ) if test "$x_syslog_on" = "yes"; then From 7eb3932d3a3d6684b4c58c357bab12c2125c1775 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 13 Sep 2012 18:25:50 +0200 Subject: [PATCH 13/18] Make autogen.sh more verbose when VERBOSE=1 is set --- autogen.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/autogen.sh b/autogen.sh index c87085ac..cca200b2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ #!/bin/sh # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001-2008 Alexander Barton +# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors # # 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 @@ -98,6 +98,12 @@ Notfound() exit 1 } +Run() +{ + [ "$VERBOSE" = "1" ] && echo " - running \"$@\" ..." + $@ +} + # Reset locale settings to suppress warning messages of Perl unset LC_ALL unset LANG @@ -125,13 +131,13 @@ fi # specifies one: echo "Searching tools ..." [ -z "$ACLOCAL" ] && ACLOCAL=`Search aclocal 1` -[ "$VERBOSE" = "1" ] && echo "ACLOCAL=$ACLOCAL" +[ "$VERBOSE" = "1" ] && echo " - ACLOCAL=$ACLOCAL" [ -z "$AUTOHEADER" ] && AUTOHEADER=`Search autoheader 2` -[ "$VERBOSE" = "1" ] && echo "AUTOHEADER=$AUTOHEADER" +[ "$VERBOSE" = "1" ] && echo " - AUTOHEADER=$AUTOHEADER" [ -z "$AUTOMAKE" ] && AUTOMAKE=`Search automake 1` -[ "$VERBOSE" = "1" ] && echo "AUTOMAKE=$AUTOMAKE" +[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE=$AUTOMAKE" [ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2` -[ "$VERBOSE" = "1" ] && echo "AUTOCONF=$AUTOCONF" +[ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF" # Call ./configure when parameters have been passed to this script and # GO isn't already defined. @@ -147,10 +153,10 @@ export ACLOCAL AUTOHEADER AUTOMAKE AUTOCONF # Generate files echo "Generating files ..." -$ACLOCAL && \ - $AUTOHEADER && \ - $AUTOMAKE --add-missing && \ - $AUTOCONF --force +Run $ACLOCAL && \ + Run $AUTOCONF && \ + Run $AUTOHEADER && \ + Run $AUTOMAKE --add-missing --no-force if [ $? -eq 0 -a -x ./configure ]; then # Success: if we got some parameters we call ./configure and pass From 5c8c6d3c70b5797ce2f10a180519f545df7a6b38 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 13 Sep 2012 18:32:28 +0200 Subject: [PATCH 14/18] Updated config.{guess|sub} to version 2012-08-14 --- config.guess | 17 ++++++++++++----- config.sub | 23 ++++++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/config.guess b/config.guess index d622a44e..137bedf2 100644 --- a/config.guess +++ b/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2012-08-14' # 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 @@ -200,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -801,6 +805,9 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -1201,6 +1208,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1256,7 +1266,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1340,6 @@ EOF exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c < Date: Thu, 13 Sep 2012 18:48:25 +0200 Subject: [PATCH 15/18] configure.in: use AC_CHECK_{FUNCS|HEADERS}_ONCE --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 468e927b..23b50cd7 100644 --- a/configure.in +++ b/configure.in @@ -113,7 +113,7 @@ AC_CHECK_HEADERS([ \ ],,AC_MSG_ERROR([required C header missing!])) # Optional header files -AC_CHECK_HEADERS([ \ +AC_CHECK_HEADERS_ONCE([ \ arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \ stdint.h varargs.h \ ]) @@ -176,7 +176,7 @@ AC_CHECK_FUNCS([ \ AC_MSG_ERROR([required function missing!])) # Optional functions -AC_CHECK_FUNCS([ \ +AC_CHECK_FUNCS_ONCE([ \ gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \ snprintf vsnprintf strdup strlcpy strlcat strtok_r waitpid]) From 5300f0082cf834b60d36859acc0be3c17b3848c9 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 15 Sep 2012 19:15:16 +0200 Subject: [PATCH 16/18] Make our own targets "silent", if enabled --- doc/Makefile.am | 2 +- man/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 3bf68fb4..00f2530c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -10,7 +10,7 @@ # .tmpl: - sed \ + $(AM_V_GEN)sed \ -e s@:ETCDIR:@${sysconfdir}@ \ <$< >$@ diff --git a/man/Makefile.am b/man/Makefile.am index ebe9fcef..5624e2a1 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -17,7 +17,7 @@ TEMPLATE_MANS = ngircd.conf.5.tmpl ngircd.8.tmpl SUFFIXES = .tmpl . .tmpl: - sed \ + $(AM_V_GEN)sed \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:BINDIR:@${bindir}@ \ -e s@:ETCDIR:@${sysconfdir}@ \ From fe3bef55b75c5fbfbf87b098cbc61453b718435e Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 15 Sep 2012 20:26:59 +0200 Subject: [PATCH 17/18] Don't use AC_FUNC_MALLOC and AC_FUNC_REALLOC We don't expect the GNU'ish behaviour of of malloc() and realloc() and never implemented the replacement functions rpl_malloc()/rpl_realloc() -- so these test result in linking failues on systems that don't have a GNU'ish malloc() and realloc() even though we don't require it! Introduced by commit 47ad9afc. --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index 23b50cd7..949a383a 100644 --- a/configure.in +++ b/configure.in @@ -163,8 +163,6 @@ AC_SEARCH_LIBS([bind], [socket], [], [ # -- Functions -- AC_FUNC_FORK -AC_FUNC_MALLOC -AC_FUNC_REALLOC AC_FUNC_STRFTIME # Required functions From 5c160921ff898653666e72eb2e6c33575ada9672 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 16 Sep 2012 12:43:12 +0200 Subject: [PATCH 18/18] AUTOMAKE_OPTIONS: fix ansi2knr option, include path Set correct relative path to ansi2knr.c in AUTOMAKE_OPTIONS, so that ansi2knr.{1|c} is only included once in the distribution archive. --- src/ipaddr/Makefile.am | 7 ++++++- src/tool/Makefile.am | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ipaddr/Makefile.am b/src/ipaddr/Makefile.am index fcbb7cfd..6ce299f2 100644 --- a/src/ipaddr/Makefile.am +++ b/src/ipaddr/Makefile.am @@ -1,4 +1,9 @@ -AUTOMAKE_OPTIONS = ansi2knr +# +# ipaddr/Makefile.am +# (c) 2008 Florian Westphal , public domain. +# + +AUTOMAKE_OPTIONS = ../portab/ansi2knr INCLUDES = -I$(srcdir)/../portab diff --git a/src/tool/Makefile.am b/src/tool/Makefile.am index 5f1e97ad..8d6cda46 100644 --- a/src/tool/Makefile.am +++ b/src/tool/Makefile.am @@ -1,6 +1,6 @@ # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) +# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors # # 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 @@ -8,10 +8,8 @@ # (at your option) any later version. # Please read the file COPYING, README and AUTHORS for more information. # -# $Id: Makefile.am,v 1.1 2003/01/13 12:20:16 alex Exp $ -# -AUTOMAKE_OPTIONS = ansi2knr +AUTOMAKE_OPTIONS = ../portab/ansi2knr INCLUDES = -I$(srcdir)/../portab