from bugzilla #105:
"ngircd-16 works great under openbsd4.7/i386, but it segfaults on
openbsd4.7/amd64."
Caused by missing function prototypes and the resulting truncation of
pointer to int.
Lets try to catch these bugs during compilation instead of SIGSEGV.
This solves warning messages of autoconf on e.g. FreeBSD 8:
configure: WARNING: netinet/ip.h: present but cannot be compiled
configure: WARNING: netinet/ip.h: check for missing prerequisite headers?
dpkg-shlibdeps: warning: dependency on libnsl.so.1 [..]
(they use none of its symbols).
As shown via commit 2b14234abc
(dpkg-shlibdeps: warning: dependency on libnsl.so.1) and the
following revert of that commit, we cannot simply drop
the AC_CHECK_LIB(nsl). Although -lnsl is indeed unneeded
when glibc is used, some platforms (e.g. Solaris) need it.
Use AC_SEARCH_LIBS instead to only link when the library exports
a particular symbol.
Test for sockaddr_in.sin_len and initialize it to the correct value
which some systems (notably Mac OS X) require.
Note: this code path is only relevant when not using getaddrinfo().
Both getaddrinfo() and getnameinfo() are now used always when available, and
not only when compiling ngIRCd with support for IPv6.
This not only enables ngIRCd to handle multiple addresses per hostname when
compiled without support for IPv6, but fixes binding ngIRCd to IP addresses
on Mac OS X (and probably other BSD-based systems) as well: these systems
require that sockaddr_in is zeroed out and sockaddr_in.sin_len is set to
sizeof(sockaddr_in) like that:
src/ipaddr/ng_ipaddr.c, line 54:
assert(ip_str);
+ memset(addr, 0, sizeof *addr);
+ addr->sin4.sin_len = sizeof(addr->sin4);
addr->sin4.sin_family = AF_INET;
But this would break all the systems not using sockaddr_in.sin_len, for
example Linux -- so we assume that all these systems provide getaddrinfo()
and use that for now.
This patch fixes --with-openssl and --with-gnutls and enables both to
accept path names, so that you can use "./configure --with-XXX=/path".
All the other --with-XXX parameters support this already.
Starting with GNU automake 1.11 "AM_SILENT_RULES([yes])" is available to
make the build process less verbose ("Linux 2.6 style") which helps to
spot warning and error messages.
So we use it if it is available.
This patch adds a new make target, "osxpkg", to the main Makefile which
gereates a Apple Mac OS X installer package of ngIRCd. The packagemaker(1)
project bundle is stored in contrib/MacOSX/ngIRCd.pmdoc.
- Solaris needs both -lsocket _and_ -lnsl
- A/UX needs -lUTIL
"... which totally sucks because we'd link libnsl on Linux, too
(where its not needed at all). So, we have to figure out how to tell
autocrap to NOT put -lnsl there unless it exports a symbol we need.
This also means that [...] has to be reverted (or done properly)."
-- Florian Westphal @ #ngircd
This reverts commit 2b14234abc.
(they use none of its symbols).
So, rip out that AC_CHECK_LIB cruft, pointed out by Christoph Biedl.
If there are platforms that really need that we should
only link when we actually use these libraries.
This patch does significant cleanup on the join code by using strtok_r
instead of mangling strchr to parse channel names and keys in parallel when
a JOIN command contains a list of channels and keys.
Also adds an strtok_r implementation to libportab.
Drop checks for the following C standard functions:
malloc, memmove, memset, realloc, strchr, strcspn, strerror, strstr.
Rationale: These are standard K&R/C89 functions, no point in
''making sure they exist''.
all references to struct sockaddr/in_addr have been
removed from src/ngircd.
libngipaddr (in src/ipaddr/) hides all the gory details.
See src/ipaddr/ng_ipaddr.h for API description.