]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUILD] fix platform-dependant build issues related to crypt()
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 18:10:14 +0000 (19:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 18:10:14 +0000 (19:10 +0100)
commit890a33e41f6ed7e7b56967b31a23731f52094e04
tree3d958690c5af2ed05c8fa9622c68eb98196b9f4c
parent40dba0934380635e72bfefc60a654ab34fc243de
[BUILD] fix platform-dependant build issues related to crypt()

Holger Just and Ross West reported build issues on FreeBSD and
Solaris that were initially caused by the definition of
_XOPEN_SOURCE at the top of auth.c, which was required on Linux
to avoid a build warning.

Krzysztof Oledzki found that using _GNU_SOURCE instead also worked
on Linux and did not cause any issue on several versions of FreeBSD.
Solaris still reported a warning this time, which was fixed by
including <crypt.h>, which itself is not present on FreeBSD nor on
all Linux toolchains.

So by adding a new build option (NEED_CRYPT_H), we can get Solaris
to get crypt() working and stop complaining at the same time, without
impacting other platforms.

This fix was tested at least on several linux toolchains (at least
uclibc, glibc 2.2.5, 2.3.6 and 2.7), on FreeBSD 4 to 8, Solaris 8
(which needs crypt.h), and AIX 5.3 (without crypt.h).

Every time it builds without a warning.
Makefile
src/auth.c