AC_CACHE_CHECK(
[if $CC can handle @%:@warning],
- [ac_cv_cpp_warning],
+ ac_cv_cpp_warning,
[
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[#warning foo]])],
+ AC_LANG_PROGRAM([], [#warning foo]),
[ac_cv_cpp_warning=yes],
[ac_cv_cpp_warning=no],
)
AC_CHECK_HEADERS([arpa/nameser.h])
AC_CHECK_HEADERS([sys/socket.h])
+
+dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
+dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
+dnl compiles it without complaint. The mpinfou union is defined later
+dnl in the resulting preprocessed source than the spu_info array in
+dnl /usr/include/machine/sys/getppdp.h:
+dnl extern union mpinfou spu_info[];
+dnl triggering the error. Our strategy is on HP-UX only, test for
+dnl net/netmp.h, which is the file included by net/if.h that leads to
+dnl getppdp.h. If it is present but can't be compiled, try adding
+dnl a duplicate definition of mpinfou, which should then allow the
+dnl following net/if.h and net/if6.h tests to proceed normally.
+dnl Using net/netmp.h allows us to avoid polluting test results for
+dnl net/if.h.
+#
+case "$host" in
+ *-hp-hpux*)
+ AC_CHECK_HEADERS(
+ [net/netmp.h],
+ [netmp_h_works=yes],
+ [netmp_h_works=no]
+ )
+ case "$netmp_h_works" in
+ no)
+ cat >>confdefs.h <<_ACEOF
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou { /* For lint */
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+_ACEOF
+ AH_BOTTOM([
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou { /* For lint */
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+])
+ ;;
+ esac
+ ;;
+esac
+
AC_CHECK_HEADERS([net/if.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
;;
esac
-dnl AC_CHECK_HEADERS(net/if.h, [], [],
-dnl [#if HAVE_SYS_TYPES_H
-dnl # include <sys/types.h>
-dnl #endif
-dnl #if HAVE_SYS_SOCKET_H
-dnl # include <sys/socket.h>
-dnl #endif
-dnl ])
-
AC_CHECK_HEADERS(sys/proc.h, [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
[AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
[for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
- AC_TRY_COMPILE(
- [AC_LANG_PROGRAM([
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif
- ], [
- extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);
- ])], ,
+ AC_TRY_COMPILE(dnl
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
[ac_not_found=no ; break 2], ac_not_found=yes)
done
done
esac
AC_CACHE_CHECK([for the ppsclock streams module],
- [ac_cv_var_ppsclock],
- [ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev])
+ ac_cv_var_ppsclock,
+ ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
case "$ac_cv_var_ppsclock" in
yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
esac
i386-sequent-sysv4)
;;
*)
- AC_COMPILE_IFELSE([
+ AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[
#ifdef HAVE_NETINET_IN_H
struct ip_mreq ipmr;
ipmr.imr_interface.s_addr = 0;
]
- )],
+ ),
[ntp_cv_multicast=yes],
[]
)
AC_PREREQ([2.53])
# Checks for programs.
-AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CPP
# AC_PROG_CC_STDC has two functions. It attempts to find a compiler
# capable of C99, or failing that, for C89. CC is set afterward with
# Checks for header files.
AC_HEADER_STDC
+
+dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
+dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
+dnl compiles it without complaint. The mpinfou union is defined later
+dnl in the resulting preprocessed source than the spu_info array in
+dnl /usr/include/machine/sys/getppdp.h:
+dnl extern union mpinfou spu_info[];
+dnl triggering the error. Our strategy is on HP-UX only, test for
+dnl net/netmp.h, which is the file included by net/if.h that leads to
+dnl getppdp.h. If it is present but can't be compiled, try adding
+dnl a duplicate definition of mpinfou, which should then allow the
+dnl following net/if.h and net/if6.h tests to proceed normally.
+dnl Using net/netmp.h allows us to avoid polluting test results for
+dnl net/if.h.
+#
+case "$host" in
+ *-hp-hpux*)
+ AC_CHECK_HEADERS(
+ [net/netmp.h],
+ [netmp_h_works=yes],
+ [netmp_h_works=no]
+ )
+ case "$netmp_h_works" in
+ no)
+ cat >>confdefs.h <<_ACEOF
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou { /* For lint */
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+_ACEOF
+ AH_BOTTOM([
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou { /* For lint */
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+])
+ ;;
+ esac
+ ;;
+esac
+
AC_CHECK_HEADERS([netdb.h netinet/in.h stdlib.h string.h strings.h syslog.h])
AC_CHECK_HEADERS([sys/socket.h sys/time.h])
AC_HEADER_TIME