In metaconfig.git, the branch master has been updated <http://perl5.git.perl.org/metaconfig.git/commitdiff/db47d1ffced313476cf2a4dfb74f41da894bfe57?hp=b693a418e263af3655e38d59f142b56eb2223b6e>
- Log ----------------------------------------------------------------- commit db47d1ffced313476cf2a4dfb74f41da894bfe57 Author: H.Merijn Brand <[email protected]> Date: Fri Dec 10 11:27:49 2010 +0100 Add probe for sa_len availability in sockaddr struct ----------------------------------------------------------------------- Summary of changes: U/modified/d_socket.U | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/U/modified/d_socket.U b/U/modified/d_socket.U index 3ff6df2..c6756e5 100644 --- a/U/modified/d_socket.U +++ b/U/modified/d_socket.U @@ -20,7 +20,7 @@ ?RCS: ?MAKE:d_socket d_oldsock d_sockpair socketlib sockethdr \ d_msg_ctrunc d_msg_dontroute d_msg_oob d_msg_peek d_msg_proxy \ - d_scm_rights: \ + d_scm_rights d_sockaddr_sa_len: \ contains echo n c ar nm nm_opt nm_extract Inlibc Csym _a \ Compile cat rm_try Setvar Hasfield ?MAKE: -pick add $@ %< @@ -66,6 +66,11 @@ ?S: which indicates that the SCM_RIGHTS is available. #ifdef is ?S: not enough because it may be an enum, glibc has been known to do this. ?S:. +?S:d_sockaddr_sa_len: +?S: This variable conditionally defines the HAS_SOCKADDR_SA_LEN symbol, +?S: which indicates that a struct sockaddr structure has the sa_len +?S: member. +?S:. ?S:socketlib: ?S: This variable has the names of any libraries needed for socket support. ?S:. @@ -115,8 +120,14 @@ ?C: Checking just with #ifdef might not be enough because this symbol ?C: has been known to be an enum. ?C:. +?C:HAS_SOCKADDR_SA_LEN: +?C: This symbol, if defined, indicates that the struct sockaddr +?C: structure has a member called sa_len, indicating the length of +?C: the structure. +?C:. ?H:#$d_socket HAS_SOCKET /**/ ?H:#$d_sockpair HAS_SOCKETPAIR /**/ +?H:#$d_sockaddr_sa_len HAS_SOCKADDR_SA_LEN /**/ ?H:#$d_oldsock USE_OLDSOCKET /**/ ?H:#$d_msg_ctrunc HAS_MSG_CTRUNC /**/ ?H:#$d_msg_dontroute HAS_MSG_DONTROUTE /**/ @@ -127,7 +138,7 @@ ?H:. ?T:val net ENUM enum ?F:try.c -?LINT:set d_sockpair +?LINT:set d_sockpair d_sockaddr_sa_len ?LINT:set d_msg_ctrunc d_msg_dontroute d_msg_oob d_msg_peek d_msg_proxy ?LINT:set d_scm_rights : see whether socket exists @@ -204,6 +215,24 @@ eval $inlibc @end echo " " +?X: ... +echo "Checking the availability sa_len in the sock struct ..." >&4 +$cat >try.c <<EOF +#include <sys/types.h> +#include <sys/socket.h> +int main() { +struct sockaddr sa; +return (sa.sa_len); +} +EOF +val="$undef" +set try; if eval $compile; then + val="$define" +fi +set d_sockaddr_sa_len; eval $setvar +$rm_try + +echo " " ?X: these constants are known to be troublesomely defined as enums ?X: so that ifdef will not work for detecting their presence. echo "Checking the availability of certain socket constants..." >&4 -- perl5 metaconfig repository
