"Fossies" - the Fresh Open Source Software Archive

Member "bwping-1.17/configure.ac" (12 May 2020, 6971 Bytes) of package /linux/privat/bwping-1.17.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.16_vs_1.17.

    1 AC_INIT([bwping], [1.17])
    2 
    3 AC_CONFIG_SRCDIR([ChangeLog])
    4 AC_CONFIG_HEADERS([config.h])
    5 AC_CONFIG_FILES([Makefile])
    6 
    7 AM_INIT_AUTOMAKE
    8 
    9 AC_PROG_CC
   10 AC_PROG_CC_C99
   11 if test "${ac_cv_prog_cc_c99}" = "no"; then
   12     AC_MSG_ERROR([C99 compiler is required for build])
   13 fi
   14 
   15 AC_PROG_LN_S
   16 AC_PROG_INSTALL
   17 
   18 AC_CHECK_HEADERS([netinet/icmp6.h], [], [], [
   19 #include <sys/types.h>
   20 
   21 #include <netinet/in.h>
   22 #include <netinet/in_systm.h>
   23 #include <netinet/ip6.h>
   24     ])
   25 
   26 AC_SEARCH_LIBS([clock_gettime], [rt],
   27     [AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
   28         [Define to 1 if you have the `clock_gettime' function.])])
   29 AC_SEARCH_LIBS([socket], [socket], [],
   30     [AC_MSG_ERROR([socket() is required for build])])
   31 AC_SEARCH_LIBS([getaddrinfo], [resolv nsl xnet], [],
   32     [AC_MSG_ERROR([getaddrinfo() is required for build])])
   33 AC_SEARCH_LIBS([getnameinfo], [resolv nsl xnet], [],
   34     [AC_MSG_ERROR([getnameinfo() is required for build])])
   35 
   36 bwping_save_cflags=${CFLAGS}
   37 AC_MSG_CHECKING([whether the C compiler accepts -Wall...])
   38 CFLAGS="${CFLAGS} -Wall"
   39 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
   40                   [bwping_cv_c_wall=yes],
   41                   [bwping_cv_c_wall=no])
   42 CFLAGS=${bwping_save_cflags}
   43 AC_MSG_RESULT([${bwping_cv_c_wall}])
   44 if test "${bwping_cv_c_wall}" = "yes"; then
   45     AM_CFLAGS="${AM_CFLAGS} -Wall"
   46 fi
   47 AC_MSG_CHECKING([whether the C compiler accepts -Wextra...])
   48 CFLAGS="${CFLAGS} -Wextra"
   49 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
   50                   [bwping_cv_c_wextra=yes],
   51                   [bwping_cv_c_wextra=no])
   52 CFLAGS=${bwping_save_cflags}
   53 AC_MSG_RESULT([${bwping_cv_c_wextra}])
   54 if test "${bwping_cv_c_wextra}" = "yes"; then
   55     AM_CFLAGS="${AM_CFLAGS} -Wextra"
   56 fi
   57 AC_MSG_CHECKING([whether the C compiler accepts -Wpedantic...])
   58 CFLAGS="${CFLAGS} -Wpedantic"
   59 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
   60                   [bwping_cv_c_wpedantic=yes],
   61                   [bwping_cv_c_wpedantic=no])
   62 CFLAGS=${bwping_save_cflags}
   63 AC_MSG_RESULT([${bwping_cv_c_wpedantic}])
   64 if test "${bwping_cv_c_wpedantic}" = "yes"; then
   65     AM_CFLAGS="${AM_CFLAGS} -Wpedantic"
   66 fi
   67 AC_MSG_CHECKING([whether the C compiler accepts -Wno-missing-field-initializers...])
   68 CFLAGS="${CFLAGS} -Wno-missing-field-initializers"
   69 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
   70                   [bwping_cv_c_wnomissingfieldinitializers=yes],
   71                   [bwping_cv_c_wnomissingfieldinitializers=no])
   72 CFLAGS=${bwping_save_cflags}
   73 AC_MSG_RESULT([${bwping_cv_c_wnomissingfieldinitializers}])
   74 if test "${bwping_cv_c_wnomissingfieldinitializers}" = "yes"; then
   75     AM_CFLAGS="${AM_CFLAGS} -Wno-missing-field-initializers"
   76 fi
   77 AC_SUBST([AM_CFLAGS])
   78 
   79 AC_MSG_CHECKING([for IPv6 support])
   80 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
   81 #include <sys/types.h>
   82 #include <sys/socket.h>
   83 
   84 #include <stdlib.h>
   85 
   86 #include <netinet/in.h>
   87 #include <netinet/in_systm.h>
   88 #include <netinet/ip.h>
   89 #include <netinet/ip6.h>
   90 #ifdef HAVE_NETINET_ICMP6_H
   91 #include <netinet/icmp6.h>
   92 #endif
   93 
   94 #ifdef __CYGWIN__
   95 
   96 /* BEGIN OF INCLUDE/CYGWIN.H */
   97 
   98 #ifndef CYGWIN_H
   99 #define CYGWIN_H
  100 
  101 #ifndef ICMP_MINLEN
  102 #define ICMP_MINLEN 8
  103 #endif
  104 #ifndef ICMP_ECHO
  105 #define ICMP_ECHO 8
  106 #endif
  107 #ifndef ICMP_ECHOREPLY
  108 #define ICMP_ECHOREPLY 0
  109 #endif
  110 
  111 struct icmp_ra_addr
  112 {
  113     u_int32_t ira_addr;
  114     u_int32_t ira_preference;
  115 } __attribute__((packed));
  116 
  117 struct icmp
  118 {
  119     u_int8_t  icmp_type;  /* type of message, see below */
  120     u_int8_t  icmp_code;  /* type sub code */
  121     u_int16_t icmp_cksum; /* ones complement checksum of struct */
  122     union
  123     {
  124         u_char ih_pptr;             /* ICMP_PARAMPROB */
  125         struct in_addr ih_gwaddr;   /* gateway address */
  126         struct ih_idseq             /* echo datagram */
  127         {
  128             u_int16_t icd_id;
  129             u_int16_t icd_seq;
  130         } __attribute__((packed)) ih_idseq;
  131         u_int32_t ih_void;
  132 
  133         /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
  134         struct ih_pmtu
  135         {
  136             u_int16_t ipm_void;
  137             u_int16_t ipm_nextmtu;
  138         } __attribute__((packed)) ih_pmtu;
  139 
  140         struct ih_rtradv
  141         {
  142             u_int8_t irt_num_addrs;
  143             u_int8_t irt_wpa;
  144             u_int16_t irt_lifetime;
  145         } __attribute__((packed)) ih_rtradv;
  146     } __attribute__((packed)) icmp_hun;
  147 #define icmp_pptr       icmp_hun.ih_pptr
  148 #define icmp_gwaddr     icmp_hun.ih_gwaddr
  149 #define icmp_id         icmp_hun.ih_idseq.icd_id
  150 #define icmp_seq        icmp_hun.ih_idseq.icd_seq
  151 #define icmp_void       icmp_hun.ih_void
  152 #define icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
  153 #define icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
  154 #define icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
  155 #define icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
  156 #define icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
  157     union
  158     {
  159         struct
  160         {
  161             u_int32_t its_otime;
  162             u_int32_t its_rtime;
  163             u_int32_t its_ttime;
  164         } __attribute__((packed)) id_ts;
  165         struct
  166         {
  167             struct ip idi_ip;
  168             /* options and then 64 bits of data */
  169         } __attribute__((packed)) id_ip;
  170         struct icmp_ra_addr id_radv;
  171         u_int32_t   id_mask;
  172         u_int8_t    id_data[1];
  173     } __attribute__((packed)) icmp_dun;
  174 #define icmp_otime      icmp_dun.id_ts.its_otime
  175 #define icmp_rtime      icmp_dun.id_ts.its_rtime
  176 #define icmp_ttime      icmp_dun.id_ts.its_ttime
  177 #define icmp_ip         icmp_dun.id_ip.idi_ip
  178 #define icmp_radv       icmp_dun.id_radv
  179 #define icmp_mask       icmp_dun.id_mask
  180 #define icmp_data       icmp_dun.id_data
  181 } __attribute__((packed));
  182 
  183 struct icmp6_hdr {
  184     u_int8_t  icmp6_type;     /* type field */
  185     u_int8_t  icmp6_code;     /* code field */
  186     u_int16_t icmp6_cksum;    /* checksum field */
  187     union {
  188         u_int32_t icmp6_un_data32[1]; /* type-specific field */
  189         u_int16_t icmp6_un_data16[2]; /* type-specific field */
  190         u_int8_t  icmp6_un_data8[4];  /* type-specific field */
  191     } __attribute__((packed)) icmp6_dataun;
  192 } __attribute__((packed));
  193 
  194 #define icmp6_data32    icmp6_dataun.icmp6_un_data32
  195 #define icmp6_data16    icmp6_dataun.icmp6_un_data16
  196 #define icmp6_data8     icmp6_dataun.icmp6_un_data8
  197 #define icmp6_pptr      icmp6_data32[0] /* parameter prob */
  198 #define icmp6_mtu       icmp6_data32[0] /* packet too big */
  199 #define icmp6_id        icmp6_data16[0] /* echo request/reply */
  200 #define icmp6_seq       icmp6_data16[1] /* echo request/reply */
  201 #define icmp6_maxdelay  icmp6_data16[0] /* mcast group membership */
  202 
  203 #define ICMP6_ECHO_REQUEST 128 /* echo service */
  204 #define ICMP6_ECHO_REPLY   129 /* echo reply */
  205 
  206 #endif /* CYGWIN_H */
  207 
  208 /* END OF INCLUDE/CYGWIN.H */
  209 
  210 #endif /* __CYGWIN__ */
  211     ], [
  212         struct sockaddr_in6 foo;
  213         struct icmp6_hdr bar;
  214 
  215         socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
  216 
  217         exit(0);
  218     ])],
  219     [bwping_cv_sys_ipv6=yes],
  220     [bwping_cv_sys_ipv6=no])
  221 AC_MSG_RESULT([${bwping_cv_sys_ipv6}])
  222 if test "${bwping_cv_sys_ipv6}" = "no"; then
  223     AC_MSG_ERROR([IPv6 support is required for build])
  224 fi
  225 
  226 AC_OUTPUT