@@ -586,8 +586,8 @@ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found])
586
586
dnl # Check if SOCK_CLOEXEC is supported #
587
587
dnl ################################################################################
588
588
AC_DEFUN ( [ LIBZMQ_CHECK_SOCK_CLOEXEC] , [ {
589
- AC_MSG_CHECKING ( whether SOCK_CLOEXEC is supported )
590
- AC_TRY_RUN ( [ /* SOCK_CLOEXEC test */
589
+ AC_CACHE_CHECK ( [ whether SOCK_CLOEXEC is supported] , [ libzmq_cv_sock_cloexec ] ,
590
+ [ AC_TRY_RUN ( [ /* SOCK_CLOEXEC test */
591
591
#include <sys/types.h>
592
592
#include <sys/socket.h>
593
593
@@ -596,11 +596,13 @@ int main (int argc, char *argv [])
596
596
int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
597
597
return (s == -1);
598
598
}
599
- ] ,
600
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_sock_cloexec="yes" ; $1 ] ,
601
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_sock_cloexec="no" ; $2 ] ,
602
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_sock_cloexec="no"]
599
+ ] ,
600
+ [ libzmq_cv_sock_cloexec="yes"] ,
601
+ [ libzmq_cv_sock_cloexec="no"] ,
602
+ [ libzmq_cv_sock_cloexec="not during cross-compile"]
603
+ ) ]
603
604
)
605
+ AS_IF ( [ test "x$libzmq_cv_sock_cloexec" = "xyes"] , [ $1 ] , [ $2 ] )
604
606
}] )
605
607
606
608
dnl ################################################################################
@@ -628,8 +630,8 @@ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found])
628
630
dnl # Check if SO_KEEPALIVE is supported #
629
631
dnl ################################################################################
630
632
AC_DEFUN ( [ LIBZMQ_CHECK_SO_KEEPALIVE] , [ {
631
- AC_MSG_CHECKING ( whether SO_KEEPALIVE is supported )
632
- AC_TRY_RUN ( [ /* SO_KEEPALIVE test */
633
+ AC_CACHE_CHECK ( [ whether SO_KEEPALIVE is supported] , [ libzmq_cv_so_keepalive ] ,
634
+ [ AC_TRY_RUN ( [ /* SO_KEEPALIVE test */
633
635
#include <sys/types.h>
634
636
#include <sys/socket.h>
635
637
@@ -641,20 +643,22 @@ int main (int argc, char *argv [])
641
643
((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
642
644
);
643
645
}
644
- ] ,
645
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_so_keepalive="yes" ; $1 ] ,
646
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_so_keepalive="no" ; $2 ] ,
647
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_so_keepalive="no"]
646
+ ] ,
647
+ [ libzmq_cv_so_keepalive="yes"] ,
648
+ [ libzmq_cv_so_keepalive="no"] ,
649
+ [ libzmq_cv_so_keepalive="not during cross-compile"]
650
+ ) ]
648
651
)
652
+ AS_IF ( [ test "x$libzmq_cv_so_keepalive" = "xyes"] , [ $1 ] , [ $2 ] )
649
653
}] )
650
654
651
655
dnl ################################################################################
652
656
dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found]) #
653
657
dnl # Check if TCP_KEEPCNT is supported #
654
658
dnl ################################################################################
655
659
AC_DEFUN ( [ LIBZMQ_CHECK_TCP_KEEPCNT] , [ {
656
- AC_MSG_CHECKING ( whether TCP_KEEPCNT is supported )
657
- AC_TRY_RUN ( [ /* TCP_KEEPCNT test */
660
+ AC_CACHE_CHECK ( [ whether TCP_KEEPCNT is supported] , [ libzmq_cv_tcp_keepcnt ] ,
661
+ [ AC_TRY_RUN ( [ /* TCP_KEEPCNT test */
658
662
#include <sys/types.h>
659
663
#include <sys/socket.h>
660
664
#include <netinet/in.h>
@@ -669,20 +673,22 @@ int main (int argc, char *argv [])
669
673
((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1)
670
674
);
671
675
}
672
- ] ,
673
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_tcp_keepcnt="yes" ; $1 ] ,
674
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_tcp_keepcnt="no" ; $2 ] ,
675
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_tcp_keepcnt="no"]
676
+ ] ,
677
+ [ libzmq_cv_tcp_keepcnt="yes"] ,
678
+ [ libzmq_cv_tcp_keepcnt="no"] ,
679
+ [ libzmq_cv_tcp_keepcnt="not during cross-compile"]
680
+ ) ]
676
681
)
682
+ AS_IF ( [ test "x$libzmq_cv_tcp_keepcnt" = "xyes"] , [ $1 ] , [ $2 ] )
677
683
}] )
678
684
679
685
dnl ################################################################################
680
686
dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found]) #
681
687
dnl # Check if TCP_KEEPIDLE is supported #
682
688
dnl ################################################################################
683
689
AC_DEFUN ( [ LIBZMQ_CHECK_TCP_KEEPIDLE] , [ {
684
- AC_MSG_CHECKING ( whether TCP_KEEPIDLE is supported )
685
- AC_TRY_RUN ( [ /* TCP_KEEPIDLE test */
690
+ AC_CACHE_CHECK ( [ whether TCP_KEEPIDLE is supported] , [ libzmq_cv_tcp_keepidle ] ,
691
+ [ AC_TRY_RUN ( [ /* TCP_KEEPIDLE test */
686
692
#include <sys/types.h>
687
693
#include <sys/socket.h>
688
694
#include <netinet/in.h>
@@ -697,20 +703,22 @@ int main (int argc, char *argv [])
697
703
((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1)
698
704
);
699
705
}
700
- ] ,
701
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_tcp_keepidle="yes" ; $1 ] ,
702
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_tcp_keepidle="no" ; $2 ] ,
703
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_tcp_keepidle="no"]
706
+ ] ,
707
+ [ libzmq_cv_tcp_keepidle="yes"] ,
708
+ [ libzmq_cv_tcp_keepidle="no"] ,
709
+ [ libzmq_cv_tcp_keepidle="not during cross-compile"]
710
+ ) ]
704
711
)
712
+ AS_IF ( [ test "x$libzmq_cv_tcp_keepidle" = "xyes"] , [ $1 ] , [ $2 ] )
705
713
}] )
706
714
707
715
dnl ################################################################################
708
716
dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found]) #
709
717
dnl # Check if TCP_KEEPINTVL is supported #
710
718
dnl ################################################################################
711
719
AC_DEFUN ( [ LIBZMQ_CHECK_TCP_KEEPINTVL] , [ {
712
- AC_MSG_CHECKING ( whether TCP_KEEPINTVL is supported )
713
- AC_TRY_RUN ( [ /* TCP_KEEPINTVL test */
720
+ AC_CACHE_CHECK ( [ whether TCP_KEEPINTVL is supported] , [ libzmq_cv_tcp_keepintvl ] ,
721
+ [ AC_TRY_RUN ( [ /* TCP_KEEPINTVL test */
714
722
#include <sys/types.h>
715
723
#include <sys/socket.h>
716
724
#include <netinet/in.h>
@@ -725,20 +733,22 @@ int main (int argc, char *argv [])
725
733
((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1)
726
734
);
727
735
}
728
- ] ,
729
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_tcp_keepintvl="yes" ; $1 ] ,
730
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_tcp_keepintvl="no" ; $2 ] ,
731
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_tcp_keepintvl="no"]
736
+ ] ,
737
+ [ libzmq_cv_tcp_keepintvl="yes"] ,
738
+ [ libzmq_cv_tcp_keepintvl="no"] ,
739
+ [ libzmq_cv_tcp_keepintvl="not during cross-compile"]
740
+ ) ]
732
741
)
742
+ AS_IF ( [ test "x$libzmq_cv_tcp_keepintvl" = "xyes"] , [ $1 ] , [ $2 ] )
733
743
}] )
734
744
735
745
dnl ################################################################################
736
746
dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found]) #
737
747
dnl # Check if TCP_KEEPALIVE is supported #
738
748
dnl ################################################################################
739
749
AC_DEFUN ( [ LIBZMQ_CHECK_TCP_KEEPALIVE] , [ {
740
- AC_MSG_CHECKING ( whether TCP_KEEPALIVE is supported )
741
- AC_TRY_RUN ( [ /* TCP_KEEPALIVE test */
750
+ AC_CACHE_CHECK ( [ whether TCP_KEEPALIVE is supported] , [ libzmq_cv_tcp_keepalive ] ,
751
+ [ AC_TRY_RUN ( [ /* TCP_KEEPALIVE test */
742
752
#include <sys/types.h>
743
753
#include <sys/socket.h>
744
754
#include <netinet/in.h>
@@ -753,11 +763,13 @@ int main (int argc, char *argv [])
753
763
((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
754
764
);
755
765
}
756
- ] ,
757
- [ AC_MSG_RESULT ( yes ) ; libzmq_cv_tcp_keepalive="yes" ; $1 ] ,
758
- [ AC_MSG_RESULT ( no ) ; libzmq_cv_tcp_keepalive="no" ; $2 ] ,
759
- [ AC_MSG_RESULT ( not during cross-compile ) ; libzmq_cv_tcp_keepalive="no"]
766
+ ] ,
767
+ [ libzmq_cv_tcp_keepalive="yes"] ,
768
+ [ libzmq_cv_tcp_keepalive="no"] ,
769
+ [ libzmq_cv_tcp_keepalive="not during cross-compile"]
770
+ ) ]
760
771
)
772
+ AS_IF ( [ test "x$libzmq_cv_tcp_keepalive" = "xyes"] , [ $1 ] , [ $2 ] )
761
773
}] )
762
774
763
775
dnl ################################################################################
0 commit comments