"Fossies" - the Fresh Open Source Software Archive

Member "bwping-1.15/configure.ac" (10 Jun 2019, 6443 Bytes) of package /linux/privat/bwping-1.15.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.14_vs_1.15.

    1 AC_INIT([bwping], [1.15])
    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([inet_ntop], [resolv nsl], [],
   32     [AC_MSG_ERROR([inet_ntop() is required for build])])
   33 AC_SEARCH_LIBS([getaddrinfo], [resolv nsl], [],
   34     [AC_MSG_ERROR([getaddrinfo() 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_SUBST([AM_CFLAGS])
   68 
   69 AC_MSG_CHECKING([for IPv6 support])
   70 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
   71 #include <sys/types.h>
   72 #include <sys/socket.h>
   73 
   74 #include <stdlib.h>
   75 
   76 #include <netinet/in.h>
   77 #include <netinet/in_systm.h>
   78 #include <netinet/ip.h>
   79 #include <netinet/ip6.h>
   80 #ifdef HAVE_NETINET_ICMP6_H
   81 #include <netinet/icmp6.h>
   82 #endif
   83 
   84 #ifdef __CYGWIN__
   85 
   86 /* BEGIN OF INCLUDE/CYGWIN.H */
   87 
   88 #ifndef CYGWIN_H
   89 #define CYGWIN_H
   90 
   91 #ifndef ICMP_MINLEN
   92 #define ICMP_MINLEN 8
   93 #endif
   94 #ifndef ICMP_ECHO
   95 #define ICMP_ECHO 8
   96 #endif
   97 #ifndef ICMP_ECHOREPLY
   98 #define ICMP_ECHOREPLY 0
   99 #endif
  100 
  101 struct icmp_ra_addr
  102 {
  103     u_int32_t ira_addr;
  104     u_int32_t ira_preference;
  105 } __attribute__((packed));
  106 
  107 struct icmp
  108 {
  109     u_int8_t  icmp_type;  /* type of message, see below */
  110     u_int8_t  icmp_code;  /* type sub code */
  111     u_int16_t icmp_cksum; /* ones complement checksum of struct */
  112     union
  113     {
  114         u_char ih_pptr;             /* ICMP_PARAMPROB */
  115         struct in_addr ih_gwaddr;   /* gateway address */
  116         struct ih_idseq             /* echo datagram */
  117         {
  118             u_int16_t icd_id;
  119             u_int16_t icd_seq;
  120         } __attribute__((packed)) ih_idseq;
  121         u_int32_t ih_void;
  122 
  123         /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
  124         struct ih_pmtu
  125         {
  126             u_int16_t ipm_void;
  127             u_int16_t ipm_nextmtu;
  128         } __attribute__((packed)) ih_pmtu;
  129 
  130         struct ih_rtradv
  131         {
  132             u_int8_t irt_num_addrs;
  133             u_int8_t irt_wpa;
  134             u_int16_t irt_lifetime;
  135         } __attribute__((packed)) ih_rtradv;
  136     } __attribute__((packed)) icmp_hun;
  137 #define icmp_pptr       icmp_hun.ih_pptr
  138 #define icmp_gwaddr     icmp_hun.ih_gwaddr
  139 #define icmp_id         icmp_hun.ih_idseq.icd_id
  140 #define icmp_seq        icmp_hun.ih_idseq.icd_seq
  141 #define icmp_void       icmp_hun.ih_void
  142 #define icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
  143 #define icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
  144 #define icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
  145 #define icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
  146 #define icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
  147     union
  148     {
  149         struct
  150         {
  151             u_int32_t its_otime;
  152             u_int32_t its_rtime;
  153             u_int32_t its_ttime;
  154         } __attribute__((packed)) id_ts;
  155         struct
  156         {
  157             struct ip idi_ip;
  158             /* options and then 64 bits of data */
  159         } __attribute__((packed)) id_ip;
  160         struct icmp_ra_addr id_radv;
  161         u_int32_t   id_mask;
  162         u_int8_t    id_data[1];
  163     } __attribute__((packed)) icmp_dun;
  164 #define icmp_otime      icmp_dun.id_ts.its_otime
  165 #define icmp_rtime      icmp_dun.id_ts.its_rtime
  166 #define icmp_ttime      icmp_dun.id_ts.its_ttime
  167 #define icmp_ip         icmp_dun.id_ip.idi_ip
  168 #define icmp_radv       icmp_dun.id_radv
  169 #define icmp_mask       icmp_dun.id_mask
  170 #define icmp_data       icmp_dun.id_data
  171 } __attribute__((packed));
  172 
  173 struct icmp6_hdr {
  174     u_int8_t  icmp6_type;     /* type field */
  175     u_int8_t  icmp6_code;     /* code field */
  176     u_int16_t icmp6_cksum;    /* checksum field */
  177     union {
  178         u_int32_t icmp6_un_data32[1]; /* type-specific field */
  179         u_int16_t icmp6_un_data16[2]; /* type-specific field */
  180         u_int8_t  icmp6_un_data8[4];  /* type-specific field */
  181     } __attribute__((packed)) icmp6_dataun;
  182 } __attribute__((packed));
  183 
  184 #define icmp6_data32    icmp6_dataun.icmp6_un_data32
  185 #define icmp6_data16    icmp6_dataun.icmp6_un_data16
  186 #define icmp6_data8     icmp6_dataun.icmp6_un_data8
  187 #define icmp6_pptr      icmp6_data32[0] /* parameter prob */
  188 #define icmp6_mtu       icmp6_data32[0] /* packet too big */
  189 #define icmp6_id        icmp6_data16[0] /* echo request/reply */
  190 #define icmp6_seq       icmp6_data16[1] /* echo request/reply */
  191 #define icmp6_maxdelay  icmp6_data16[0] /* mcast group membership */
  192 
  193 #define ICMP6_ECHO_REQUEST 128 /* echo service */
  194 #define ICMP6_ECHO_REPLY   129 /* echo reply */
  195 
  196 #endif /* CYGWIN_H */
  197 
  198 /* END OF INCLUDE/CYGWIN.H */
  199 
  200 #endif
  201     ], [
  202         struct sockaddr_in6 foo;
  203         struct icmp6_hdr bar;
  204 
  205         socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
  206 
  207         exit(0);
  208     ])],
  209     [bwping_cv_sys_ipv6=yes],
  210     [bwping_cv_sys_ipv6=no],
  211     [bwping_cv_sys_ipv6=no])
  212 AC_MSG_RESULT([${bwping_cv_sys_ipv6}])
  213 if test "${bwping_cv_sys_ipv6}" = "no"; then
  214     AC_MSG_ERROR([IPv6 support is required for build])
  215 fi
  216 
  217 AC_OUTPUT