diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 22458 |
1 files changed, 16895 insertions, 5563 deletions
diff --git a/configure b/configure index aae2c01abfd7..c99576e43a8a 100755 --- a/configure +++ b/configure @@ -1,6 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for ntp 4.2.6p5. +# Generated by GNU Autoconf 2.68 for ntp4 4.2.8. +# +# Report bugs to <http://bugs.ntp.org./>. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -244,10 +246,11 @@ fi $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugs.ntp.org./ about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." fi exit 1 fi @@ -565,12 +568,12 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='ntp' -PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.6p5' -PACKAGE_STRING='ntp 4.2.6p5' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' +PACKAGE_NAME='ntp4' +PACKAGE_TARNAME='ntp4' +PACKAGE_VERSION='4.2.8' +PACKAGE_STRING='ntp4 4.2.8' +PACKAGE_BUGREPORT='http://bugs.ntp.org./' +PACKAGE_URL='http://www.ntp.org./' # Factoring default headers for most tests. ac_includes_default="\ @@ -608,12 +611,21 @@ ac_includes_default="\ # include <unistd.h> #endif" +ac_header_list= enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS -LIBOBJS subdirs +PERLLIBDIR +NTP_KEYSDIR +GTEST_AVAILABLE_FALSE +GTEST_AVAILABLE_TRUE +GTEST_CPPFLAGS +GTEST_CXXFLAGS +GTEST_LIBS +GTEST_LDFLAGS +GTEST_CONFIG SAVECONFIG_ENABLED_FALSE SAVECONFIG_ENABLED_TRUE LSCF @@ -621,35 +633,59 @@ MAKE_NTPSNMPD SNMP_CFLAGS SNMP_CPPFLAGS SNMP_LIBS +BUILD_SNTP_FALSE +BUILD_SNTP_TRUE +SNTP MAKE_NTPDSIM MAKE_LIBNTPSIM MAKE_TIMETRIM MAKE_TICKADJ MAKE_NTPTIME MAKE_ADJTIMED -CLKTEST CHUTEST PROPDELAY MAKE_PARSEKMODULE DCFD TESTDCF MAKE_CHECK_LAYOUT -EF_LIBS -EF_PROGS -LCRYPTO -OPENSSL_LIB -OPENSSL_INC -OPENSSL +VER_SUFFIX +PKG_CONFIG MAKE_CHECK_Y2K MAKE_LIBPARSE_KERNEL MAKE_LIBPARSE LIBPARSE -HAVE_INLINE -EDITLINE_LIBS +HAVE_RLIMIT_STACK +HAVE_RLIMIT_MEMLOCK +LDADD_NLIST PATH_NET_SNMP_CONFIG +CONFIG_SHELL PATH_TEST -PATH_SH PATH_PERL +LIBOBJS +PTHREADS_FALSE +PTHREADS_TRUE +LIBISC_PTHREADS_NOTHREADS +PTHREAD_LIBS +HAVE_INLINE +ALLOCA +LIBM +EDITLINE_LIBS +LDADD_LIBNTP +NTP_CROSSCOMPILE_FALSE +NTP_CROSSCOMPILE_TRUE +LIBOPTS_DIR +LIBOPTS_CFLAGS +LIBOPTS_LDADD +NEED_LIBOPTS_FALSE +NEED_LIBOPTS_TRUE +INSTALL_LIBOPTS_FALSE +INSTALL_LIBOPTS_TRUE +POSIX_SHELL +GL_GENERATE_STDNORETURN_H_FALSE +GL_GENERATE_STDNORETURN_H_TRUE +STDNORETURN_H +LIBTOOL_DEPS +CXXCPP OTOOL64 OTOOL LIPO @@ -667,25 +703,102 @@ ac_ct_DUMPBIN DUMPBIN LD FGREP -LIBTOOL -NTP_BINSUBDIR_IS_BIN_FALSE -NTP_BINSUBDIR_IS_BIN_TRUE -BINSUBDIR -NTP_CROSSCOMPILE_FALSE -NTP_CROSSCOMPILE_TRUE -LIBOPTS_DIR -LIBOPTS_CFLAGS -LIBOPTS_LDADD -NEED_LIBOPTS_FALSE -NEED_LIBOPTS_TRUE -INSTALL_LIBOPTS_FALSE -INSTALL_LIBOPTS_TRUE -POSIX_SHELL SED +LIBTOOL +TIMETRIM_NI +TIMETRIM_MS +TIMETRIM_DS +TIMETRIM_DL +TIMETRIM_DB +TICKADJ_NI +TICKADJ_MS +TICKADJ_DS +TICKADJ_DL +TICKADJ_DB +SNTP_NI +SNTP_MS +SNTP_DS +SNTP_DL +SNTP_DB +NTP_WAIT_NI +NTP_WAIT_MS +NTP_WAIT_DS +NTP_WAIT_DL +NTP_WAIT_DB +NTP_KEYGEN_NI +NTP_KEYGEN_MS +NTP_KEYGEN_DS +NTP_KEYGEN_DL +NTP_KEYGEN_DB +NTPTRACE_NI +NTPTRACE_MS +NTPTRACE_DS +NTPTRACE_DL +NTPTRACE_DB +NTPTIME_NI +NTPTIME_MS +NTPTIME_DS +NTPTIME_DL +NTPTIME_DB +INSTALL_NTPSWEEP_FALSE +INSTALL_NTPSWEEP_TRUE +NTPSWEEP_NI +NTPSWEEP_MS +NTPSWEEP_DS +NTPSWEEP_DL +NTPSWEEP_DB +NTPSNMPD_NI +NTPSNMPD_MS +NTPSNMPD_DS +NTPSNMPD_DL +NTPSNMPD_DB +NTPQ_NI +NTPQ_MS +NTPQ_DS +NTPQ_DL +NTPQ_DB +NTPD_NI +NTPD_MS +NTPD_DS +NTPD_DL +NTPD_DB +NTPDSIM_NI +NTPDSIM_MS +NTPDSIM_DS +NTPDSIM_DL +NTPDSIM_DB +NTPDC_NI +NTPDC_MS +NTPDC_DS +NTPDC_DL +NTPDC_DB +NTPDATE_NI +NTPDATE_MS +NTPDATE_DS +NTPDATE_DL +NTPDATE_DB +MANTAGFMT +CALC_TICKADJ_NI +CALC_TICKADJ_MS +CALC_TICKADJ_DS +CALC_TICKADJ_DL +CALC_TICKADJ_DB +WANT_CALC_TICKADJ_MS_FALSE +WANT_CALC_TICKADJ_MS_TRUE VPATH_HACK_FALSE VPATH_HACK_TRUE YFLAGS YACC +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +LDFLAGS_NTP +LDADD_NTP +CPPFLAGS_NTP +CFLAGS_NTP EGREP GREP CPP @@ -713,6 +826,8 @@ build_os build_vendor build_cpu build +AM_BACKSLASH +AM_DEFAULT_VERBOSITY am__untar am__tar AMTAR @@ -774,31 +889,46 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' -ac_subst_files='' +ac_subst_files='calc_tickadj_opts +ntp_wait_opts +ntpsweep_opts +ntptrace_opts +summary_opts +plot_summary_opts' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking +with_locfile enable_shared -enable_local_libopts -enable_libopts_install -with_autoopts_config -with_binsubdir -with_arlib -with_rpath enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock -with_net_snmp_config +enable_nls +enable_local_libopts +enable_libopts_install +with_autoopts_config +enable_local_libevent with_lineeditlibs -enable_getifaddrs enable_debugging +enable_thread_support +with_threads +with_yielding_select +enable_c99_snprintf +enable_clockctl +enable_linuxcaps +enable_solarisprivs +with_arlib +with_net_snmp_config +enable_libseccomp +with_stack_limit +with_memlock enable_debug_timing enable_dst_minutes enable_ignore_dns_errors -enable_force_defer_DNS enable_BANCOMM enable_GPSVME enable_all_clocks @@ -825,6 +955,7 @@ enable_LOCAL_CLOCK enable_MX4200 enable_NEOCLOCK4X enable_NMEA +enable_GPSD enable_ONCORE enable_PALISADE enable_PCF @@ -836,6 +967,7 @@ enable_TPRO enable_TRUETIME enable_TT560 enable_ULINK +enable_TSYNCPCI enable_WWV enable_ZYFER enable_parse_clocks @@ -850,15 +982,19 @@ enable_TRIMTAIP enable_TRIMTSIP enable_WHARTON enable_VARITEXT +enable_SEL240X +with_crypto with_openssl_libdir with_openssl_incdir -with_crypto -with_electricfence +with_rpath +enable_openssl_random +enable_autokey enable_kmem enable_accurate_adjtime enable_tick enable_tickadj enable_simulator +with_sntp with_ntpsnmpd enable_slew_always enable_step_slew @@ -869,11 +1005,11 @@ enable_bug1243_fix enable_irig_sawtooth enable_nist enable_ntp_signd -enable_clockctl -enable_linuxcaps enable_ipv6 with_kame +enable_getifaddrs enable_saveconfig +with_gtest ' ac_precious_vars='build_alias host_alias @@ -884,8 +1020,12 @@ LDFLAGS LIBS CPPFLAGS CPP +CXX +CXXFLAGS +CCC YACC -YFLAGS' +YFLAGS +CXXCPP' ac_subdirs_all='sntp' # Initialize some variables set by options. @@ -1428,7 +1568,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.6p5 to adapt to many kinds of systems. +\`configure' configures ntp4 4.2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1476,7 +1616,7 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/ntp] + --docdir=DIR documentation root [DATAROOTDIR/doc/ntp4] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1498,35 +1638,58 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.6p5:";; + short | recursive ) echo "Configuration of ntp4 4.2.8:";; esac cat <<\_ACEOF -Optional Features: +Optional Features and Packages: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors + --with-locfile=XXX os-specific or "legacy" --enable-shared[=PKGS] build shared libraries [default=no] - --enable-local-libopts Force using the supplied libopts tearoff code - --disable-libopts-install - Do not install libopts with client installation --enable-static[=PKGS] build static libraries [default=yes] + --with-pic try to use only PIC/non-PIC objects [default=use + both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --disable-libtool-lock avoid locking (might break parallel builds) - --enable-getifaddrs s Enable the use of getifaddrs() [[yes|no|glibc]]. - glibc: Use getifaddrs() in glibc if you know it - supports IPv6. + --disable-nls disable nls support in libopts + --enable-local-libopts Use the supplied libopts tearoff code + --enable-libopts-install + Install libopts with client installation + --with-autoopts-config specify the config-info script + --enable-local-libevent Force using the supplied libevent tearoff code + --with-lineeditlibs edit,editline (readline may be specified if desired) + defaults: + yes, - no, s system-specific --enable-debugging + include ntpd debugging code + --enable-thread-support s use threads (+ if available) + --with-threads with threads [auto] + --with-yielding-select with yielding select [auto] + --enable-c99-snprintf s force replacement + --enable-clockctl s Use /dev/clockctl for non-root clock control + --enable-linuxcaps + Use Linux capabilities for non-root clock control + --enable-solarisprivs + Use Solaris privileges for non-root clock control + --with-arlib - deprecated, arlib not distributed + --with-net-snmp-config + =net-snmp-config + --enable-libseccomp EXPERIMENTAL: enable support for libseccomp + sandboxing (default is no) + --with-stack-limit ? =50 (200 for openbsd) 4k pages + --with-memlock ? =32 (megabytes) --enable-debug-timing - include processing time debugging code (costs performance) - --enable-dst-minutes n minutes per DST adjustment [60] + --enable-dst-minutes =60 minutes per DST adjustment --enable-ignore-dns-errors - retry DNS queries on any error - --enable-force-defer-DNS - - force all DNS lookups to take the deferred path --enable-BANCOMM - Datum/Bancomm bc635/VME interface --enable-GPSVME - TrueTime GPS receiver/VME interface --enable-all-clocks + include all suitable non-PARSE clocks: @@ -1553,6 +1716,7 @@ Optional Features: --enable-MX4200 s Magnavox MX4200 GPS receiver --enable-NEOCLOCK4X + NeoClock4X DCF77 / TDF receiver --enable-NMEA + NMEA GPS receiver + --enable-GPSD + GPSD JSON receiver --enable-ONCORE s Motorola VP/UT Oncore GPS receiver --enable-PALISADE s Palisade clock --enable-PCF + Conrad parallel port radio clock @@ -1564,6 +1728,7 @@ Optional Features: --enable-TRUETIME s Kinemetrics/TrueTime receivers --enable-TT560 - TrueTime 560 IRIG-B decoder --enable-ULINK + Ultralink WWVB receiver + --enable-TSYNCPCI s Spectracom TSYNC timing board --enable-WWV s WWV Audio receiver --enable-ZYFER + Zyfer GPStarplus receiver --enable-parse-clocks - include all suitable PARSE clocks: @@ -1578,12 +1743,26 @@ Optional Features: --enable-TRIMTSIP s Trimble GPS receiver/TSIP protocol --enable-WHARTON s WHARTON 400A Series clock --enable-VARITEXT s VARITEXT clock + --enable-SEL240X s SEL240X clock + --with-crypto + =openssl,libcrypto + + --with-openssl-libdir + =/something/reasonable + + --with-openssl-incdir + =/something/reasonable + + --without-rpath s Disable auto-added -R linker paths + + --enable-openssl-random Use OpenSSL's crypto random number functions, if + available (default is yes) + --enable-autokey + support NTP Autokey protocol --enable-kmem s read /dev/kmem for tick and/or tickadj --enable-accurate-adjtime s the adjtime() call is accurate --enable-tick=VALUE s force a value for 'tick' --enable-tickadj=VALUE s force a value for 'tickadj' --enable-simulator - build/install the NTPD simulator? + --without-sntp - disable building sntp and sntp/tests + --with-ntpsnmpd s Build ntpsnmpd MIB agent? --enable-slew-always s always slew the time --enable-step-slew s step and slew the time --enable-ntpdate-step s if ntpdate should step the time @@ -1595,32 +1774,12 @@ Optional Features: --enable-nist - if we should enable the NIST lockclock scheme --enable-ntp-signd - Provide support for Samba's signing daemon, =/var/run/ntp_signd - --enable-clockctl s Use /dev/clockctl for non-root clock control - --enable-linuxcaps + Use Linux capabilities for non-root clock control --enable-ipv6 s use IPv6? - --enable-saveconfig + saveconfig mechanism - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-autoopts-config specify the config-info script - --with-binsubdir bin ={bin,sbin} - --with-arlib - deprecated, arlib not distributed - --without-rpath s Disable auto-added -R linker paths - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - --with-net-snmp-config + =net-snmp-config - --with-lineeditlibs edit,editline (readline may be specified if desired) - --with-openssl-libdir + =/something/reasonable - --with-openssl-incdir + =/something/reasonable - --with-crypto + =openssl - --with-electricfence - compile with ElectricFence malloc debugger - --with-ntpsnmpd s Build ntpsnmpd MIB agent? --with-kame - =/usr/local/v6 + --enable-getifaddrs + Enable the use of getifaddrs() [[yes|no]]. + --enable-saveconfig + saveconfig mechanism + --with-gtest Use the gtest framework (Default: if it's available) Some influential environment variables: CC C compiler command @@ -1631,17 +1790,21 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. + CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. +Report bugs to <http://bugs.ntp.org./>. +ntp4 home page: <http://www.ntp.org./>. _ACEOF ac_status=$? fi @@ -1704,7 +1867,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.6p5 +ntp4 configure 4.2.8 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1863,6 +2026,10 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------ ## +## Report this to http://bugs.ntp.org./ ## +## ------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -1999,6 +2166,194 @@ fi } # ac_fn_c_try_link +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2231,72 +2586,51 @@ rm -f conftest.val } # ac_fn_c_compute_int -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case <limits.h> declares $2. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +$4 +int +main () +{ +#ifndef $as_decl_name #ifdef __cplusplus -extern "C" + (void) $as_decl_use; +#else + (void) $as_decl_name; #endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me #endif -int -main () -{ -return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_func +} # ac_fn_c_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- @@ -2358,7 +2692,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.6p5, which was +It was created by ntp4 $as_me 4.2.8, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2638,6 +2972,7 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +as_fn_append ac_header_list " stdarg.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2708,7 +3043,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= -for ac_dir in . "$srcdir"/.; do +for ac_dir in sntp/libevent/build-aux "$srcdir"/sntp/libevent/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -2724,7 +3059,7 @@ for ac_dir in . "$srcdir"/.; do fi done if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in sntp/libevent/build-aux \"$srcdir\"/sntp/libevent/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2737,9 +3072,13 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Increment ntp_configure_cache_version by one for each change to -# configure.ac or .m4 files which invalidates cached values from -# previous versions. + + + + +# Bump ntp_configure_cache_version for each change to configure.ac or +# .m4 files which invalidates cached values from previous configure +# runs. # # If the change affects cache variables used only by the main NTP # configure.ac, then only its version number should be bumped, while @@ -2749,15 +3088,15 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # bumping. # # If a change affects variables shared by all NTP configure scripts, -# please bump the version numbers of all three. If you are not sure, -# the safe choice is to bump all three on any cache-invalidating change. +# please bump the version numbers of each. If you are not sure, the +# safe choice is to bump all on any cache-invalidating change. # # In order to avoid the risk of version stamp collision between -stable # and -dev branches, do not simply increment the version, instead use # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -ntp_configure_cache_version=20091117 +ntp_configure_cache_version=20120806 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. @@ -2795,11 +3134,13 @@ ntp_configure_cache_version=20091117 # Parent configure just created cache from empty, # flushing would be counterproductive. ntp_cache_flush=0; + ;; esac esac ;; *) # configure cache version mismatches config.cache version + ;; esac case "$ntp_cache_flush" in @@ -2836,7 +3177,7 @@ ntp_configure_cache_version=20091117 for c_varname in $c_varname_list do - { eval $c_varname=; unset $c_varname;} + { eval $c_varname=; unset $c_varname; } done { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5 @@ -3297,8 +3638,8 @@ fi # Define the identity of the package. - PACKAGE='ntp' - VERSION='4.2.6p5' + PACKAGE='ntp4' + VERSION='4.2.8' cat >>confdefs.h <<_ACEOF @@ -3338,6 +3679,20 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' + + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -4801,6 +5156,8 @@ done + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes @@ -4821,6 +5178,14 @@ $as_echo "#define _MINIX 1" >>confdefs.h fi + case "$host_os" in + hpux*) + +$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } @@ -4830,8 +5195,8 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# define __EXTENSIONS__ 1 - $ac_includes_default +# define __EXTENSIONS__ 1 + $ac_includes_default int main () { @@ -4861,37 +5226,207 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* -# So far, the only shared library we might use is libopts. -# It's a small library - we might as well use a static version of it. -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - enable_shared=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi @@ -5567,117 +6102,6 @@ fi # Ralf Wildenhues: With per-target flags we need CC_C_O # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC @@ -5693,520 +6117,306 @@ if test "$am_t" != yes; then fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. + ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error +#include <sgtty.h> +Autoconf TIOCGETP _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes else - # Broken: fails on valid input. -continue + ac_cv_prog_gcc_traditional=no fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest* - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <ac_nonexistent.h> +#include <termio.h> +Autoconf TCGETA _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest* -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi fi - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext +CFLAGS_NTP= +CPPFLAGS_NTP= +LDADD_NTP= +LDFLAGS_NTP= -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : + +case "$ac_cv_prog_cc_c89" in + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP + version 4.2.5 and higher." >&5 +$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP + version 4.2.5 and higher." >&2;} + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5 +$as_echo_n "checking if $CC can handle #warning... " >&6; } +if ${ntp_cv_cpp_warning+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } +int +main () +{ +#warning foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_cpp_warning=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ntp_cv_cpp_warning=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5 +$as_echo "$ntp_cv_cpp_warning" >&6; } +case "$ntp_cv_cpp_warning" in + no) +$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h -# 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 -# the selected invocation, such as "gcc --std=gnu99". Also, the -# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC -# does not accept C89. +esac - case $ac_cv_prog_cc_stdc in #( - no) : - ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__((...))" >&5 +$as_echo_n "checking if $CC supports __attribute__((...))... " >&6; } +if ${ntp_cv_cc_attribute+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdarg.h> -#include <stdbool.h> -#include <stdlib.h> -#include <wchar.h> -#include <stdio.h> -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) +int +main () { - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; +void foo(void) __attribute__((__noreturn__)); -struct incomplete_array -{ - int datasize; - double data[]; -}; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_cc_attribute=yes +else + ntp_cv_cc_attribute=no -struct named_init { - int number; - const wchar_t *name; - double average; -}; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -typedef const char *ccp; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cc_attribute" >&5 +$as_echo "$ntp_cv_cc_attribute" >&6; } +case "$ntp_cv_cc_attribute" in + yes) -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} +$as_echo "#define HAVE___ATTRIBUTE__ /**/" >>confdefs.h -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); +esac - const char *str; - int number; - float fnumber; - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} +case "$GCC" in + yes) + SAVED_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wstrict-overflow" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5 +$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; } +if ${ntp_cv_gcc_Wstrict_overflow+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ int main () { - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_gcc_Wstrict_overflow=yes +else + ntp_cv_gcc_Wstrict_overflow=no - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ni.number = 58; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5 +$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; } + # + # $ntp_cv_gcc_Wstrict_overflow is tested later to add the + # flag to CFLAGS. + # + CFLAGS="$SAVED_CFLAGS -Winit-self" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5 +$as_echo_n "checking if $CC can handle -Winit-self... " >&6; } +if ${ntp_cv_gcc_Winit_self+:} false; then : + $as_echo_n "(cached) " >&6 +else - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); +int +main () +{ ; return 0; } _ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_gcc_Winit_self=yes +else + ntp_cv_gcc_Winit_self=no + fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5 +$as_echo "$ntp_cv_gcc_Winit_self" >&6; } + CFLAGS="$SAVED_CFLAGS" + { SAVED_CFLAGS=; unset SAVED_CFLAGS;} + # + # $ntp_cv_gcc_Winit_self is tested later to add the + # flag to CFLAGS_NTP. + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5 +$as_echo_n "checking if linker supports omitting unused code and data... " >&6; } +if ${ntp_cv_gc_sections_runs+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + origCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wl,--gc-sections" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + #include <stdlib.h> + #include <stdio.h> -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + + FILE * fpC; + char buf[32]; + size_t cch; + int read_success_once; + + fpC = fopen("conftest.c", "r"); + if (NULL == fpC) + exit(1); + do { + cch = fread(buf, sizeof(buf), 1, fpC); + read_success_once |= (0 != cch); + } while (0 != cch); + if (!read_success_once) + exit(2); + if (!feof(fpC)) + exit(3); + if (0 != fclose(fpC)) + exit(4); + + exit(EXIT_SUCCESS); + + ; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC +if ac_fn_c_try_link "$LINENO"; then : + + if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then + ntp_cv_gc_sections_runs=no + else + ntp_cv_gc_sections_runs=no + ./conftest >/dev/null 2>&1 && ntp_cv_gc_sections_runs=yes + fi -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else - ac_cv_prog_cc_stdc=no -fi + ntp_cv_gc_sections_runs=no fi - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 -$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } - if ${ac_cv_prog_cc_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -fi - - case $ac_cv_prog_cc_stdc in #( - no) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; #( - '') : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 -$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; -esac +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$origCFLAGS" + { origCFLAGS=; unset origCFLAGS;} -case "$ac_cv_prog_cc_stdc" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP - version 4.2.5 and higher." >&5 -$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP - version 4.2.5 and higher." >&2;} -esac - -# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS -case "$host" in - *-pc-cygwin*) - CFLAGS="$CFLAGS -DSYS_CYGWIN32" - ;; - i386-sequent-sysv4) - case "$CC" in - cc) - CFLAGS="$CFLAGS -Wc,+abi-socket" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gc_sections_runs" >&5 +$as_echo "$ntp_cv_gc_sections_runs" >&6; } + case "$ntp_cv_gc_sections_runs" in + yes) + LDADD_LIBNTP="-Wl,--gc-sections" + CFLAGS_NTP="$CFLAGS_NTP -ffunction-sections -fdata-sections" + ;; + no) + LDADD_LIBNTP= ;; esac - ;; - *-*-mpeix*) - CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB" - LDFLAGS="$LDFLAGS -L/SYSLOG/PUB" - LIBS="$LIBS -lcurses" - ;; - *-*-solaris*) - # see "man standards". - # -D_XOPEN_SOURCE=500 is probably OK for c89 and before - # -D_XOPEN_SOURCE=600 seems OK for c99 - #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" - libxnet=-lxnet - ;; + CFLAGS_NTP="$CFLAGS_NTP -Wall" + CFLAGS_NTP="$CFLAGS_NTP -Wcast-align" + CFLAGS_NTP="$CFLAGS_NTP -Wcast-qual" + # CFLAGS_NTP="$CFLAGS_NTP -Wconversion" + # CFLAGS_NTP="$CFLAGS_NTP -Werror" + # CFLAGS_NTP="$CFLAGS_NTP -Wextra" + # CFLAGS_NTP="$CFLAGS_NTP -Wfloat-equal" + CFLAGS_NTP="$CFLAGS_NTP -Wmissing-prototypes" + CFLAGS_NTP="$CFLAGS_NTP -Wpointer-arith" + CFLAGS_NTP="$CFLAGS_NTP -Wshadow" + # CFLAGS_NTP="$CFLAGS_NTP -Wtraditional" + # CFLAGS_NTP="$CFLAGS_NTP -Wwrite-strings" + case "$ntp_cv_gcc_Winit_self" in + yes) + CFLAGS_NTP="$CFLAGS_NTP -Winit-self" + esac + case "$ntp_cv_gcc_Wstrict_overflow" in + yes) + CFLAGS_NTP="$CFLAGS_NTP -Wstrict-overflow" + esac + # -W[no-]strict-prototypes might be added by NTP_OPENSSL esac @@ -6217,7 +6427,7 @@ $as_echo_n "checking additional compiler flags... " >&6; } set) ;; *) - ntp_os_cflags="" + ntp_os_cflags= case "$host_os" in aix[1-3]*) ;; @@ -6231,8 +6441,13 @@ $as_echo_n "checking additional compiler flags... " >&6; } ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT" ;; aix*) + # XXX Only verified thru AIX6. + # aix7 seems to need a different XOPEN_SOURCE_EXTENDED thing. # avoid circular dependencies in yp headers - ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE" + # _XOPEN_SOURCE=500 = X/Open 5: POSIX 1995 + # _XOPEN_SOURCE=600 = X/Open 6: POSIX 2004 + # _XOPEN_SOURCE=700 = X/Open 7: POSIX 2008 + ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_SOURCE=600" ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS" ;; amigaos) @@ -6301,1703 +6516,1282 @@ $as_echo_n "checking additional compiler flags... " >&6; } ;; *) ntp_os_cflags_msg="$ntp_os_cflags" - CFLAGS="$CFLAGS $ntp_os_cflags" esac + CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_cflags_msg" >&5 $as_echo "$ntp_os_cflags_msg" >&6; } { ntp_os_cflags_msg=; unset ntp_os_cflags_msg;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5 -$as_echo_n "checking for directory path separator... " >&6; } -if ${ntp_cv_dir_sep+:} false; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; - case "$ntp_cv_dir_sep" in - '') - case "$target_os" in - *djgpp | *mingw32* | *emx*) - ntp_cv_dir_sep="'\\'" - ;; - *) - ntp_cv_dir_sep="'/'" - ;; - esac - esac - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5 -$as_echo "$ntp_cv_dir_sep" >&6; } - -cat >>confdefs.h <<_ACEOF -#define DIR_SEP $ntp_cv_dir_sep _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need a VPATH hack" >&5 -$as_echo_n "checking to see if we need a VPATH hack... " >&6; } -ntp_vpath_hack="no" -case "$srcdir::$build_os::${force_ntp_vpath_hack+set}" in - .::*::*) - ;; - *::*::set) - ntp_vpath_hack="yes" - ;; - *::freebsd*::) - case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in - '') - ntp_vpath_hack="yes" - esac -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5 -$as_echo "$ntp_vpath_hack" >&6; } - if test x$ntp_vpath_hack = xyes; then - VPATH_HACK_TRUE= - VPATH_HACK_FALSE='#' -else - VPATH_HACK_TRUE='#' - VPATH_HACK_FALSE= + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif - -# NTP has (so far) been relying on leading-edge autogen. -# Therefore, by default: -# - use the version we ship with -# - do not install it -# - build a static copy (AC_DISABLE_SHARED - done earlier) -case "${enable_local_libopts+set}" in - set) ;; - *) enable_local_libopts=yes ;; -esac -case "${enable_libopts_install+set}" in - set) ;; - *) enable_libopts_install=no ;; -esac -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int + ; + return 0; +} _ACEOF - -fi - - - - ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> -#include <$ac_hdr> + #include <sys/param.h> int main () { -if ((DIR *) 0) -return 0; +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" + ac_cv_c_bigendian=yes else - eval "$as_ac_Header=no" + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> -ac_header_dirent=$ac_hdr; break -fi +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <limits.h> -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); int main () { -return opendir (); +#ifndef _BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS + ac_cv_c_bigendian=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); int main () { -return opendir (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi -done -if ${ac_cv_search_opendir+:} false; then : - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; - # ================= - # AC_CHECK_HEADERS - # ================= - for ac_header in \ - dlfcn.h errno.h fcntl.h libgen.h \ - memory.h netinet/in.h setjmp.h sys/mman.h \ - sys/param.h sys/poll.h sys/procset.h sys/select.h \ - sys/socket.h sys/stropts.h sys/time.h sys/un.h \ - sys/wait.h unistd.h utime.h sysexits.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + ; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -done +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac - for ac_header in stdarg.h varargs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - lo_have_arg_hdr=true;break +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } +if ${ac_cv_c_volatile+:} false; then : + $as_echo_n "(cached) " >&6 else - lo_have_arg_hdr=false -fi - -done + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ - for ac_header in string.h strings.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; + ; + return 0; +} _ACEOF - lo_have_str_hdr=true;break +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_volatile=yes else - lo_have_str_hdr=false + ac_cv_c_volatile=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +$as_echo "$ac_cv_c_volatile" >&6; } +if test $ac_cv_c_volatile = no; then -done +$as_echo "#define volatile /**/" >>confdefs.h +fi - for ac_header in limits.h sys/limits.h values.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF - lo_have_lim_hdr=true;break +if ac_fn_c_try_cpp "$LINENO"; then : + else - lo_have_lim_hdr=false + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -done - - - for ac_header in inttypes.h stdint.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> _ACEOF - lo_have_typ_hdr=true;break +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - lo_have_typ_hdr=false + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext done - - - # ---------------------------------------------------------------------- - # check for various programs used during the build. - # On OS/X, "wchar.h" needs "runetype.h" to work properly. - # ---------------------------------------------------------------------- - for ac_header in runetype.h wchar.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " - $ac_includes_default - #if HAVE_RUNETYPE_H - # include <runetype.h> - #endif - -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi -done - - - # -------------------------------------------- - # Verify certain entries from AC_CHECK_HEADERS - # -------------------------------------------- - for f in sys_types sys_mman sys_param sys_stat sys_wait \ - string errno stdlib memory setjmp - do eval as_ac_var=\${ac_cv_header_${f}_h+set} - test "${as_ac_var}" = set || { - as_fn_error $? "You must have ${f}.h on your system" "$LINENO" 5 - } - done - - ${lo_have_arg_hdr} || \ - as_fn_error $? "You must have stdarg.h or varargs.h on your system" "$LINENO" 5 - - ${lo_have_str_hdr} || \ - as_fn_error $? "You must have string.h or strings.h on your system" "$LINENO" 5 - - ${lo_have_lim_hdr} || \ - as_fn_error $? "You must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5 - - ${lo_have_typ_hdr} || \ - as_fn_error $? "You must have inttypes.h or stdint.h on your system" "$LINENO" 5 - - # ---------------------------------------------------------------------- - # Checks for typedefs - # ---------------------------------------------------------------------- - ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default" -if test "x$ac_cv_type_wchar_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF - + done + ac_cv_prog_CPP=$CPP fi - - ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" " - $ac_includes_default - #if HAVE_RUNETYPE_H - # include <runetype.h> - #endif - #if HAVE_WCHAR_H - # include <wchar.h> - #endif - -" -if test "x$ac_cv_type_wint_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_WINT_T 1 -_ACEOF - - + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP fi - - ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" -if test "x$ac_cv_type_int8_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT8_T 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - +else + # Broken: fails on valid input. +continue fi -ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" -if test "x$ac_cv_type_uint8_t" = xyes; then : +rm -f conftest.err conftest.i conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT8_T 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> _ACEOF - - +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi -ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" -if test "x$ac_cv_type_int16_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT16_T 1 -_ACEOF +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi -ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" -if test "x$ac_cv_type_uint16_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT16_T 1 -_ACEOF - -fi -ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" -if test "x$ac_cv_type_int32_t" = xyes; then : +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -cat >>confdefs.h <<_ACEOF -#define HAVE_INT32_T 1 -_ACEOF +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi -ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" -if test "x$ac_cv_type_uint32_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT32_T 1 +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - +else + # Broken: fails on valid input. +continue fi -ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" -if test "x$ac_cv_type_intptr_t" = xyes; then : +rm -f conftest.err conftest.i conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_INTPTR_T 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> _ACEOF - - +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi -ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi -ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" -if test "x$ac_cv_type_uint_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT_T 1 -_ACEOF + done + ac_cv_prog_CPP=$CPP fi -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_PID_T 1 -_ACEOF - - + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP fi -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_SIZE_T 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF - - -fi - - - # ===== - # sizes - # ===== - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5 -$as_echo_n "checking size of char*... " >&6; } -if ${ac_cv_sizeof_charp+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp" "$ac_includes_default"; then : +if ac_fn_c_try_cpp "$LINENO"; then : else - if test "$ac_cv_type_charp" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (char*) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_charp=0 - fi -fi - + # Broken: fails on valid input. +continue fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5 -$as_echo "$ac_cv_sizeof_charp" >&6; } - - +rm -f conftest.err conftest.i conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHARP $ac_cv_sizeof_charp + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> _ACEOF - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi -fi - + # Passes both tests. +ac_preproc_ok=: +break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - +rm -f conftest.err conftest.i conftest.$ac_ext - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : - + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_short=0 - fi -fi +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # ---------------------------------------------------------------------- - # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind. - # ---------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5 -$as_echo_n "checking for pathfind in -lgen... " >&6; } -if ${ac_cv_lib_gen_pathfind+:} false; then : + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgen $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pathfind (); -int -main () -{ -return pathfind (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gen_pathfind=yes + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else - ac_cv_lib_gen_pathfind=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5 -$as_echo "$ac_cv_lib_gen_pathfind" >&6; } -if test "x$ac_cv_lib_gen_pathfind" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGEN 1 -_ACEOF - - LIBS="-lgen $LIBS" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - - for ac_func in vprintf -do : - ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 -_ACEOF - -ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = xyes; then : - -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h - fi - +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -done - for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF - -fi - + test -n "$ac_ct_CXX" && break done -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + fi fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } done -if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - ac_cv_func_fork_works=cross -else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + int main () { - - /* By Ruediger Kuhlmann. */ - return fork () < 0; +#ifndef __GNUC__ + choke me +#endif ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_fork_works=yes +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - ac_cv_func_fork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_compiler_gnu=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes else - ac_cv_func_fork_works=$ac_cv_func_fork + GXX= fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - ac_cv_func_vfork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Thanks to Paul Eggert for this test. */ -$ac_includes_default -#include <sys/wait.h> -#ifdef HAVE_VFORK_H -# include <vfork.h> -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include <vfork.h>, but some compilers - (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static void -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} int main () { - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (0); - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; +int +main () +{ - while (wait(&status) != child) - ; - return ( - /* Was there some problem with vforking? */ - child < 0 + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : - /* Did the child fail? (This shouldn't happen.) */ - || status +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - /* Did the vfork/compiler bug occur? */ - || parent != getpid() +int +main () +{ - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } + ; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_vfork_works=yes -else - ac_cv_func_vfork_works=no +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "x$ac_cv_func_vfork_works" = xyes; then - -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h +depcc="$CXX" am_compiler_list= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -$as_echo "#define vfork fork" >>confdefs.h + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac -fi -if test "x$ac_cv_func_fork_works" = xyes; then + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none fi - for ac_func in mmap canonicalize_file_name snprintf strdup strchr \ - strrchr strsignal -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } else - ac_cv_path_SED=$SED + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - while : - do - POSIX_SHELL=`which bash` - test -x "$POSIX_SHELL" && break - POSIX_SHELL=`which dash` - test -x "$POSIX_SHELL" && break - POSIX_SHELL=/usr/xpg4/bin/sh - test -x "$POSIX_SHELL" && break - POSIX_SHELL=`/bin/sh -c ' - exec 2>/dev/null - if ! true ; then exit 1 ; fi - echo /bin/sh'` - test -x "$POSIX_SHELL" && break - as_fn_error $? "Cannot locate a working POSIX shell" "$LINENO" 5 - done +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define POSIX_SHELL "${POSIX_SHELL}" + ; + return 0; +} _ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h +fi - LIBOPTS_BUILD_BLOCKED=true +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5 +$as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; } +ntp_vpath_hack="no" +case "$srcdir::${force_ntp_vpath_hack-no}" in + .::*) + ;; # VPATH_HACK path is for VPATH builds only. + *::yes) + ntp_vpath_hack="yes" + ;; + *::*) + case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in + '') + ntp_vpath_hack="yes" + esac +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5 +$as_echo "$ntp_vpath_hack" >&6; } + if test x$ntp_vpath_hack = xyes; then + VPATH_HACK_TRUE= + VPATH_HACK_FALSE='#' +else + VPATH_HACK_TRUE='#' + VPATH_HACK_FALSE= +fi - NEED_LIBOPTS_DIR='' - # Check whether --enable-local-libopts was given. -if test "${enable_local_libopts+set}" = set; then : - enableval=$enable_local_libopts; - if test x$enableval = xyes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5 -$as_echo "$as_me: Using supplied libopts tearoff" >&6;} - LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la' - LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts' - NEED_LIBOPTS_DIR=true - fi -fi - # Check whether --enable-libopts-install was given. -if test "${enable_libopts_install+set}" = set; then : - enableval=$enable_libopts_install; -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install dir and man conventions" >&5 +$as_echo_n "checking for install dir and man conventions... " >&6; } - if test "X${enable_libopts_install}" != Xno; then - INSTALL_LIBOPTS_TRUE= - INSTALL_LIBOPTS_FALSE='#' + +# Check whether --with-locfile was given. +if test "${with_locfile+set}" = set; then : + withval=$with_locfile; else - INSTALL_LIBOPTS_TRUE='#' - INSTALL_LIBOPTS_FALSE= + with_locfile=no + fi - if test -z "${NEED_LIBOPTS_DIR}" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5 -$as_echo_n "checking whether autoopts-config can be found... " >&6; } +( \ + SENTINEL_DIR="$PWD" && \ + cd $srcdir/sntp && \ + case "$with_locfile" in \ + yes|no|'') \ + scripts/genLocInfo -d "$SENTINEL_DIR" \ + ;; \ + *) \ + scripts/genLocInfo -d "$SENTINEL_DIR" -f "$with_locfile" \ + ;; \ + esac \ +) > genLocInfo.i 2> genLocInfo.err +. ./genLocInfo.i -# Check whether --with-autoopts-config was given. -if test "${with_autoopts_config+set}" = set; then : - withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5 -$as_echo_n "checking whether autoopts-config is specified... " >&6; } -if ${lo_cv_with_autoopts_config+:} false; then : - $as_echo_n "(cached) " >&6 +case "$GENLOCINFO" in + OK) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in file $GENLOCINFOFILE" >&5 +$as_echo "in file $GENLOCINFOFILE" >&6; } + rm genLocInfo.err genLocInfo.i + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed." >&5 +$as_echo "failed." >&6; } + as_fn_error $? "Problem with genLocInfo!" "$LINENO" 5 + ;; +esac + + if test "$CALC_TICKADJ_MS" ; then + WANT_CALC_TICKADJ_MS_TRUE= + WANT_CALC_TICKADJ_MS_FALSE='#' else - if autoopts-config --help 2>/dev/null 1>&2 - then lo_cv_with_autoopts_config=autoopts-config - elif libopts-config --help 2>/dev/null 1>&2 - then lo_cv_with_autoopts_config=libopts-config - else lo_cv_with_autoopts_config=no ; fi + WANT_CALC_TICKADJ_MS_TRUE='#' + WANT_CALC_TICKADJ_MS_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5 -$as_echo "$lo_cv_with_autoopts_config" >&6; } -fi - # end of AC_ARG_WITH - if ${lo_cv_test_autoopts+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "${lo_cv_with_autoopts_config}" \ - -o X"${lo_cv_with_autoopts_config}" = Xno - then - if autoopts-config --help 2>/dev/null 1>&2 - then lo_cv_with_autoopts_config=autoopts-config - elif libopts-config --help 2>/dev/null 1>&2 - then lo_cv_with_autoopts_config=libopts-config - else lo_cv_with_autoopts_config=false ; fi - fi - lo_cv_test_autoopts=` - ${lo_cv_with_autoopts_config} --libs` 2> /dev/null - if test $? -ne 0 -o -z "${lo_cv_test_autoopts}" - then lo_cv_test_autoopts=no ; fi -fi - # end of CACHE_VAL - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5 -$as_echo "${lo_cv_test_autoopts}" >&6; } - if test "X${lo_cv_test_autoopts}" != Xno - then - LIBOPTS_LDADD="${lo_cv_test_autoopts}" - LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`" - else - LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la' - LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts' - NEED_LIBOPTS_DIR=true - fi - fi # end of if test -z "${NEED_LIBOPTS_DIR}" - if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then - NEED_LIBOPTS_DIR='' - fi - if test -n "${NEED_LIBOPTS_DIR}"; then - NEED_LIBOPTS_TRUE= - NEED_LIBOPTS_FALSE='#' -else - NEED_LIBOPTS_TRUE='#' - NEED_LIBOPTS_FALSE= -fi - LIBOPTS_DIR=sntp/libopts -# end of AC_DEFUN of LIBOPTS_CHECK_COMMON - # end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF -fi -done -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done -if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_fork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - /* By Ruediger Kuhlmann. */ - return fork () < 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_fork_works=yes -else - ac_cv_func_fork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } -else - ac_cv_func_fork_works=$ac_cv_func_fork -fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_vfork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Thanks to Paul Eggert for this test. */ -$ac_includes_default -#include <sys/wait.h> -#ifdef HAVE_VFORK_H -# include <vfork.h> -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include <vfork.h>, but some compilers - (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static void -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} -int -main () -{ - pid_t parent = getpid (); - pid_t child; - sparc_address_test (0); - child = vfork (); - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - while (wait(&status) != child) - ; - return ( - /* Was there some problem with vforking? */ - child < 0 - /* Did the child fail? (This shouldn't happen.) */ - || status - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_vfork_works=yes -else - ac_cv_func_vfork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} -fi -if test "x$ac_cv_func_vfork_works" = xyes; then -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h -else -$as_echo "#define vfork fork" >>confdefs.h -fi -if test "x$ac_cv_func_fork_works" = xyes; then -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5 -$as_echo_n "checking if $CC can handle #warning... " >&6; } -if ${ntp_cv_cpp_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ -#warning foo - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_cpp_warning=yes + if test -z "$NTPSWEEP_NI" ; then + INSTALL_NTPSWEEP_TRUE= + INSTALL_NTPSWEEP_FALSE='#' else - ntp_cv_cpp_warning=no - + INSTALL_NTPSWEEP_TRUE='#' + INSTALL_NTPSWEEP_FALSE= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5 -$as_echo "$ntp_cv_cpp_warning" >&6; } -case "$ntp_cv_cpp_warning" in - no) -$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h -esac -case "$GCC" in - yes) - SAVED_CFLAGS_NTP="$CFLAGS" - CFLAGS="$CFLAGS -Wstrict-overflow" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5 -$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; } -if ${ntp_cv_gcc_Wstrict_overflow+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_gcc_Wstrict_overflow=yes -else - ntp_cv_gcc_Wstrict_overflow=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5 -$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; } - # - # $ntp_cv_gcc_Wstrict_overflow is tested later to add the - # flag to CFLAGS. - # - CFLAGS="$SAVED_CFLAGS_NTP -Winit-self" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5 -$as_echo_n "checking if $CC can handle -Winit-self... " >&6; } -if ${ntp_cv_gcc_Winit_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_gcc_Winit_self=yes -else - ntp_cv_gcc_Winit_self=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5 -$as_echo "$ntp_cv_gcc_Winit_self" >&6; } - CFLAGS="$SAVED_CFLAGS_NTP" - { SAVED_CFLAGS_NTP=; unset SAVED_CFLAGS_NTP;} - # - # $ntp_cv_gcc_Winit_self is tested later to add the - # flag to CFLAGS. - # -esac -# Expose a cross-compilation indicator to makefiles - if test $build != $host; then - NTP_CROSSCOMPILE_TRUE= - NTP_CROSSCOMPILE_FALSE='#' -else - NTP_CROSSCOMPILE_TRUE='#' - NTP_CROSSCOMPILE_FALSE= -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bin subdirectory" >&5 -$as_echo_n "checking for bin subdirectory... " >&6; } -# Check whether --with-binsubdir was given. -if test "${with_binsubdir+set}" = set; then : - withval=$with_binsubdir; use_binsubdir="$withval" -else - use_binsubdir="bin" -fi -case "$use_binsubdir" in - bin) - ;; - sbin) - ;; - *) - as_fn_error $? "<$use_binsubdir> is illegal - must be \"bin\" or \"sbin\"" "$LINENO" 5 - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_binsubdir" >&5 -$as_echo "$use_binsubdir" >&6; } -BINSUBDIR=$use_binsubdir - if test "bin" = "$BINSUBDIR"; then - NTP_BINSUBDIR_IS_BIN_TRUE= - NTP_BINSUBDIR_IS_BIN_FALSE='#' -else - NTP_BINSUBDIR_IS_BIN_TRUE='#' - NTP_BINSUBDIR_IS_BIN_FALSE= -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5 -$as_echo_n "checking for deprecated --with-arlib... " >&6; } -# Check whether --with-arlib was given. -if test "${with_arlib+set}" = set; then : - withval=$with_arlib; ans=$withval -else - ans=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } -case "$ans" in - yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&5 -$as_echo "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&2;} -esac -# Check whether --with-rpath was given. -if test "${with_rpath+set}" = set; then : - withval=$with_rpath; ans=$withval -else - ans=x -fi -case "$ans" in - no) - need_dash_r= - ;; - yes) - need_dash_r=1 - ;; -esac -# HMS: Why isn't this $build? -# Well, that depends on if we need this for the build toolchain or -# for info in the host executable... -# I still have no idea which way this should go, but nobody has complained. -case "$host" in - *-*-netbsd*) - case "$need_dash_r" in - no) ;; - *) need_dash_r=1 - ;; - esac - ;; - *-*-solaris*) - case "$need_dash_r" in - no) ;; - *) need_dash_r=1 - ;; - esac - ;; -esac -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - test -n "$AWK" && break -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi -rm -f conftest* -case "$GCC" in - yes) - CFLAGS="$CFLAGS -Wall" - # CFLAGS="$CFLAGS -Wcast-align" - CFLAGS="$CFLAGS -Wcast-qual" - # CFLAGS="$CFLAGS -Wconversion" - # CFLAGS="$CFLAGS -Werror" - # CFLAGS="$CFLAGS -Wextra" - # CFLAGS="$CFLAGS -Wfloat-equal" - CFLAGS="$CFLAGS -Wmissing-prototypes" - CFLAGS="$CFLAGS -Wpointer-arith" - CFLAGS="$CFLAGS -Wshadow" - # CFLAGS="$CFLAGS -Wtraditional" - # CFLAGS="$CFLAGS -Wwrite-strings" - case "$ntp_cv_gcc_Winit_self" in - yes) - CFLAGS="$CFLAGS -Winit-self" - esac - case "$ntp_cv_gcc_Wstrict_overflow" in - yes) - CFLAGS="$CFLAGS -Wstrict-overflow" + + +# So far, the only shared library we might use is libopts. +# It's a small library - we might as well use a static version of it. +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; esac - # -W[no-]strict-prototypes is added later depending on OpenSSL -esac +else + enable_shared=no +fi + + -ac_busted_vpath_in_make=no -case "$build" in - *-*-irix6.1*) # 64 bit only - # busted vpath? - ;; - *-*-irix6*) # 6.2 (and later?) - ac_busted_vpath_in_make=yes - ;; - *-*-solaris2.5.1) - ac_busted_vpath_in_make=yes - ;; - *-*-unicosmp*) - ac_busted_vpath_in_make=yes - ;; -esac -case "$ac_busted_vpath_in_make$srcdir" in - no*) ;; - yes.) ;; - *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in - '') - as_fn_error $? "building outside of the main directory requires GNU make" "$LINENO" 5 - ;; - *) ;; - esac - ;; -esac @@ -11081,6 +10875,17 @@ done +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + + + # Set options @@ -15011,83 +14816,533 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + done + ac_cv_prog_CXXCPP=$CXXCPP +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext - ac_config_commands="$ac_config_commands libtool" +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + # ltmain only uses $CC for tagged configurations so make sure $CC is set. -# Only expand once: -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + with_gnu_ld=no fi -if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sgtty.h> -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" else - ac_cv_prog_gcc_traditional=no + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <termio.h> -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* - fi +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if ${ac_cv_c_volatile+:} false; then : + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15097,298 +15352,2756 @@ int main () { -volatile int x; -int * volatile y = (int *) 0; -return !x && !y; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_volatile=yes -else - ac_cv_c_volatile=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } -if test $ac_cv_c_volatile = no; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi -$as_echo "#define volatile /**/" >>confdefs.h +fi + aix_libpath=$lt_cv_aix_libpath__CXX fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 -$as_echo_n "checking for library containing strerror... " >&6; } -if ${ac_cv_search_strerror+:} false; then : + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strerror (); int main () { -return strerror (); + ; return 0; } _ACEOF -for ac_lib in '' cposix; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_strerror+:} false; then : - break -fi -done -if ${ac_cv_search_strerror+:} false; then : + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi -else - ac_cv_search_strerror=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 -$as_echo "$ac_cv_search_strerror" >&6; } -ac_res=$ac_cv_search_strerror -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + aix_libpath=$lt_cv_aix_libpath__CXX fi + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PATH_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATH_PERL="$PATH_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PATH_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' fi -done + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac done -IFS=$as_save_IFS + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi -PATH_PERL=$ac_cv_path_PATH_PERL -if test -n "$PATH_PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5 -$as_echo "$PATH_PERL" >&6; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* -# Extract the first word of "sh", so it can be a program name with args. -set dummy sh; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_SH+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - case $PATH_SH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATH_SH="$PATH_SH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PATH_SH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" - ;; -esac fi -PATH_SH=$ac_cv_path_PATH_SH -if test -n "$PATH_SH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_SH" >&5 -$as_echo "$PATH_SH" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + lt_prog_compiler_static_CXX= fi -# Extract the first word of "test", so it can be a program name with args. -set dummy test; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_TEST+:} false; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - case $PATH_TEST in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATH_TEST="$PATH_TEST" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PATH_TEST="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - ;; -esac fi -PATH_TEST=$ac_cv_path_PATH_TEST -if test -n "$PATH_TEST"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5 -$as_echo "$PATH_TEST" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } -# Check whether --with-net-snmp-config was given. -if test "${with_net_snmp_config+set}" = set; then : - withval=$with_net_snmp_config; ans=$withval +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi else - ans=yes + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac -case "$ans" in - no) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; - yes) - ans=net-snmp-config + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; - /*) + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' ;; - */*) - as_fn_error $? "--with-net-snmp-config takes either a name or an absolute path" "$LINENO" 5 + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; - *) + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; -esac -PROG_NET_SNMP_CONFIG=$ans -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5 -$as_echo_n "checking for net-snmp-config path... " >&6; } -case "$PROG_NET_SNMP_CONFIG" in - no) ;; - /*) - PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes ;; - *) - # Extract the first word of "$PROG_NET_SNMP_CONFIG", so it can be a program name with args. -set dummy $PROG_NET_SNMP_CONFIG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_NET_SNMP_CONFIG+:} false; then : + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else - case $PATH_NET_SNMP_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATH_NET_SNMP_CONFIG="$PATH_NET_SNMP_CONFIG" # Let the user override the test with a path. + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PATH_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' fi -done - done -IFS=$as_save_IFS + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -PATH_NET_SNMP_CONFIG=$ac_cv_path_PATH_NET_SNMP_CONFIG -if test -n "$PATH_NET_SNMP_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 -$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 -$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } -case "$host" in - *-*-vxworks*) - ac_link="$ac_link $VX_KERNEL" - ;; + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +# NTP has (so far) been relying on leading-edge autogen, which +# means we need the appropriate corresponding libopts as well. +# Therefore, by default: +# - use the version of libopts we ship with +# - do not install it +# - build a static copy (AC_DISABLE_SHARED - done earlier) +case "${enable_local_libopts+set}" in + set) ;; + *) enable_local_libopts=yes ;; esac +case "${enable_libopts_install+set}" in + set) ;; + *) enable_libopts_install=no ;; +esac +enable_nls=no +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF +fi -ac_fn_c_check_func "$LINENO" "gethostent" "ac_cv_func_gethostent" -if test "x$ac_cv_func_gethostent" = xyes; then : + ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 -$as_echo_n "checking for library containing gethostent... " >&6; } -if ${ac_cv_search_gethostent+:} false; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -15401,56 +18114,51 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char gethostent (); +char opendir (); int main () { -return gethostent (); +return opendir (); ; return 0; } _ACEOF -for ac_lib in '' nsl; do +for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib - LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS" + LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gethostent=$ac_res + ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_gethostent+:} false; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if ${ac_cv_search_gethostent+:} false; then : +if ${ac_cv_search_opendir+:} false; then : else - ac_cv_search_gethostent=no + ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 -$as_echo "$ac_cv_search_gethostent" >&6; } -ac_res=$ac_cv_search_gethostent +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -fi - -ac_fn_c_check_func "$LINENO" "openlog" "ac_cv_func_openlog" -if test "x$ac_cv_func_openlog" = xyes; then : - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 -$as_echo_n "checking for library containing openlog... " >&6; } -if ${ac_cv_search_openlog+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -15463,16 +18171,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char openlog (); +char opendir (); int main () { -return openlog (); +return opendir (); ; return 0; } _ACEOF -for ac_lib in '' gen; do +for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else @@ -15480,95 +18188,521 @@ for ac_lib in '' gen; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_openlog=$ac_res + ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_openlog+:} false; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if ${ac_cv_search_openlog+:} false; then : +if ${ac_cv_search_opendir+:} false; then : else - ac_cv_search_openlog=no + ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 -$as_echo "$ac_cv_search_openlog" >&6; } -ac_res=$ac_cv_search_openlog +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi + +fi + + + # ================= + # AC_CHECK_HEADERS + # ================= + for ac_header in \ + sys/mman.h sys/param.h sys/poll.h sys/procset.h \ + sys/select.h sys/socket.h sys/stropts.h sys/time.h \ + sys/un.h sys/wait.h dlfcn.h errno.h \ + fcntl.h libgen.h libintl.h memory.h \ + netinet/in.h setjmp.h stdbool.h sysexits.h \ + unistd.h utime.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + for ac_header in stdarg.h varargs.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + lo_have_arg_hdr=true;break else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 -$as_echo_n "checking for library containing openlog... " >&6; } -if ${ac_cv_search_openlog+:} false; then : + lo_have_arg_hdr=false +fi + +done + + + for ac_header in string.h strings.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + lo_have_str_hdr=true;break +else + lo_have_str_hdr=false +fi + +done + + + for ac_header in limits.h sys/limits.h values.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + lo_have_lim_hdr=true;break +else + lo_have_lim_hdr=false +fi + +done + + + for ac_header in inttypes.h stdint.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + lo_have_typ_hdr=true;break +else + lo_have_typ_hdr=false +fi + +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdnoreturn.h" >&5 +$as_echo_n "checking for working stdnoreturn.h... " >&6; } +if ${gl_cv_header_working_stdnoreturn_h+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <stdlib.h> + #include <stdnoreturn.h> + /* Do not check for 'noreturn' after the return type. + C11 allows it, but it's rarely done that way + and circa-2012 bleeding-edge GCC rejects it when given + -Werror=old-style-declaration. */ + noreturn void foo1 (void) { exit (0); } + _Noreturn void foo2 (void) { exit (0); } + int testit (int argc, char **argv) { + if (argc & 1) + return 0; + (argv[0][0] ? foo1 : foo2) (); + } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char openlog (); int main () { -return openlog (); + ; return 0; } _ACEOF -for ac_lib in '' syslog; do - if test -z "$ac_lib"; then - ac_res="none required" +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_working_stdnoreturn_h=yes +else + gl_cv_header_working_stdnoreturn_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5 +$as_echo "$gl_cv_header_working_stdnoreturn_h" >&6; } + + if test $gl_cv_header_working_stdnoreturn_h = yes; then + STDNORETURN_H='' else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS" + STDNORETURN_H='stdnoreturn.h' fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_openlog=$ac_res + + + if test -n "$STDNORETURN_H"; then + GL_GENERATE_STDNORETURN_H_TRUE= + GL_GENERATE_STDNORETURN_H_FALSE='#' +else + GL_GENERATE_STDNORETURN_H_TRUE='#' + GL_GENERATE_STDNORETURN_H_FALSE= fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_openlog+:} false; then : - break + + + + # ---------------------------------------------------------------------- + # check for various programs used during the build. + # On OS/X, "wchar.h" needs "runetype.h" to work properly. + # ---------------------------------------------------------------------- + for ac_header in runetype.h wchar.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + $ac_includes_default + #if HAVE_RUNETYPE_H + # include <runetype.h> + #endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done -if ${ac_cv_search_openlog+:} false; then : + + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; +fi + + if test "x$enable_nls" != "xno" && \ + test "X${ac_cv_header_libintl_h}" = Xyes; then : + + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + +fi + + # -------------------------------------------- + # Verify certain entries from AC_CHECK_HEADERS + # -------------------------------------------- + ${lo_have_arg_hdr} || \ + as_fn_error $? "you must have stdarg.h or varargs.h on your system" "$LINENO" 5 + + ${lo_have_str_hdr} || \ + as_fn_error $? "you must have string.h or strings.h on your system" "$LINENO" 5 + + ${lo_have_lim_hdr} || \ + as_fn_error $? "you must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5 + + ${lo_have_typ_hdr} || \ + as_fn_error $? "you must have inttypes.h or stdint.h on your system" "$LINENO" 5 + + for f in sys_types sys_param sys_stat string errno stdlib memory setjmp + do eval as_ac_var=\${ac_cv_header_${f}_h} + test "X${as_ac_var}" = Xyes || { + as_fn_error $? "you must have ${f}.h on your system" "$LINENO" 5 + } + done + test "X${ac_cv_header_inttypes_h-no}" = Xyes || \ + echo '#include <stdint.h>' > inttypes.h + + # ---------------------------------------------------------------------- + # Checks for typedefs + # ---------------------------------------------------------------------- + ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default" +if test "x$ac_cv_type_wchar_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_WCHAR_T 1 +_ACEOF + + +fi + + ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" " + $ac_includes_default + #if HAVE_RUNETYPE_H + # include <runetype.h> + #endif + #if HAVE_WCHAR_H + # include <wchar.h> + #endif + +" +if test "x$ac_cv_type_wint_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_WINT_T 1 +_ACEOF + + +fi + + ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" +if test "x$ac_cv_type_int8_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT8_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" +if test "x$ac_cv_type_uint8_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT8_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" +if test "x$ac_cv_type_int16_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT16_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" +if test "x$ac_cv_type_uint16_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT16_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" +if test "x$ac_cv_type_int32_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT32_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" +if test "x$ac_cv_type_uint32_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT32_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" +if test "x$ac_cv_type_intptr_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTPTR_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" +if test "x$ac_cv_type_uint_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_PID_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIZE_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_PTRDIFF_T 1 +_ACEOF + + +fi + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5 +$as_echo_n "checking size of char*... " >&6; } +if ${ac_cv_sizeof_charp+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_search_openlog=no + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_charp" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char*) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_charp=0 + fi fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 -$as_echo "$ac_cv_search_openlog" >&6; } -ac_res=$ac_cv_search_openlog -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5 +$as_echo "$ac_cv_sizeof_charp" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHARP $ac_cv_sizeof_charp +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5 -$as_echo_n "checking for library containing MD5Init... " >&6; } -if ${ac_cv_search_MD5Init+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + + + # ------------ + # AC_CHECK_LIB + # ------------ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5 +$as_echo_n "checking for pathfind in -lgen... " >&6; } +if ${ac_cv_lib_gen_pathfind+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15578,58 +18712,1423 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char MD5Init (); +char pathfind (); int main () { -return MD5Init (); +return pathfind (); ; return 0; } _ACEOF -for ac_lib in '' md5 md; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_MD5Init=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gen_pathfind=yes +else + ac_cv_lib_gen_pathfind=no fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_MD5Init+:} false; then : - break + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5 +$as_echo "$ac_cv_lib_gen_pathfind" >&6; } +if test "x$ac_cv_lib_gen_pathfind" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGEN 1 +_ACEOF + + LIBS="-lgen $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 +$as_echo_n "checking for gettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_gettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gettext (); +int +main () +{ +return gettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_gettext=yes +else + ac_cv_lib_intl_gettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 +$as_echo "$ac_cv_lib_intl_gettext" >&6; } +if test "x$ac_cv_lib_intl_gettext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL 1 +_ACEOF + + LIBS="-lintl $LIBS" + +fi + + for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + fi done -if ${ac_cv_search_MD5Init+:} false; then : + + for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VFORK_H 1 +_ACEOF + +fi + +done + +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if ${ac_cv_func_fork_works+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_search_MD5Init=no + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5 -$as_echo "$ac_cv_search_MD5Init" >&6; } -ac_res=$ac_cv_search_MD5Init -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if ${ac_cv_func_vfork_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include <sys/wait.h> +#ifdef HAVE_VFORK_H +# include <vfork.h> +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include <vfork.h>, but some compilers + (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi -for ac_func in MD5Init +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +$as_echo "#define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + for ac_func in mmap canonicalize_file_name snprintf strdup strchr \ + strrchr strsignal fchmod fstat chmod do : - ac_fn_c_check_func "$LINENO" "MD5Init" "ac_cv_func_MD5Init" -if test "x$ac_cv_func_MD5Init" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_MD5INIT 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + while : + do + POSIX_SHELL=`which bash` + test -x "$POSIX_SHELL" && break + POSIX_SHELL=`which dash` + test -x "$POSIX_SHELL" && break + POSIX_SHELL=/usr/xpg4/bin/sh + test -x "$POSIX_SHELL" && break + POSIX_SHELL=`/bin/sh -c ' + exec 2>/dev/null + if ! true ; then exit 1 ; fi + echo /bin/sh'` + test -x "$POSIX_SHELL" && break + as_fn_error $? "cannot locate a working POSIX shell" "$LINENO" 5 + done + +cat >>confdefs.h <<_ACEOF +#define POSIX_SHELL "${POSIX_SHELL}" +_ACEOF + + + + + + LIBOPTS_BUILD_BLOCKED=true + + + NEED_LIBOPTS_DIR='' + + # Check whether --enable-local-libopts was given. +if test "${enable_local_libopts+set}" = set; then : + enableval=$enable_local_libopts; + if test x$enableval = xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5 +$as_echo "$as_me: Using supplied libopts tearoff" >&6;} + LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts' + NEED_LIBOPTS_DIR=true + LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la' + fi +fi + + + # Check whether --enable-libopts-install was given. +if test "${enable_libopts_install+set}" = set; then : + enableval=$enable_libopts_install; +fi + + if test "X${enable_libopts_install}" = Xyes; then + INSTALL_LIBOPTS_TRUE= + INSTALL_LIBOPTS_FALSE='#' +else + INSTALL_LIBOPTS_TRUE='#' + INSTALL_LIBOPTS_FALSE= +fi + + + if test -z "${NEED_LIBOPTS_DIR}" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5 +$as_echo_n "checking whether autoopts-config can be found... " >&6; } + +# Check whether --with-autoopts-config was given. +if test "${with_autoopts_config+set}" = set; then : + withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5 +$as_echo_n "checking whether autoopts-config is specified... " >&6; } +if ${lo_cv_with_autoopts_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if autoopts-config --help 2>/dev/null 1>&2 + then lo_cv_with_autoopts_config=autoopts-config + elif libopts-config --help 2>/dev/null 1>&2 + then lo_cv_with_autoopts_config=libopts-config + else lo_cv_with_autoopts_config=no ; fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5 +$as_echo "$lo_cv_with_autoopts_config" >&6; } + +fi + # end of AC_ARG_WITH + + if ${lo_cv_test_autoopts+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test -z "${lo_cv_with_autoopts_config}" \ + -o X"${lo_cv_with_autoopts_config}" = Xno + then + if autoopts-config --help 2>/dev/null 1>&2 + then lo_cv_with_autoopts_config=autoopts-config + elif libopts-config --help 2>/dev/null 1>&2 + then lo_cv_with_autoopts_config=libopts-config + else lo_cv_with_autoopts_config=false ; fi + fi + lo_cv_test_autoopts=` + ${lo_cv_with_autoopts_config} --libs` 2> /dev/null + if test $? -ne 0 -o -z "${lo_cv_test_autoopts}" + then lo_cv_test_autoopts=no ; fi + +fi + # end of CACHE_VAL + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5 +$as_echo "${lo_cv_test_autoopts}" >&6; } + + if test "X${lo_cv_test_autoopts}" != Xno + then + LIBOPTS_LDADD="${lo_cv_test_autoopts}" + LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`" + else + LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la' + LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts' + NEED_LIBOPTS_DIR=true + fi + fi # end of if test -z "${NEED_LIBOPTS_DIR}" + if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then + NEED_LIBOPTS_DIR='' + fi + if test -n "${NEED_LIBOPTS_DIR}"; then + NEED_LIBOPTS_TRUE= + NEED_LIBOPTS_FALSE='#' +else + NEED_LIBOPTS_TRUE='#' + NEED_LIBOPTS_FALSE= +fi + + + + LIBOPTS_DIR=sntp/libopts + + +# end of AC_DEFUN of LIBOPTS_CHECK_COMMON + + # end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD + + + + +# Check whether --enable-local-libevent was given. +if test "${enable_local_libevent+set}" = set; then : + enableval=$enable_local_libevent; ntp_use_local_libevent=$enableval +else + ntp_use_local_libevent=${ntp_use_local_libevent-detect} + +fi + + + + + + +# Expose a cross-compilation indicator to makefiles + if test $build != $host; then + NTP_CROSSCOMPILE_TRUE= + NTP_CROSSCOMPILE_FALSE='#' +else + NTP_CROSSCOMPILE_TRUE='#' + NTP_CROSSCOMPILE_FALSE= +fi + + + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + + # Check whether --enable-c99-snprintf was given. +if test "${enable_c99_snprintf+set}" = set; then : + enableval=$enable_c99_snprintf; force_c99_snprintf=$enableval +else + force_c99_snprintf=no + +fi + + case "$force_c99_snprintf" in + yes) + hw_force_rpl_snprintf=yes + hw_force_rpl_vsnprintf=yes + esac + + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes; then : + hw_cv_func_vsnprintf=yes +else + hw_cv_func_vsnprintf=no +fi + + if test "$hw_cv_func_vsnprintf" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5 +$as_echo_n "checking whether vsnprintf is C99 compliant... " >&6; } +if ${hw_cv_func_vsnprintf_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + hw_cv_func_vsnprintf_c99=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_STDARG_H + #include <stdarg.h> + #endif + #include <stdio.h> + static int testprintf(char *buf, size_t size, const char *format, ...) + { + int result; + va_list ap; + va_start(ap, format); + result = vsnprintf(buf, size, format, ap); + va_end(ap); + return result; + } +int +main () +{ +char buf[43]; + if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 || + testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 || + buf[0] != 'T' || buf[3] != '\0') + return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + hw_cv_func_vsnprintf_c99=yes +else + hw_cv_func_vsnprintf_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5 +$as_echo "$hw_cv_func_vsnprintf_c99" >&6; } +else + hw_cv_func_vsnprintf_c99=no +fi + +$as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement vsnprintf will be used" >&5 +$as_echo_n "checking if C99-snprintf replacement vsnprintf will be used... " >&6; } + if test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no; then : + hw_use_rpl_vsnprintf=yes +else + hw_use_rpl_vsnprintf=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_vsnprintf" >&5 +$as_echo "$hw_use_rpl_vsnprintf" >&6; } + if test "$hw_use_rpl_vsnprintf" = yes; then : + +$as_echo "#define HW_WANT_RPL_VSNPRINTF 1" >>confdefs.h + + if test ${hw_nodef_vsnprintf=no} = no; then : + +$as_echo "#define vsnprintf rpl_vsnprintf" >>confdefs.h + +fi + for ac_header in inttypes.h locale.h stddef.h stdint.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h> +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct lconv" "thousands_sep" "ac_cv_member_struct_lconv_thousands_sep" "#include <locale.h> +" +if test "x$ac_cv_member_struct_lconv_thousands_sep" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1 +_ACEOF + + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +$as_echo_n "checking for long double... " >&6; } +if ${ac_cv_type_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$GCC" = yes; then + ac_cv_type_long_double=yes + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* The Stardent Vistra knows sizeof (long double), but does + not support it. */ + long double foo = 0.0L; +int +main () +{ +static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + sizeof (double) <= sizeof (long double))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_long_double=yes +else + ac_cv_type_long_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 +$as_echo "$ac_cv_type_long_double" >&6; } + if test $ac_cv_type_long_double = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if ${ac_cv_type_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test "$cross_compiling" = yes; then : + ac_cv_type_long_long_int=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_type_long_long_int=yes +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + ac_cv_type_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +$as_echo_n "checking for unsigned long long int... " >&6; } +if ${ac_cv_type_unsigned_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_type_unsigned_long_long_int=yes +else + ac_cv_type_unsigned_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + + + ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default" +if test "x$ac_cv_type_intmax_t" = xyes; then : + +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h + +else + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long int' \ + || ac_type='long int' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type +_ACEOF + +fi + + + + + ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default" +if test "x$ac_cv_type_uintmax_t" = xyes; then : + +$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h + +else + test $ac_cv_type_unsigned_long_long_int = yes \ + && ac_type='unsigned long long int' \ + || ac_type='unsigned long int' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + +fi + + + + ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h + +else + for ac_type in 'unsigned int' 'unsigned long int' \ + 'unsigned long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +cat >>confdefs.h <<_ACEOF +#define uintptr_t $ac_type +_ACEOF + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_PTRDIFF_T 1 +_ACEOF + + +fi + + for ac_func in localeconv +do : + ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv" +if test "x$ac_cv_func_localeconv" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALECONV 1 +_ACEOF + +fi +done + + + if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + + + + case " $LIBOBJS " in + *" snprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" + ;; +esac + + _hw_cv_func_xprintf_replace_done=yes +fi + +fi + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes; then : + hw_cv_func_snprintf=yes +else + hw_cv_func_snprintf=no +fi + + if test "$hw_cv_func_snprintf" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5 +$as_echo_n "checking whether snprintf is C99 compliant... " >&6; } +if ${hw_cv_func_snprintf_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + hw_cv_func_snprintf_c99=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +char buf[43]; + if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 || + snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 || + buf[0] != 'T' || buf[3] != '\0') + return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + hw_cv_func_snprintf_c99=yes +else + hw_cv_func_snprintf_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5 +$as_echo "$hw_cv_func_snprintf_c99" >&6; } +else + hw_cv_func_snprintf_c99=no +fi + +$as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement snprintf will be used" >&5 +$as_echo_n "checking if C99-snprintf replacement snprintf will be used... " >&6; } + if test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no; then : + hw_use_rpl_snprintf=yes +else + hw_use_rpl_snprintf=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_snprintf" >&5 +$as_echo "$hw_use_rpl_snprintf" >&6; } + if test "$hw_use_rpl_snprintf" = yes; then : + +$as_echo "#define HW_WANT_RPL_SNPRINTF 1" >>confdefs.h + + if test ${hw_nodef_snprintf=no} = no; then : + +$as_echo "#define snprintf rpl_snprintf" >>confdefs.h + +fi + + if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + + + + case " $LIBOBJS " in + *" snprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" + ;; +esac + + _hw_cv_func_xprintf_replace_done=yes +fi + +fi + + + + + +# HMS: Save $LIBS and empty it. +# any LIBS we add here should go in to LDADD_LIBNTP + +__LIBS=$LIBS +LIBS= + + + +# [Bug 2332] because we need to know if we are using GNU ld... + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5 +$as_echo_n "checking for directory path separator... " >&6; } +if ${ntp_cv_dir_sep+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$ntp_cv_dir_sep" in + '') + case "$host_os" in + *djgpp | *mingw32* | *emx*) + ntp_cv_dir_sep="'\\'" + ;; + *) + ntp_cv_dir_sep="'/'" + ;; + esac + esac + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5 +$as_echo "$ntp_cv_dir_sep" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DIR_SEP $ntp_cv_dir_sep +_ACEOF + NTP_ORIG_LIBS="$LIBS" @@ -15885,19 +20384,18 @@ $as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h { use_lineeditlibs=; unset use_lineeditlibs;} - +LIBM= case "$host" in - *-*-*linux*) ;; - *-*-osf4*) ;; - *-*-osf5*) ;; + *-*-darwin*) + ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setscheduler in -lrt" >&5 -$as_echo_n "checking for sched_setscheduler in -lrt... " >&6; } -if ${ac_cv_lib_rt_sched_setscheduler+:} false; then : + _libs=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 +$as_echo_n "checking for library containing cos... " >&6; } +if ${ac_cv_search_cos+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15907,417 +20405,596 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char sched_setscheduler (); +char cos (); int main () { -return sched_setscheduler (); +return cos (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rt_sched_setscheduler=yes -else - ac_cv_lib_rt_sched_setscheduler=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_cos=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_cos+:} false; then : + break +fi +done +if ${ac_cv_search_cos+:} false; then : + +else + ac_cv_search_cos=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 +$as_echo "$ac_cv_search_cos" >&6; } +ac_res=$ac_cv_search_cos +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + LIBM="-lm" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_setscheduler" >&5 -$as_echo "$ac_cv_lib_rt_sched_setscheduler" >&6; } -if test "x$ac_cv_lib_rt_sched_setscheduler" = xyes; then : + + LIBS=$_libs + ;; +esac + +{ _libs=; unset _libs;} + + +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRT 1 +#define HAVE_VFORK_H 1 _ACEOF - LIBS="-lrt $LIBS" +fi + +done -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setscheduler in -lposix4" >&5 -$as_echo_n "checking for sched_setscheduler in -lposix4... " >&6; } -if ${ac_cv_lib_posix4_sched_setscheduler+:} false; then : +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix4 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sched_setscheduler (); +$ac_includes_default int main () { -return sched_setscheduler (); + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_posix4_sched_setscheduler=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes else - ac_cv_lib_posix4_sched_setscheduler=no + ac_cv_func_fork_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_setscheduler" >&5 -$as_echo "$ac_cv_lib_posix4_sched_setscheduler" >&6; } -if test "x$ac_cv_lib_posix4_sched_setscheduler" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPOSIX4 1 -_ACEOF - - LIBS="-lposix4 $LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } +else + ac_cv_func_fork_works=$ac_cv_func_fork fi - - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 -$as_echo_n "checking for library containing setsockopt... " >&6; } -if ${ac_cv_search_setsockopt+:} false; then : +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include <sys/wait.h> +#ifdef HAVE_VFORK_H +# include <vfork.h> +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include <vfork.h>, but some compilers + (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void #ifdef __cplusplus -extern "C" +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; #endif -char setsockopt (); +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + int main () { -return setsockopt (); - ; - return 0; + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } } _ACEOF -for ac_lib in '' socket xnet; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_setsockopt=$ac_res +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_setsockopt+:} false; then : - break +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -done -if ${ac_cv_search_setsockopt+:} false; then : -else - ac_cv_search_setsockopt=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 -$as_echo "$ac_cv_search_setsockopt" >&6; } -ac_res=$ac_cv_search_setsockopt -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +$as_echo "#define vfork fork" >>confdefs.h fi +if test "x$ac_cv_func_fork_works" = xyes; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 -$as_echo_n "checking for library containing res_init... " >&6; } -if ${ac_cv_search_res_init+:} false; then : +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char res_init (); +#include <alloca.h> int main () { -return res_init (); +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF -for ac_lib in '' resolv; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_res_init=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_res_init+:} false; then : - break + conftest$ac_exeext conftest.$ac_ext fi -done -if ${ac_cv_search_res_init+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then -else - ac_cv_search_res_init=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 -$as_echo "$ac_cv_search_res_init" >&6; } -ac_res=$ac_cv_search_res_init -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -case "$host" in - *-*-darwin*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_9_init in -lresolv" >&5 -$as_echo_n "checking for res_9_init in -lresolv... " >&6; } -if ${ac_cv_lib_resolv_res_9_init+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lresolv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif #endif -char res_9_init (); + int main () { -return res_9_init (); +char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_resolv_res_9_init=yes + ac_cv_func_alloca_works=yes else - ac_cv_lib_resolv_res_9_init=no + ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_9_init" >&5 -$as_echo "$ac_cv_lib_resolv_res_9_init" >&6; } -if test "x$ac_cv_lib_resolv_res_9_init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } - LIBS="-lresolv $LIBS" +if test $ac_cv_func_alloca_works = yes; then -fi +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h - ;; -esac -for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -# include <netinet/in.h> /* inet_ functions / structs */ -#endif -#ifdef HAVE_ARPA_NAMESER_H -# include <arpa/nameser.h> /* DNS HEADER struct */ -#endif -#ifdef HAVE_NETDB_H -# include <netdb.h> -#endif -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. -fi +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -done +$as_echo "#define C_ALLOCA 1" >>confdefs.h -for ac_func in res_init __res_init -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func _ACEOF + break fi -done + done +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} int main () { - - ; - return 0; + return find_stack_direction () < 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 else - ac_cv_header_stdc=no + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no + fi -rm -f conftest* +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl +_ACEOF +for ac_func in strerror_r +do : + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR_R 1 _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no fi -rm -f conftest* +done -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +$as_echo_n "checking whether strerror_r returns char *... " >&6; } +if ${ac_cv_func_strerror_r_char_p+:} false; then : + $as_echo_n "(cached) " >&6 +else -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +$ac_includes_default + extern char *strerror_r (); int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no + ac_cv_func_strerror_r_char_p=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi -for ac_header in bstring.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default" -if test "x$ac_cv_header_bstring_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BSTRING_H 1 -_ACEOF -fi +ac_busted_vpath_in_make=no +case "$build" in + *-*-irix6.1*) # 64 bit only + # busted vpath? + ;; + *-*-irix6*) # 6.2 (and later?) + ac_busted_vpath_in_make=yes + ;; + *-*-solaris2.5.1) + ac_busted_vpath_in_make=yes + ;; + *-*-unicosmp*) + ac_busted_vpath_in_make=yes + ;; +esac -done +case "$ac_busted_vpath_in_make$srcdir" in + yes.|no*) + ;; + *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in + '') + as_fn_error $? "building outside of the main directory requires GNU make" "$LINENO" 5 + esac + ;; +esac -ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default" -if test "x$ac_cv_header_dns_sd_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DNSServiceRegister in -ldns_sd" >&5 -$as_echo_n "checking for DNSServiceRegister in -ldns_sd... " >&6; } -if ${ac_cv_lib_dns_sd_DNSServiceRegister+:} false; then : +case "$host" in + *-*-aix4*) + # Bug 2516: + # Was *-*-aix[[4-9]]* + # XXX only verified thru AIX6. But... + # Ken Link says this is fine for AIX 5.3 and 7.1, and sees no reason + # that this support would be in 5.3, removed in 6, and added back. + # + # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub + # (returning ENOSYS). I didn't check 4.2. If, in the future, + # IBM pulls its thumbs out long enough to implement clock_settime, + # this conditional will need to change. Maybe use AC_TRY_RUN + # instead to try to set the time to itself and check errno. + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldns_sd $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16327,100 +21004,82 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char DNSServiceRegister (); +char clock_gettime (); int main () { -return DNSServiceRegister (); +return clock_gettime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dns_sd_DNSServiceRegister=yes -else - ac_cv_lib_dns_sd_DNSServiceRegister=no +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dns_sd_DNSServiceRegister" >&5 -$as_echo "$ac_cv_lib_dns_sd_DNSServiceRegister" >&6; } -if test "x$ac_cv_lib_dns_sd_DNSServiceRegister" = xyes; then : - -$as_echo "#define HAVE_DNSREGISTRATION 1" >>confdefs.h - +done +if ${ac_cv_search_clock_gettime+:} false; then : +else + ac_cv_search_clock_gettime=no fi - - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi - - -case "$ac_cv_lib_dns_sd_DNSServiceRegister" in - yes) - LIBS="-ldns_sd $LIBS" -esac -for ac_header in errno.h fcntl.h ieeefp.h kvm.h math.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + case "$ac_cv_search_clock_gettime" in + 'none required') ;; + no) ;; + *) LDADD_LIBNTP="$ac_cv_search_clock_gettime $LDADD_LIBNTP" ;; + esac fi -done - - -for ac_header in md5.h + for ac_func in clock_getres clock_gettime clock_settime do : - ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" " - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - - -" -if test "x$ac_cv_header_md5_h" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_MD5_H 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi - done -for ac_header in memory.h netdb.h poll.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done + ;; +esac -for ac_header in sgtty.h stdlib.h string.h termio.h +for ac_func in getclock stime timegm strlcpy strlcat do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi - done -for ac_header in termios.h timepps.h timex.h unistd.h + +# +for ac_header in errno.h sys/socket.h sys/types.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -16433,138 +21092,83 @@ fi done - -case "$host" in - *-*-aix*) - for ac_header in utmpx.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" -if test "x$ac_cv_header_utmpx_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UTMPX_H 1 -_ACEOF - -fi - -done - - case "$ac_cv_header_utmpx_h" in - yes) - ;; - *) - for ac_header in utmp.h +for ac_header in net/if.h do : - ac_fn_c_check_header_mongrel "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" -if test "x$ac_cv_header_utmp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UTMP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif -fi - -done - - ;; - esac - ;; - *) - for ac_header in utmp.h utmpx.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +" +if test "x$ac_cv_header_net_if_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_NET_IF_H 1 _ACEOF fi done - ;; -esac - -# -# On Suns only (so far) getpass() truncates the typed password to 8 -# characters, but getpassphrase() allows up to 257. Most systems' -# getpass() does not truncate, at least not so as to affect ntpq and -# ntpdc password prompts. -# -# So check for getpassphrase(), but only on Sun operating systems. -# case "$host" in - *-*-sunos*|*-*-solaris*) - for ac_func in getpassphrase -do : - ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase" -if test "x$ac_cv_func_getpassphrase" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPASSPHRASE 1 -_ACEOF + *-hp-hpux*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if net/if.h requires mpinfou predeclaration" >&5 +$as_echo_n "checking if net/if.h requires mpinfou predeclaration... " >&6; } +if ${ntp_cv_predecl_mpinfou+:} false; then : + $as_echo_n "(cached) " >&6 +else -fi -done + np_cv_predecl_mpinfou=no + case "$ac_cv_header_net_if_h" in + no) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -esac + typedef union mpinfou { + struct pdk_mpinfo *pdkptr; + struct mpinfo *pikptr; + } mpinfou_t; + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + #include <net/if.h> -for ac_header in arpa/nameser.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_nameser_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARPA_NAMESER_H 1 -_ACEOF +int +main () +{ -fi -done -for ac_header in sys/socket.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SOCKET_H 1 + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi - -done + ntp_cv_predecl_mpinfou=yes + ac_cv_header_net_if_h=yes -# -case "$host" in - *-hp-hpux*) - for ac_header in net/netmp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "net/netmp.h" "ac_cv_header_net_netmp_h" "$ac_includes_default" -if test "x$ac_cv_header_net_netmp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_NETMP_H 1 -_ACEOF - netmp_h_works=yes -else - netmp_h_works=no - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + esac -done - case "$netmp_h_works" in - no) +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_predecl_mpinfou" >&5 +$as_echo "$ntp_cv_predecl_mpinfou" >&6; } + case "$ntp_cv_predecl_mpinfou" in + yes) cat >>confdefs.h <<_ACEOF #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED -typedef union mpinfou { /* For lint */ +typedef union mpinfou { struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif _ACEOF - ;; esac - ;; esac case "$host" in @@ -16588,78 +21192,90 @@ done esac -for ac_header in net/if.h +for ac_header in arpa/nameser.h sys/param.h sys/time.h sys/timers.h do : - ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif - -" -if test "x$ac_cv_header_net_if_h" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done -for ac_header in net/if6.h +# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576 +for ac_header in sys/sysctl.h do : - ac_fn_c_check_header_mongrel "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default" -if test "x$ac_cv_header_net_if6_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " + #if defined HAVE_SYS_PARAM_H + # include <sys/param.h> + #endif + +" +if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF6_H 1 +#define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done -for ac_header in net/route.h +for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.h do : - ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" " -#include <sys/types.h> -#include <sys/socket.h> -#include <net/if.h> - -" -if test "x$ac_cv_header_net_route_h" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_NET_ROUTE_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done -for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.h + +for ac_header in resolv.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" " + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + #ifdef HAVE_ARPA_NAMESER_H + # include <arpa/nameser.h> + #endif + +" +if test "x$ac_cv_header_resolv_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_RESOLV_H 1 _ACEOF fi done + for ac_header in net/if_var.h do : - ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" "#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_NET_IF_H -#include <net/if.h> -#endif + ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" " + #if HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + #ifdef HAVE_NET_IF_H + # include <net/if.h> + #endif " if test "x$ac_cv_header_net_if_var_h" = xyes; then : @@ -16671,27 +21287,29 @@ fi done + for ac_header in netinet/ip.h netinet/in_var.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NET_IF_H -#include <net/if.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_NET_IF_VAR_H -#include <net/if_var.h> -#endif -#ifdef HAVE_NETINET_IN_SYSTM_H -#include <netinet/in_systm.h> -#endif +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + #ifdef HAVE_NET_IF_H + # include <net/if.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + #ifdef HAVE_NET_IF_VAR_H + # include <net/if_var.h> + #endif + #ifdef HAVE_NETINET_IN_SYSTM_H + # include <netinet/in_systm.h> + #endif " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : @@ -16704,1774 +21322,5620 @@ fi done -# Check for IPTOS_PREC -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IPPROTO_IP IP_TOS IPTOS_LOWDELAY" >&5 -$as_echo_n "checking IPPROTO_IP IP_TOS IPTOS_LOWDELAY... " >&6; } -if ${ntp_cv_ip_tos+:} false; then : +# HMS: Do we need to check for -lsocket before or after these tests? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +$as_echo_n "checking for library containing inet_pton... " >&6; } +if ${ac_cv_search_inet_pton+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_NETINET_IP_H - # include <netinet/in.h> - # include <netinet/ip.h> - #endif - #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY) - yes - #endif - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (); +int +main () +{ +return inet_pton (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ntp_cv_ip_tos=yes +for ac_lib in '' nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_inet_pton+:} false; then : + break +fi +done +if ${ac_cv_search_inet_pton+:} false; then : + else - ntp_cv_ip_tos=no + ac_cv_search_inet_pton=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +$as_echo "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + case "$ac_cv_search_inet_pton" in + 'none required') ;; + no) ;; + *) LDADD_LIBNTP="$ac_cv_search_inet_pton $LDADD_LIBNTP" ;; + esac fi -rm -f conftest* +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 +$as_echo_n "checking for library containing inet_ntop... " >&6; } +if ${ac_cv_search_inet_ntop+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_ntop (); +int +main () +{ +return inet_ntop (); + ; + return 0; +} +_ACEOF +for ac_lib in '' resolv; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_inet_ntop=$ac_res fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_ip_tos" >&5 -$as_echo "$ntp_cv_ip_tos" >&6; } -case "$ntp_cv_ip_tos" in - yes) +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_inet_ntop+:} false; then : + break +fi +done +if ${ac_cv_search_inet_ntop+:} false; then : -$as_echo "#define HAVE_IPTOS_SUPPORT 1" >>confdefs.h +else + ac_cv_search_inet_ntop=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 +$as_echo "$ac_cv_search_inet_ntop" >&6; } +ac_res=$ac_cv_search_inet_ntop +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + case "$ac_cv_search_inet_ntop" in + 'none required') ;; + no) ;; + *) LDADD_LIBNTP="$ac_cv_search_inet_ntop $LDADD_LIBNTP" ;; + esac -esac +fi -for ac_header in netinfo/ni.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default" -if test "x$ac_cv_header_netinfo_ni_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETINFO_NI_H 1 + +# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to +# avoid keying on the OS name: If we find socket functions in +# libsocket, next try for them in libxnet without libsocket, if found, +# list both. If we simply tested libxnet first, we would find the +# functions there and never add libsocket. See also [Bug 660] +# http://bugs.ntp.org/show_bug.cgi?id=660#c9 +saved_LIBS=$LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +$as_echo_n "checking for library containing setsockopt... " >&6; } +if ${ac_cv_search_setsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} _ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_setsockopt=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_setsockopt+:} false; then : + break +fi +done +if ${ac_cv_search_setsockopt+:} false; then : + +else + ac_cv_search_setsockopt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 +$as_echo "$ac_cv_search_setsockopt" >&6; } +ac_res=$ac_cv_search_setsockopt +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + case "$ac_cv_search_setsockopt" in + 'none required') ;; + no) ;; + *) LDADD_LIBNTP="$ac_cv_search_setsockopt $LDADD_LIBNTP" ;; + esac fi +case "$ac_cv_search_setsockopt" in + -lsocket) + LIBS="$saved_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5 +$as_echo_n "checking for library containing getsockopt... " >&6; } +if ${ac_cv_search_getsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getsockopt (); +int +main () +{ +return getsockopt (); + ; + return 0; +} +_ACEOF +for ac_lib in '' xnet; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_getsockopt=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_getsockopt+:} false; then : + break +fi done +if ${ac_cv_search_getsockopt+:} false; then : -case "$ac_cv_header_netinfo_ni_h" in - yes) +else + ac_cv_search_getsockopt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5 +$as_echo "$ac_cv_search_getsockopt" >&6; } +ac_res=$ac_cv_search_getsockopt +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + case "$ac_cv_search_getsockopt" in + 'none required') ;; + no) ;; + *) LDADD_LIBNTP="$ac_cv_search_getsockopt $LDADD_LIBNTP" ;; + esac -$as_echo "#define HAVE_NETINFO 1" >>confdefs.h +fi + # XXX Possible trouble here - reading the comments above and looking at the + # code below I wonder if we'll add -lxnet when we don't need it. + # Also, do we need to add -lxnet to LDADD_LIBNTP, or perhaps see if it's + # there when it is not needed? + case "$ac_cv_search_getsockopt" in + -lxnet) + LIBS="-lxnet -lsocket $saved_LIBS" + ;; + *) LIBS="-lsocket $saved_LIBS" + ;; + esac + ;; esac -for ac_header in sun/audioio.h sys/audioio.h +{ saved_LIBS=; unset saved_LIBS;} + +# Bug 2427 - look for recvmsg here. +for ac_func in recvmsg do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_RECVMSG 1 _ACEOF fi - done -for ac_header in sys/clkdefs.h sys/file.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } -done +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac -case "$host" in - *-*-sunos4*) + +case "$ac_cv_c_inline" in + '') ;; *) - for ac_header in sys/ioctl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_IOCTL_H 1 + +$as_echo "#define HAVE_INLINE 1" >>confdefs.h + + +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi -done +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } +if ${ac_cv_sizeof_time_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : - ;; -esac -for ac_header in sys/ipc.h sys/lock.h sys/mman.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +else + if test "$ac_cv_type_time_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (time_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_time_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_char_unsigned=no +else + ac_cv_c_char_unsigned=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h -done +fi + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 +$as_echo_n "checking size of signed char... " >&6; } +if ${ac_cv_sizeof_signed_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then : -for ac_header in sys/modem.h sys/param.h sys/ppsclock.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +else + if test "$ac_cv_type_signed_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (signed char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_signed_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 +$as_echo "$ac_cv_sizeof_signed_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char _ACEOF + +ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default" +if test "x$ac_cv_type_s_char" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_S_CHAR 1 +_ACEOF + + fi +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes; then : -done +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF -# HMS: Check sys/proc.h and sys/resource.h after some others -for ac_header in sys/ppstime.h sched.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi fi -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } -case "$ac_cv_header_sched_h" in - yes) + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + +case "$ac_cv_type_long_long" in + no) ;; *) - for ac_header in sys/sched.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sched_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SCHED_H 1 -_ACEOF + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi fi -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + ;; esac -case "$host" in - *-*-sco*) - for ac_header in sys/sio.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/sio.h" "ac_cv_header_sys_sio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sio_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SIO_H 1 -_ACEOF -fi +case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in + *yes) + # We have a typedef for s_char. Might as well believe it... + ;; + no0no) + # We have signed chars, can't say 'signed char', no s_char typedef. -done +$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h + + ;; + no1no) + # We have signed chars, can say 'signed char', no s_char typedef. + +$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h + + ;; + yes0no) + # We have unsigned chars, can't say 'signed char', no s_char typedef. + as_fn_error $? "No way to specify a signed character!" "$LINENO" 5 + ;; + yes1no) + # We have unsigned chars, can say 'signed char', no s_char typedef. + +$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; esac -# HMS: Check sys/shm.h after some others -for ac_header in sys/select.h sys/signal.h sys/sockio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then -done +$as_echo "#define uid_t int" >>confdefs.h -# HMS: Checked sys/socket.h earlier -case "$host" in - *-*-netbsd*) - ;; - *) - for ac_header in machine/soundcard.h sys/soundcard.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + +$as_echo "#define gid_t int" >>confdefs.h fi -done - ;; + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including debugging code" >&5 +$as_echo_n "checking if we're including debugging code... " >&6; } +# Check whether --enable-debugging was given. +if test "${enable_debugging+set}" = set; then : + enableval=$enable_debugging; ntp_ok=$enableval +else + ntp_ok=yes + +fi + +case "$ntp_ok" in + yes) + +$as_echo "#define DEBUG 1" >>confdefs.h + esac -for ac_header in sys/stat.h sys/stream.h sys/stropts.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +$as_echo "$ntp_ok" >&6; } + + + +# check if we can compile with pthreads +for ac_header in semaphore.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SEMAPHORE_H 1 _ACEOF fi done -# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576 -for ac_header in sys/sysctl.h +for ac_func in socketpair do : - ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#if defined HAVE_SYS_PARAM_H -# include <sys/param.h> -#endif -" -if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : + ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair" +if test "x$ac_cv_func_socketpair" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SYSCTL_H 1 +#define HAVE_SOCKETPAIR 1 _ACEOF fi - done -for ac_header in sys/syssgi.h sys/systune.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +# Check whether --enable-thread-support was given. +if test "${enable_thread_support+set}" = set; then : + enableval=$enable_thread_support; +else + enable_thread_support=yes fi -done +have_pthreads=no +case "$enable_thread_support" in + yes) + ol_found_pthreads=no + -for ac_header in sys/termios.h sys/time.h sys/signal.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# OpenLDAP --with-threads + +# Check whether --with-threads was given. +if test "${with_threads+set}" = set; then : + withval=$with_threads; + ol_arg=invalid + for ol_val in auto nt posix mach pth lwp yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5 + fi + ol_with_threads="$ol_arg" + +else + ol_with_threads="auto" fi +# end --with-threads + + +case "$ol_with_threads$host" in + auto*-*-solaris2.[0-6]) + ol_with_threads=no + ;; +esac + + +ol_aix_threads=no +case "$host" in +*-*-aix*) if test -z "$CC" ; then + case "$ol_with_threads" in + auto | yes | posix) ol_aix_threads=yes ;; + esac + fi +;; +esac +if test $ol_aix_threads = yes ; then + if test -z "${CC}" ; then + for ac_prog in cc_r xlc_r cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - #ifdef HAVE_SYS_TIME_H - # include <sys/time.h> - #endif - #ifdef HAVE_ERRNO_H - # include <errno.h> - #endif - #include <sys/timepps.h> - #ifdef PPS_API_VERS_1 - yes - #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - for ac_header in sys/timepps.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" " - #ifdef HAVE_SYS_TIME_H - # include <sys/time.h> - #endif - #ifdef HAVE_ERRNO_H - # include <errno.h> - #endif + test -n "$CC" && break +done -" -if test "x$ac_cv_header_sys_timepps_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEPPS_H 1 -_ACEOF + if test "$CC" = cc ; then + if test $ol_with_threads != auto ; then + as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5 +$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;} + fi + ol_with_threads=no + fi + fi + case ${CC} in cc_r | xlc_r) + ol_with_threads=posix + ol_cv_pthread_create=yes + ;; + esac fi -done +ol_link_threads=no +# OpenLDAP --with-yielding_select +# Check whether --with-yielding_select was given. +if test "${with_yielding_select+set}" = set; then : + withval=$with_yielding_select; + ol_arg=invalid + for ol_val in auto yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5 + fi + ol_with_yielding_select="$ol_arg" +else + ol_with_yielding_select="auto" fi -rm -f conftest* +# end --with-yielding_select + + +case $ol_with_threads in auto | yes | nt) + + + ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread" +if test "x$ac_cv_func__beginthread" = xyes; then : + +fi + + + if test $ac_cv_func__beginthread = yes ; then -for ac_header in sys/timers.h sys/tpro.h sys/types.h sys/wait.h +$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h + + ol_cv_nt_threads=yes + fi + + + if test "$ol_cv_nt_threads" = yes ; then + ol_link_threads=nt + ol_with_threads=found + ol_with_yielding_select=yes + + +$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h + + +$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h + + fi + + if test $ol_with_threads = nt ; then + as_fn_error $? "could not locate NT Threads" "$LINENO" 5 + fi + ;; +esac + +case $ol_with_threads in auto | yes | posix) + + for ac_header in pthread.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_PTHREAD_H 1 _ACEOF fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : + + if test $ac_cv_header_pthread_h = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5 +$as_echo_n "checking POSIX thread version... " >&6; } +if ${ol_cv_pthread_version+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> -#include <sys/time.h> -#include <time.h> + +# include <pthread.h> int main () { -if ((struct tm *) 0) -return 0; + + int i = PTHREAD_CREATE_JOINABLE; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "pthread_detach" >/dev/null 2>&1; then : + ol_cv_pthread_version=10 else - ac_cv_header_time=no + ol_cv_pthread_version=8 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include <pthread.h> +# ifdef PTHREAD_CREATE_UNDETACHED + draft7 +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "draft7" >/dev/null 2>&1; then : + ol_cv_pthread_version=7 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "pthread_attr_init" >/dev/null 2>&1; then : + ol_cv_pthread_version=6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include <pthread.h> +#ifdef PTHREAD_MUTEX_INITIALIZER + draft5 +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "draft5" >/dev/null 2>&1; then : + ol_cv_pthread_version=5 +else + ol_cv_pthread_version=4 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then +rm -f conftest* -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +fi +rm -f conftest* fi +rm -f conftest* -case "$host" in -*-convex-*) - for ac_header in /sys/sync/queue.h /sys/sync/sema.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5 +$as_echo "$ol_cv_pthread_version" >&6; } -done - ;; -*-*-bsdi*) - for ac_header in machine/inline.h sys/pcl720.h sys/i8253.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + if test $ol_cv_pthread_version != 0 ; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREADS $ol_cv_pthread_version _ACEOF + else + as_fn_error $? "unknown pthread version" "$LINENO" 5 + fi + + # consider threads found + ol_with_threads=found + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 +$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } +if ${ol_cv_header_linux_threads+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : + ol_cv_header_linux_threads=yes +else + ol_cv_header_linux_threads=no fi +rm -f conftest* -done - ;; -esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 +$as_echo "$ol_cv_header_linux_threads" >&6; } + if test $ol_cv_header_linux_threads = yes; then -case "$host" in - *-*-*linux*) - for ac_func in __adjtimex __ntp_gettime +$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5 +$as_echo_n "checking for GNU Pth pthread.h... " >&6; } +if ${ol_cv_header_gnu_pth_pthread_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +#ifdef _POSIX_THREAD_IS_GNU_PTH + __gnu_pth__; +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "__gnu_pth__" >/dev/null 2>&1; then : + ol_cv_header_gnu_pth_pthread_h=yes +else + ol_cv_header_gnu_pth_pthread_h=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5 +$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; } + + + if test $ol_cv_header_gnu_pth_pthread_h = no ; then + for ac_header in sched.h do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SCHED_H 1 _ACEOF fi + done - ;; -esac -case "$ac_cv_func___adjtimex" in - yes) - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lelf" >&5 -$as_echo_n "checking for nlist in -lelf... " >&6; } -if ${ac_cv_lib_elf_nlist+:} false; then : + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5 +$as_echo_n "checking for pthread_create in default libraries... " >&6; } +if ${ol_cv_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lelf $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> #endif -char nlist (); +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + int main () { -return nlist (); + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_elf_nlist=yes + ol_cv_pthread_create=yes else - ac_cv_lib_elf_nlist=no + ol_cv_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_nlist" >&5 -$as_echo "$ac_cv_lib_elf_nlist" >&6; } -if test "x$ac_cv_lib_elf_nlist" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBELF 1 -_ACEOF +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; - LIBS="-lelf $LIBS" +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_create=yes +else + ol_cv_pthread_create=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkvm" >&5 -$as_echo_n "checking for main in -lkvm... " >&6; } -if ${ac_cv_lib_kvm_main+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5 +$as_echo "$ol_cv_pthread_create" >&6; } + + if test $ol_cv_pthread_create != no ; then + ol_link_threads=posix + ol_link_pthreads="" + fi + + # Pthread try link: -kthread (ol_cv_pthread_kthread) +if test "$ol_link_threads" = no ; then + # try -kthread + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5 +$as_echo_n "checking for pthread link with -kthread... " >&6; } +if ${ol_cv_pthread_kthread+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lkvm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + # save the flags + ol_LIBS="$LIBS" + LIBS="-kthread $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -return main (); + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_kvm_main=yes + ol_cv_pthread_kthread=yes else - ac_cv_lib_kvm_main=no + ol_cv_pthread_kthread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_main" >&5 -$as_echo "$ac_cv_lib_kvm_main" >&6; } -if test "x$ac_cv_lib_kvm_main" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBKVM 1 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_kthread=yes +else + ol_cv_pthread_kthread=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - LIBS="-lkvm $LIBS" + # restore the LIBS + LIBS="$ol_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5 +$as_echo "$ol_cv_pthread_kthread" >&6; } + + if test $ol_cv_pthread_kthread = yes ; then + ol_link_pthreads="-kthread" + ol_link_threads=posix + fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lld" >&5 -$as_echo_n "checking for nlist in -lld... " >&6; } -if ${ac_cv_lib_ld_nlist+:} false; then : + + # Pthread try link: -pthread (ol_cv_pthread_pthread) +if test "$ol_link_threads" = no ; then + # try -pthread + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5 +$as_echo_n "checking for pthread link with -pthread... " >&6; } +if ${ol_cv_pthread_pthread+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + # save the flags + ol_LIBS="$LIBS" + LIBS="-pthread $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> #endif -char nlist (); +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + int main () { -return nlist (); + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ld_nlist=yes + ol_cv_pthread_pthread=yes else - ac_cv_lib_ld_nlist=no + ol_cv_pthread_pthread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ld_nlist" >&5 -$as_echo "$ac_cv_lib_ld_nlist" >&6; } -if test "x$ac_cv_lib_ld_nlist" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBLD 1 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_pthread=yes +else + ol_cv_pthread_pthread=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - LIBS="-lld $LIBS" + + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5 +$as_echo "$ol_cv_pthread_pthread" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lmld" >&5 -$as_echo_n "checking for nlist in -lmld... " >&6; } -if ${ac_cv_lib_mld_nlist+:} false; then : + if test $ol_cv_pthread_pthread = yes ; then + ol_link_pthreads="-pthread" + ol_link_threads=posix + fi +fi + + # Pthread try link: -pthreads (ol_cv_pthread_pthreads) +if test "$ol_link_threads" = no ; then + # try -pthreads + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5 +$as_echo_n "checking for pthread link with -pthreads... " >&6; } +if ${ol_cv_pthread_pthreads+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + # save the flags + ol_LIBS="$LIBS" + LIBS="-pthreads $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> #endif -char nlist (); +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + int main () { -return nlist (); + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mld_nlist=yes + ol_cv_pthread_pthreads=yes else - ac_cv_lib_mld_nlist=no + ol_cv_pthread_pthreads=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mld_nlist" >&5 -$as_echo "$ac_cv_lib_mld_nlist" >&6; } -if test "x$ac_cv_lib_mld_nlist" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMLD 1 -_ACEOF +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - LIBS="-lmld $LIBS" -fi +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif - for ac_header in nlist.h sys/var.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_pthreads=yes +else + ol_cv_pthread_pthreads=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -done - case "$ac_cv_header_nlist_h" in - yes) + # restore the LIBS + LIBS="$ol_LIBS" -$as_echo "#define NLIST_STRUCT 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5 +$as_echo "$ol_cv_pthread_pthreads" >&6; } - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5 -$as_echo_n "checking for n_un in struct nlist... " >&6; } -if ${ntp_cv_struct_nlist_n_un+:} false; then : + if test $ol_cv_pthread_pthreads = yes ; then + ol_link_pthreads="-pthreads" + ol_link_threads=posix + fi +fi + + # Pthread try link: -mthreads (ol_cv_pthread_mthreads) +if test "$ol_link_threads" = no ; then + # try -mthreads + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5 +$as_echo_n "checking for pthread link with -mthreads... " >&6; } +if ${ol_cv_pthread_mthreads+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-mthreads $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <nlist.h> +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { - struct nlist n; - n.n_un.n_name = 0; + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; ; return 0; } - ntp_cv_struct_nlist_n_un=yes _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_nlist_n_un=no - +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_mthreads=yes +else + ol_cv_pthread_mthreads=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5 -$as_echo "$ntp_cv_struct_nlist_n_un" >&6; } - case "$ntp_cv_struct_nlist_n_un" in - yes) -$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif - esac - ;; -esac +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} -for ac_header in sys/proc.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" "#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_TIME_H -# include <sys/time.h> + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 #endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; -" -if test "x$ac_cv_header_sys_proc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_PROC_H 1 -_ACEOF +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; -fi + status = pthread_attr_init(&attr); + if( status ) return status; -done +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); -for ac_header in sys/resource.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "#ifdef HAVE_SYS_TIME_H -# include <sys/time.h> + status = pthread_detach( &t ); + if( status ) return errno; #endif -" -if test "x$ac_cv_header_sys_resource_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_RESOURCE_H 1 +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_mthreads=yes +else + ol_cv_pthread_mthreads=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5 +$as_echo "$ol_cv_pthread_mthreads" >&6; } -done + if test $ol_cv_pthread_mthreads = yes ; then + ol_link_pthreads="-mthreads" + ol_link_threads=posix + fi +fi + # Pthread try link: -thread (ol_cv_pthread_thread) +if test "$ol_link_threads" = no ; then + # try -thread + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5 +$as_echo_n "checking for pthread link with -thread... " >&6; } +if ${ol_cv_pthread_thread+:} false; then : + $as_echo_n "(cached) " >&6 +else -for ac_header in sys/shm.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> + # save the flags + ol_LIBS="$LIBS" + LIBS="-thread $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> #endif -#ifdef HAVE_SYS_IPC_H -# include <sys/ipc.h> +#ifndef NULL +#define NULL (void*)0 #endif -" -if test "x$ac_cv_header_sys_shm_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SHM_H 1 -_ACEOF +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} -fi +int +main () +{ -done + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; -for ac_header in sys/timex.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" "#if HAVE_SYS_TIME_H -# include <sys/time.h> + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; #endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; -" -if test "x$ac_cv_header_sys_timex_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEX_H 1 -_ACEOF + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_thread=yes +else + ol_cv_pthread_thread=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -done +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif -for ac_header in resolv.h -do : - ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 #endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); #endif -#ifdef HAVE_ARPA_NAMESER_H -#include <arpa/nameser.h> + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; #endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} -" -if test "x$ac_cv_header_resolv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RESOLV_H 1 _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_thread=yes +else + ol_cv_pthread_thread=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5 +$as_echo "$ol_cv_pthread_thread" >&6; } -done + if test $ol_cv_pthread_thread = yes ; then + ol_link_pthreads="-thread" + ol_link_threads=posix + fi +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for basic volatile support" >&5 -$as_echo_n "checking for basic volatile support... " >&6; } -if ${ntp_cv_c_volatile+:} false; then : + # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r) +if test "$ol_link_threads" = no ; then + # try -lpthread -lmach -lexc -lc_r + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 +$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; } +if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -lmach -lexc -lc_r $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { - volatile int x; + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + return 0; ; return 0; } - ntp_cv_c_volatile=yes _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_c_volatile=no - +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes +else + ol_cv_pthread_lpthread_lmach_lexc_lc_r=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes +else + ol_cv_pthread_lpthread_lmach_lexc_lc_r=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_c_volatile" >&5 -$as_echo "$ntp_cv_c_volatile" >&6; } -case "$ntp_cv_c_volatile" in - yes) - ;; - *) -$as_echo "#define volatile /**/" >>confdefs.h - ;; -esac + # restore the LIBS + LIBS="$ol_LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5 +$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; } + + if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then + ol_link_pthreads="-lpthread -lmach -lexc -lc_r" + ol_link_threads=posix + fi +fi + + # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc) +if test "$ol_link_threads" = no ; then + # try -lpthread -lmach -lexc + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5 +$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; } +if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -lmach -lexc $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + int main () { -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 #endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthread_lmach_lexc=yes else - ac_cv_c_const=no + ol_cv_pthread_lpthread_lmach_lexc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthread_lmach_lexc=yes +else + ol_cv_pthread_lpthread_lmach_lexc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h + + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5 +$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : + if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then + ol_link_pthreads="-lpthread -lmach -lexc" + ol_link_threads=posix + fi +fi + + + # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff) +if test "$ol_link_threads" = no ; then + # try -lpthread -Wl,-woff,85 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5 +$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; } +if ${ol_cv_pthread_lib_lpthread_woff+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -Wl,-woff,85 $LIBS" - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> - #include <sys/param.h> + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lib_lpthread_woff=yes +else + ol_cv_pthread_lib_lpthread_woff=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> - #include <sys/param.h> -int -main () + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; { -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; - ; - return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lib_lpthread_woff=yes else - ac_cv_c_bigendian=no + ol_cv_pthread_lib_lpthread_woff=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + # restore the LIBS + LIBS="$ol_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5 +$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; } + + if test $ol_cv_pthread_lib_lpthread_woff = yes ; then + ol_link_pthreads="-lpthread -Wl,-woff,85" + ol_link_threads=posix + fi +fi + + + # Pthread try link: -lpthread (ol_cv_pthread_lpthread) +if test "$ol_link_threads" = no ; then + # try -lpthread + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5 +$as_echo_n "checking for pthread link with -lpthread... " >&6; } +if ${ol_cv_pthread_lpthread+:} false; then : + $as_echo_n "(cached) " >&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <limits.h> + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthread=yes +else + ol_cv_pthread_lpthread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <limits.h> -int -main () + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; { -#ifndef _BIG_ENDIAN - not big endian - #endif + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; - ; - return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthread=yes else - ac_cv_c_bigendian=no + ol_cv_pthread_lpthread=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + # restore the LIBS + LIBS="$ol_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5 +$as_echo "$ol_cv_pthread_lpthread" >&6; } + + if test $ol_cv_pthread_lpthread = yes ; then + ol_link_pthreads="-lpthread" + ol_link_threads=posix + fi +fi + + # Pthread try link: -lc_r (ol_cv_pthread_lc_r) +if test "$ol_link_threads" = no ; then + # try -lc_r + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5 +$as_echo_n "checking for pthread link with -lc_r... " >&6; } +if ${ol_cv_pthread_lc_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lc_r $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -return use_ascii (foo) == use_ebcdic (foo); + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lc_r=yes +else + ol_cv_pthread_lc_r=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; { + return (void *) (p == NULL); +} - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - ; - return 0; +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + } + _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no + ol_cv_pthread_lc_r=yes else - ac_cv_c_bigendian=yes + ol_cv_pthread_lc_r=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi + + # restore the LIBS + LIBS="$ol_LIBS" + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5 +$as_echo "$ol_cv_pthread_lc_r" >&6; } -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + if test $ol_cv_pthread_lc_r = yes ; then + ol_link_pthreads="-lc_r" + ol_link_threads=posix + fi +fi - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : + # Pthread try link: -threads (ol_cv_pthread_threads) +if test "$ol_link_threads" = no ; then + # try -threads + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5 +$as_echo_n "checking for pthread link with -threads... " >&6; } +if ${ol_cv_pthread_threads+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-threads $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> -#include <signal.h> + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -return *(signal (0, 0)) (0) == 1; + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_threads=yes else - ac_cv_type_signal=void + ol_cv_pthread_threads=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} -else -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +int main(argc, argv) + int argc; + char **argv; +{ -fi + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; -else + status = pthread_attr_init(&attr); + if( status ) return status; -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; -fi + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); -ac_fn_c_check_type "$LINENO" "time_t" "ac_cv_type_time_t" "$ac_includes_default" -if test "x$ac_cv_type_time_t" = xyes; then : + status = pthread_detach( &t ); + if( status ) return errno; +#endif -cat >>confdefs.h <<_ACEOF -#define HAVE_TIME_T 1 -_ACEOF +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + return 0; -fi -ac_fn_c_check_type "$LINENO" "long" "ac_cv_type_long" "$ac_includes_default" -if test "x$ac_cv_type_long" = xyes; then : +} -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG 1 _ACEOF - - +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_threads=yes +else + ol_cv_pthread_threads=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5 +$as_echo "$ol_cv_pthread_threads" >&6; } -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 -$as_echo_n "checking size of time_t... " >&6; } -if ${ac_cv_sizeof_time_t+:} false; then : + if test $ol_cv_pthread_threads = yes ; then + ol_link_pthreads="-threads" + ol_link_threads=posix + fi +fi + + + # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r) +if test "$ol_link_threads" = no ; then + # try -lpthreads -lmach -lexc -lc_r + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 +$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; } +if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lmach -lexc -lc_r $LIBS" + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + +int +main () +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes else - if test "$ac_cv_type_time_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (time_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_time_t=0 - fi + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 -$as_echo "$ac_cv_sizeof_time_t" >&6; } +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} -cat >>confdefs.h <<_ACEOF -#define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes +else + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + # restore the LIBS + LIBS="$ol_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5 +$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; } + if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then + ol_link_pthreads="-lpthreads -lmach -lexc -lc_r" + ol_link_threads=posix + fi +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : + # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc) +if test "$ol_link_threads" = no ; then + # try -lpthreads -lmach -lexc + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5 +$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; } +if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lmach -lexc $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> -#include <time.h> + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { -struct tm tm; - int *p = &tm.tm_sec; - return !p; + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthreads_lmach_lexc=yes else - ac_cv_struct_tm=sys/time.h + ol_cv_pthread_lpthreads_lmach_lexc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthreads_lmach_lexc=yes +else + ol_cv_pthread_lpthreads_lmach_lexc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + + # restore the LIBS + LIBS="$ol_LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5 +$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; } + if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then + ol_link_pthreads="-lpthreads -lmach -lexc" + ol_link_threads=posix + fi +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int8_t" >&5 -$as_echo_n "checking for u_int8_t... " >&6; } -if ${ntp_cv_type_u_int8_t+:} false; then : + # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc) +if test "$ol_link_threads" = no ; then + # try -lpthreads -lexc + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5 +$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; } +if ${ol_cv_pthread_lpthreads_lexc+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lexc $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { - u_int8_t len = 42; + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_type_u_int8_t=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lpthreads_lexc=yes else - ntp_cv_type_u_int8_t=no + ol_cv_pthread_lpthreads_lexc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lpthreads_lexc=yes +else + ol_cv_pthread_lpthreads_lexc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + # restore the LIBS + LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int8_t" >&5 -$as_echo "$ntp_cv_type_u_int8_t" >&6; } -case "$ntp_cv_type_u_int8_t" in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5 +$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; } -$as_echo "#define HAVE_TYPE_U_INT8_T 1" >>confdefs.h + if test $ol_cv_pthread_lpthreads_lexc = yes ; then + ol_link_pthreads="-lpthreads -lexc" + ol_link_threads=posix + fi +fi -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t" >&5 -$as_echo_n "checking for u_int64_t... " >&6; } -if ${ntp_cv_type_u_int64_t+:} false; then : + # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads) +if test "$ol_link_threads" = no ; then + # try -lpthreads + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5 +$as_echo_n "checking for pthread link with -lpthreads... " >&6; } +if ${ol_cv_pthread_lib_lpthreads+:} false; then : $as_echo_n "(cached) " >&6 else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads $LIBS" + + if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} int main () { - u_int64_t len = 42; + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_type_u_int64_t=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_pthread_lib_lpthreads=yes else - ntp_cv_type_u_int64_t=no - + ol_cv_pthread_lib_lpthreads=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int64_t" >&5 -$as_echo "$ntp_cv_type_u_int64_t" >&6; } -case "$ntp_cv_type_u_int64_t" in - yes) -$as_echo "#define HAVE_TYPE_U_INT64_T 1" >>confdefs.h +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif -esac +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5 -$as_echo_n "checking for a fallback value for HZ... " >&6; } -if ${ntp_cv_default_hz+:} false; then : - $as_echo_n "(cached) " >&6 + +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; + +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_lib_lpthreads=yes else + ol_cv_pthread_lib_lpthreads=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - ntp_cv_default_hz=100 - case "$host" in - alpha*-dec-osf4*|alpha*-dec-osf5*) - ntp_cv_default_hz=1024 - ;; - mips-dec-ultrix4*) - ntp_cv_default_hz=256 - ;; - esac + # restore the LIBS + LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5 -$as_echo "$ntp_cv_default_hz" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5 +$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; } -cat >>confdefs.h <<_ACEOF -#define DEFAULT_HZ $ntp_cv_default_hz + if test $ol_cv_pthread_lib_lpthreads = yes ; then + ol_link_pthreads="-lpthreads" + ol_link_threads=posix + fi +fi + + + if test $ol_link_threads != no ; then + LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + + for ac_func in sched_yield pthread_yield thr_yield +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5 -$as_echo_n "checking if we need to override the system's value for HZ... " >&6; } -if ${ntp_cv_override_hz+:} false; then : + + if test $ac_cv_func_sched_yield = no && + test $ac_cv_func_pthread_yield = no && + test $ac_cv_func_thr_yield = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 +$as_echo_n "checking for sched_yield in -lrt... " >&6; } +if ${ac_cv_lib_rt_sched_yield+:} false; then : $as_echo_n "(cached) " >&6 else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ntp_cv_override_hz=no - case "$host" in - alpha*-dec-osf4*|alpha*-dec-osf5*) - ntp_cv_override_hz=yes - ;; - mips-dec-ultrix4*) - ntp_cv_override_hz=yes - ;; - *-*-freebsd*) - ntp_cv_override_hz=yes - ;; - *-*-sunos4*) - ntp_cv_override_hz=yes - ;; - *-*-kfreebsd*) - ntp_cv_override_hz=yes - ;; - esac +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_sched_yield=yes +else + ac_cv_lib_rt_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 +$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } +if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : + LTHREAD_LIBS="$LTHREAD_LIBS -lrt" +$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h + ac_cv_func_sched_yield=yes +else + ac_cv_func_sched_yield=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5 -$as_echo "$ntp_cv_override_hz" >&6; } -case "$ntp_cv_override_hz" in - yes) -$as_echo "#define OVERRIDE_HZ 1" >>confdefs.h + fi + if test $ac_cv_func_sched_yield = no && + test $ac_cv_func_pthread_yield = no && + test "$ac_cv_func_thr_yield" = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5 +$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;} + fi -esac + for ac_func in pthread_kill +do : + ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" +if test "x$ac_cv_func_pthread_kill" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_KILL 1 +_ACEOF +fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5 -$as_echo_n "checking for struct rt_msghdr... " >&6; } -if ${ntp_cv_struct_rt_msghdr+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5 +$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; } +if ${ol_cv_func_pthread_rwlock_destroy+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/types.h> - #include <sys/socket.h> - #include <net/if.h> - #include <net/route.h> +#include <pthread.h> +pthread_rwlock_t rwlock; int main () { +pthread_rwlock_destroy(&rwlock); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_func_pthread_rwlock_destroy=yes +else + ol_cv_func_pthread_rwlock_destroy=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - struct rt_msghdr p; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5 +$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; } + if test $ol_cv_func_pthread_rwlock_destroy = yes ; then + +$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5 +$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; } +if ${ol_cv_func_pthread_detach+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <pthread.h> +#ifndef NULL +#define NULL (void*)0 +#endif + +int +main () +{ +pthread_detach(NULL); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_rt_msghdr=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_func_pthread_detach=yes else - ntp_cv_struct_rt_msghdr=no + ol_cv_func_pthread_detach=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5 +$as_echo "$ol_cv_func_pthread_detach" >&6; } + + if test $ol_cv_func_pthread_detach = no ; then + as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5 + fi + + +$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h + + + for ac_func in \ + pthread_setconcurrency \ + pthread_getconcurrency \ + thr_setconcurrency \ + thr_getconcurrency \ + +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5 -$as_echo "$ntp_cv_struct_rt_msghdr" >&6; } +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5 -$as_echo_n "checking for struct rtattr... " >&6; } -if ${ntp_cv_rtattr+:} false; then : + + + for ac_func in pthread_kill_other_threads_np +do : + ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np" +if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1 +_ACEOF + +fi +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5 +$as_echo_n "checking for LinuxThreads implementation... " >&6; } +if ${ol_cv_sys_linux_threads+:} false; then : $as_echo_n "(cached) " >&6 else + ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5 +$as_echo "$ol_cv_sys_linux_threads" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5 +$as_echo_n "checking for LinuxThreads consistency... " >&6; } +if ${ol_cv_linux_threads+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ol_cv_header_linux_threads = yes && + test $ol_cv_sys_linux_threads = yes; then + ol_cv_linux_threads=yes + elif test $ol_cv_header_linux_threads = no && + test $ol_cv_sys_linux_threads = no; then + ol_cv_linux_threads=no + else + ol_cv_linux_threads=error + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5 +$as_echo "$ol_cv_linux_threads" >&6; } + + + if test $ol_cv_linux_threads = error; then + as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5; + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5 +$as_echo_n "checking if pthread_create() works... " >&6; } +if ${ol_cv_pthread_create_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + ol_cv_pthread_create_works=yes +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <stddef.h> - #include <sys/socket.h> - #include <linux/rtnetlink.h> -int -main () +/* pthread test headers */ +#include <pthread.h> +#if HAVE_PTHREADS < 7 +#include <errno.h> +#endif +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; { + return (void *) (p == NULL); +} - struct rtattr p; +int main(argc, argv) + int argc; + char **argv; +{ + + /* pthread test function */ +#ifndef PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED 1 +#endif + pthread_t t; + int status; + int detach = PTHREAD_CREATE_DETACHED; + +#if HAVE_PTHREADS > 4 + /* Final pthreads */ + pthread_attr_t attr; + + status = pthread_attr_init(&attr); + if( status ) return status; + +#if HAVE_PTHREADS < 7 + status = pthread_attr_setdetachstate(&attr, &detach); + if( status < 0 ) status = errno; +#else + status = pthread_attr_setdetachstate(&attr, detach); +#endif + if( status ) return status; + status = pthread_create( &t, &attr, task, NULL ); +#if HAVE_PTHREADS < 7 + if( status < 0 ) status = errno; +#endif + if( status ) return status; +#else + /* Draft 4 pthreads */ + status = pthread_create( &t, pthread_attr_default, task, NULL ); + if( status ) return errno; + + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( &t ); + if( status ) return errno; +#endif + +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + + return 0; - ; - return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_rtattr=yes +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_create_works=yes else - ntp_cv_rtattr=no - + ol_cv_pthread_create_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5 -$as_echo "$ntp_cv_rtattr" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5 +$as_echo "$ol_cv_pthread_create_works" >&6; } -case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in - *yes*) + if test $ol_cv_pthread_create_works = no ; then + as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5 + fi -$as_echo "#define HAS_ROUTING_SOCKET 1" >>confdefs.h + ol_replace_broken_yield=no - case "$ntp_cv_rtattr" in - yes) + if test $ol_replace_broken_yield = yes ; then -$as_echo "#define HAVE_RTNETLINK 1" >>confdefs.h +$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h - esac -esac + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5 -$as_echo_n "checking struct sigaction for sa_sigaction... " >&6; } -if ${ntp_cv_struct_sigaction_has_sa_sigaction+:} false; then : + if test x$ol_with_yielding_select = xauto ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5 +$as_echo_n "checking if select yields when using pthreads... " >&6; } +if ${ol_cv_pthread_select_yields+:} false; then : $as_echo_n "(cached) " >&6 else + + if test "$cross_compiling" = yes; then : + ol_cv_pthread_select_yields=cross +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <signal.h> +#include <sys/types.h> +#include <sys/time.h> +#include <unistd.h> +#include <pthread.h> +#ifndef NULL +#define NULL (void*) 0 +#endif -int -main () +static int fildes[2]; + +static void *task(p) + void *p; { + int i; + struct timeval tv; - struct sigaction act; - act.sa_sigaction = 0; + fd_set rfds; + tv.tv_sec=10; + tv.tv_usec=0; - ; - return 0; + FD_ZERO(&rfds); + FD_SET(fildes[0], &rfds); + + /* we're not interested in any fds */ + i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv); + + if(i < 0) { + perror("select"); + exit(10); + } + + exit(0); /* if we exit here, the select blocked the whole process */ +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; + + /* create a pipe to select */ + if(pipe(&fildes[0])) { + perror("select"); + exit(1); + } + +#ifdef HAVE_PTHREAD_SETCONCURRENCY + (void) pthread_setconcurrency(2); +#else +#ifdef HAVE_THR_SETCONCURRENCY + /* Set Solaris LWP concurrency to 2 */ + thr_setconcurrency(2); +#endif +#endif + +#if HAVE_PTHREADS < 6 + pthread_create(&t, pthread_attr_default, task, NULL); +#else + pthread_create(&t, NULL, task, NULL); +#endif + + /* make sure task runs first */ +#ifdef HAVE_THR_YIELD + thr_yield(); +#elif defined( HAVE_SCHED_YIELD ) + sched_yield(); +#elif defined( HAVE_PTHREAD_YIELD ) + pthread_yield(); +#endif + + exit(2); } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_sigaction_has_sa_sigaction=yes +if ac_fn_c_try_run "$LINENO"; then : + ol_cv_pthread_select_yields=no else - ntp_cv_struct_sigaction_has_sa_sigaction=no - + ol_cv_pthread_select_yields=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5 -$as_echo "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; } -case "$ntp_cv_struct_sigaction_has_sa_sigaction" in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5 +$as_echo "$ol_cv_pthread_select_yields" >&6; } -$as_echo "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h + if test $ol_cv_pthread_select_yields = cross ; then + as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5 + fi + if test $ol_cv_pthread_select_yields = yes ; then + ol_with_yielding_select=yes + fi + fi + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5 + fi + fi + + if test $ol_with_threads = posix ; then + as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5 + fi + ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5 -$as_echo_n "checking for struct ppsclockev... " >&6; } -if ${ntp_cv_struct_ppsclockev+:} false; then : +case $ol_with_threads in auto | yes | mach) + + for ac_header in mach/cthreads.h cthreads.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_mach_cthreads_h = yes ; then + ol_with_threads=found + + ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" +if test "x$ac_cv_func_cthread_fork" = xyes; then : + ol_link_threads=yes +fi + + + if test $ol_link_threads = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5 +$as_echo_n "checking for cthread_fork with -all_load... " >&6; } +if ${ol_cv_cthread_all_load+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_TERMIOS_H - # include <sys/termios.h> - #endif - #ifdef HAVE_SYS_TIME_H - # include <sys/time.h> - #endif - #ifdef HAVE_SYS_PPSCLOCK_H - # include <sys/ppsclock.h> - #endif + save_LIBS="$LIBS" + LIBS="-all_load $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <mach/cthreads.h> int main () { - extern struct ppsclockev *pce; - return pce->serial; - + cthread_fork((void *)0, (void *)0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_ppsclockev=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_cthread_all_load=yes else - ntp_cv_struct_ppsclockev=no + ol_cv_cthread_all_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5 +$as_echo "$ol_cv_cthread_all_load" >&6; } + + if test $ol_cv_cthread_all_load = yes ; then + LTHREAD_LIBS="$LTHREAD_LIBS -all_load" + ol_link_threads=mach + ol_with_threads=found + fi + fi + + elif test $ac_cv_header_cthreads_h = yes ; then + ol_with_threads=found + + save_LIBS="$LIBS" + LIBS="$LIBS -lthreads" + ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" +if test "x$ac_cv_func_cthread_fork" = xyes; then : + ol_link_threads=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5 -$as_echo "$ntp_cv_struct_ppsclockev" >&6; } -case "$ntp_cv_struct_ppsclockev" in - yes) -$as_echo "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h + LIBS="$save_LIBS" + + if test $ol_link_threads = yes ; then + LTHREAD_LIBS="-lthreads" + ol_link_threads=mach + ol_with_threads=found + else + as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5 + fi + + elif test $ol_with_threads = mach ; then + as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5 + fi + + if test $ol_link_threads = mach ; then +$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h + + elif test $ol_with_threads = found ; then + as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5 + fi + ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 -$as_echo_n "checking for struct sockaddr_storage... " >&6; } -if ${ntp_cv_sockaddr_storage+:} false; then : +case $ol_with_threads in auto | yes | pth) + + for ac_header in pth.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default" +if test "x$ac_cv_header_pth_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTH_H 1 +_ACEOF + +fi + +done + + + if test $ac_cv_header_pth_h = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5 +$as_echo_n "checking for pth_version in -lpth... " >&6; } +if ${ac_cv_lib_pth_pth_version+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpth $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif - #ifdef HAVE_NETINET_IN_H - # include <netinet/in.h> - #endif - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pth_version (); int main () { - - struct sockaddr_storage n; - - +return pth_version (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_sockaddr_storage=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pth_pth_version=yes else - ntp_cv_sockaddr_storage=no - + ac_cv_lib_pth_pth_version=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5 +$as_echo "$ac_cv_lib_pth_pth_version" >&6; } +if test "x$ac_cv_lib_pth_pth_version" = xyes; then : + have_pth=yes +else + have_pth=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5 -$as_echo "$ntp_cv_sockaddr_storage" >&6; } -case "$ntp_cv_sockaddr_storage" in - yes) -$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + if test $have_pth = yes ; then + +$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h + + LTHREAD_LIBS="$LTHREAD_LIBS -lpth" + ol_link_threads=pth + ol_with_threads=found + + if test x$ol_with_yielding_select = xauto ; then + ol_with_yielding_select=yes + fi + fi + fi + ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_family" >&5 -$as_echo_n "checking for sockaddr_storage.ss_family... " >&6; } -if ${ntp_cv_have_ss_family+:} false; then : +case $ol_with_threads in auto | yes | lwp) + + for ac_header in thread.h synch.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_thread_h = yes && + test $ac_cv_header_synch_h = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } +if ${ac_cv_lib_thread_thr_create+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif - #ifdef HAVE_NETINET_IN_H - # include <netinet/in.h> - #endif - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char thr_create (); int main () { +return thr_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_thread_thr_create=yes +else + ac_cv_lib_thread_thr_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = xyes; then : + have_thr=yes +else + have_thr=no +fi + - struct sockaddr_storage s; - s.ss_family = 1; + if test $have_thr = yes ; then +$as_echo "#define HAVE_THR 1" >>confdefs.h + LTHREAD_LIBS="$LTHREAD_LIBS -lthread" + ol_link_threads=thr + + if test x$ol_with_yielding_select = xauto ; then + ol_with_yielding_select=yes + fi + + for ac_func in \ + thr_setconcurrency \ + thr_getconcurrency \ + +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + fi + fi + + for ac_header in lwp/lwp.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" +if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LWP_LWP_H 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_lwp_lwp_h = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5 +$as_echo_n "checking for lwp_create in -llwp... " >&6; } +if ${ac_cv_lib_lwp_lwp_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llwp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lwp_create (); +int +main () +{ +return lwp_create (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_have_ss_family=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lwp_lwp_create=yes +else + ac_cv_lib_lwp_lwp_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5 +$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; } +if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then : + have_lwp=yes else - ntp_cv_have_ss_family=no + have_lwp=no +fi + + + if test $have_lwp = yes ; then + +$as_echo "#define HAVE_LWP 1" >>confdefs.h + + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + ol_link_threads=lwp + + if test x$ol_with_yielding_select = xauto ; then + ol_with_yielding_select=no + fi + fi + fi + ;; +esac + +if test $ol_with_yielding_select = yes ; then + +$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ol_with_threads = manual ; then + ol_link_threads=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5 +$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;} + + for ac_header in pthread.h sched.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_family" >&5 -$as_echo "$ntp_cv_have_ss_family" >&6; } -case "$ntp_cv_have_ss_family" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5 -$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; } -if ${ntp_cv_have___ss_family+:} false; then : +done + + for ac_func in sched_yield pthread_yield +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 +$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } +if ${ol_cv_header_linux_threads+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <pthread.h> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : + ol_cv_header_linux_threads=yes +else + ol_cv_header_linux_threads=no +fi +rm -f conftest* - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif - #ifdef HAVE_NETINET_IN_H - # include <netinet/in.h> - #endif +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 +$as_echo "$ol_cv_header_linux_threads" >&6; } + if test $ol_cv_header_linux_threads = yes; then + +$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h + + fi + + + for ac_header in mach/cthreads.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_cthreads_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MACH_CTHREADS_H 1 +_ACEOF + +fi + +done + + for ac_header in lwp/lwp.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" +if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LWP_LWP_H 1 +_ACEOF + +fi + +done + + for ac_header in thread.h synch.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +fi + +if test $ol_link_threads != no && test $ol_link_threads != nt ; then + +$as_echo "#define REENTRANT 1" >>confdefs.h + + +$as_echo "#define _REENTRANT 1" >>confdefs.h + + +$as_echo "#define THREAD_SAFE 1" >>confdefs.h + + +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h + + +$as_echo "#define THREADSAFE 1" >>confdefs.h + + +$as_echo "#define _THREADSAFE 1" >>confdefs.h + + +$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5 +$as_echo_n "checking for thread specific errno... " >&6; } +if ${ol_cv_errno_thread_specific+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> int main () { +errno = 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_errno_thread_specific=yes +else + ol_cv_errno_thread_specific=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - struct sockaddr_storage s; - s.__ss_family = 1; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5 +$as_echo "$ol_cv_errno_thread_specific" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5 +$as_echo_n "checking for thread specific h_errno... " >&6; } +if ${ol_cv_h_errno_thread_specific+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <netdb.h> +int +main () +{ +h_errno = 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_have___ss_family=yes +if ac_fn_c_try_link "$LINENO"; then : + ol_cv_h_errno_thread_specific=yes else - ntp_cv_have___ss_family=no + ol_cv_h_errno_thread_specific=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5 +$as_echo "$ol_cv_h_errno_thread_specific" >&6; } + + if test $ol_cv_errno_thread_specific != yes || + test $ol_cv_h_errno_thread_specific != yes ; then + LIBS="$LTHREAD_LIBS $LIBS" + LTHREAD_LIBS="" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5 -$as_echo "$ntp_cv_have___ss_family" >&6; } - case "$ntp_cv_have___ss_family" in + +if test $ol_link_threads = no ; then + if test $ol_with_threads = yes ; then + as_fn_error $? "no suitable thread support" "$LINENO" 5 + fi + + if test $ol_with_threads = auto ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5 +$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;} + ol_with_threads=no + fi + + +$as_echo "#define NO_THREADS 1" >>confdefs.h + + LTHREAD_LIBS="" + BUILD_THREAD=no +else + BUILD_THREAD=yes +fi + +if test $ol_link_threads != no ; then + +$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h + +fi + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +case "$ol_with_threads" in + no) + ol_pthread_ok=no + + ;; + *) + ol_found_pthreads=yes + ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + case "$ol_found_pthreads" in yes) + saved_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + saved_CFLAGS="$CFLAGS" + CFLAGS="$PTHREAD_CFLAGS $CFLAGS" + for ac_func in sem_timedwait +do : + ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" +if test "x$ac_cv_func_sem_timedwait" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEM_TIMEDWAIT 1 +_ACEOF -$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h +fi +done + + LIBS="$saved_LIBS" + { saved_LIBS=; unset saved_LIBS;} + CFLAGS="$saved_CFLAGS" + { saved_CFLAGS=; unset saved_CFLAGS;} + case "$ac_cv_func_sem_timedwait" in + yes) + PTHREAD_LIBS="$LTHREAD_LIBS" + have_pthreads=yes + # Bug 2332: With GCC we need to force a reference to libgcc_s + # (if libgcc_s exists) or the combination of + # threads + setuid + mlockall does not work on linux because + # thread cancellation fails to load libgcc_s with dlopen(). + # We have to pass this all as linker options to avoid argument + # reordering by libtool. + case "$GCC$with_gnu_ld" in + yesyes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -lgcc_s" >&5 +$as_echo_n "checking for exit in -lgcc_s... " >&6; } +if ${ac_cv_lib_gcc_s_exit+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgcc_s $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char exit (); +int +main () +{ +return exit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gcc_s_exit=yes +else + ac_cv_lib_gcc_s_exit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcc_s_exit" >&5 +$as_echo "$ac_cv_lib_gcc_s_exit" >&6; } +if test "x$ac_cv_lib_gcc_s_exit" = xyes; then : + PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed" +fi + ;; + esac + esac esac esac +case "$have_pthreads" in + yes) + CFLAGS_NTP="$CFLAGS_NTP $PTHREAD_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + saved_CFLAGS="$CFLAGS" + CFLAGS="$PTHREAD_CFLAGS $CFLAGS" + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } +if ${ac_cv_sizeof_pthread_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " + $ac_includes_default + #include <pthread.h> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_len" >&5 -$as_echo_n "checking for sockaddr_storage.ss_len... " >&6; } -if ${ntp_cv_have_ss_len+:} false; then : +"; then : + +else + if test "$ac_cv_type_pthread_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (pthread_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_pthread_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t +_ACEOF + + + LIBISC_PTHREADS_NOTHREADS=pthreads + +$as_echo "#define ISC_PLATFORM_USETHREADS 1" >>confdefs.h + + # + # We'd like to use sigwait() too + # + ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait" +if test "x$ac_cv_func_sigwait" = xyes; then : + have_sigwait=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc" >&5 +$as_echo_n "checking for sigwait in -lc... " >&6; } +if ${ac_cv_lib_c_sigwait+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif - #ifdef HAVE_NETINET_IN_H - # include <netinet/in.h> - #endif +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sigwait (); +int +main () +{ +return sigwait (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_sigwait=yes +else + ac_cv_lib_c_sigwait=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sigwait" >&5 +$as_echo "$ac_cv_lib_c_sigwait" >&6; } +if test "x$ac_cv_lib_c_sigwait" = xyes; then : + have_sigwait=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lpthread" >&5 +$as_echo_n "checking for sigwait in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_sigwait+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sigwait (); int main () { +return sigwait (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_sigwait=yes +else + ac_cv_lib_pthread_sigwait=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_sigwait" >&5 +$as_echo "$ac_cv_lib_pthread_sigwait" >&6; } +if test "x$ac_cv_lib_pthread_sigwait" = xyes; then : + have_sigwait=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Psigwait in -lpthread" >&5 +$as_echo_n "checking for _Psigwait in -lpthread... " >&6; } +if ${ac_cv_lib_pthread__Psigwait+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _Psigwait (); +int +main () +{ +return _Psigwait (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread__Psigwait=yes +else + ac_cv_lib_pthread__Psigwait=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread__Psigwait" >&5 +$as_echo "$ac_cv_lib_pthread__Psigwait" >&6; } +if test "x$ac_cv_lib_pthread__Psigwait" = xyes; then : + have_sigwait=yes +else + have_sigwait=no + +fi + + +fi - struct sockaddr_storage s; - s.ss_len = 1; +fi + + +fi + case "$host:$have_sigwait" in + *-freebsd*:no) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc_r" >&5 +$as_echo_n "checking for sigwait in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_sigwait+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sigwait (); +int +main () +{ +return sigwait (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_have_ss_len=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_r_sigwait=yes else - ntp_cv_have_ss_len=no + ac_cv_lib_c_r_sigwait=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_sigwait" >&5 +$as_echo "$ac_cv_lib_c_r_sigwait" >&6; } +if test "x$ac_cv_lib_c_r_sigwait" = xyes; then : + have_sigwait=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + esac + case "$have_sigwait" in + yes) + ac_cv_func_sigwait=yes + +$as_echo "#define HAVE_SIGWAIT 1" >>confdefs.h + + esac + + for ac_func in pthread_attr_getstacksize +do : + ac_fn_c_check_func "$LINENO" "pthread_attr_getstacksize" "ac_cv_func_pthread_attr_getstacksize" +if test "x$ac_cv_func_pthread_attr_getstacksize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 +_ACEOF + +fi +done + + for ac_func in pthread_attr_setstacksize sysconf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_len" >&5 -$as_echo "$ntp_cv_have_ss_len" >&6; } +done -case "$ntp_cv_have_ss_len" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_len" >&5 -$as_echo_n "checking for sockaddr_storage.__ss_len... " >&6; } -if ${ntp_cv_have___ss_len+:} false; then : + + case "$host" in + *-freebsd5.[012]|*-freebsd5.[012].*) + ;; + *-freebsd5.[3456789]|*-freebsd5.[3456789].*|*-freebsd6.*) + +$as_echo "#define NEED_PTHREAD_SCOPE_SYSTEM 1" >>confdefs.h + + ;; + *-bsdi3.*|*-bsdi4.0*) + +$as_echo "#define NEED_PTHREAD_INIT 1" >>confdefs.h + + ;; + *-linux*) + +$as_echo "#define HAVE_LINUXTHREADS 1" >>confdefs.h + + ;; + *-solaris*) + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + for ac_func in pthread_setconcurrency +do : + ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency" +if test "x$ac_cv_func_pthread_setconcurrency" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_SETCONCURRENCY 1 +_ACEOF + +fi +done + + case "$ac_cv_func_pthread_setconcurrency" in + yes) + +$as_echo "#define CALL_PTHREAD_SETCONCURRENCY 1" >>confdefs.h + + esac + ;; + *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) + +$as_echo "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h + + ;; + esac + hack_shutup_pthreadonceinit=no + case "$host" in + *-aix5.[123].*) + hack_shutup_pthreadonceinit=yes + ;; + *-solaris2.[89]) + hack_shutup_pthreadonceinit=yes + ;; + *-solaris2.1[0-9]) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if extra braces are needed for PTHREAD_ONCE_INIT" >&5 +$as_echo_n "checking if extra braces are needed for PTHREAD_ONCE_INIT... " >&6; } +if ${ntp_cv_braces_around_pthread_once_init+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif - #ifdef HAVE_NETINET_IN_H - # include <netinet/in.h> - #endif + #include <pthread.h> int main () { - struct sockaddr_storage s; - s.__ss_len = 1; + static pthread_once_t once_test = + PTHREAD_ONCE_INIT; ; @@ -18479,134 +26943,511 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_have___ss_len=yes + ntp_cv_braces_around_pthread_once_init=no else - ntp_cv_have___ss_len=no + ntp_cv_braces_around_pthread_once_init=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_len" >&5 -$as_echo "$ntp_cv_have___ss_len" >&6; } - case "$ntp_cv_have___ss_len" in +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_braces_around_pthread_once_init" >&5 +$as_echo "$ntp_cv_braces_around_pthread_once_init" >&6; } + case "$ntp_cv_braces_around_pthread_once_init" in + yes) + hack_shutup_pthreadonceinit=yes + esac + ;; + esac + case "$hack_shutup_pthreadonceinit" in yes) -$as_echo "#define HAVE___SS_LEN_IN_SS 1" >>confdefs.h +$as_echo "#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" >>confdefs.h esac + LIBS="$saved_LIBS" + { saved_LIBS=; unset saved_LIBS;} + CFLAGS="$saved_CFLAGS" + { saved_CFLAGS=; unset saved_CFLAGS;} + ;; + *) + LIBISC_PTHREADS_NOTHREADS=nothreads + ;; esac + if test "$have_pthreads" != "no"; then + PTHREADS_TRUE= + PTHREADS_FALSE='#' +else + PTHREADS_TRUE='#' + PTHREADS_FALSE= +fi -# -# Look for in_port_t. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 -$as_echo_n "checking for in_port_t... " >&6; } -if ${isc_cv_have_in_port_t+:} false; then : + + + + + +case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in + no:yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vsnprintf expands \"%m\" to strerror(errno)" >&5 +$as_echo_n "checking if vsnprintf expands \"%m\" to strerror(errno)... " >&6; } +if ${ntp_cv_vsnprintf_percent_m+:} false; then : $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : + ntp_cv_vsnprintf_percent_m=no + +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/types.h> - #include <netinet/in.h> + #include <stdarg.h> + #include <errno.h> + #include <stdio.h> + #include <string.h> + + int call_vsnprintf( + char * dst, + size_t sz, + const char *fmt, + ... + ); + + int call_vsnprintf( + char * dst, + size_t sz, + const char *fmt, + ... + ) + { + va_list ap; + int rc; + + va_start(ap, fmt); + rc = vsnprintf(dst, sz, fmt, ap); + va_end(ap); + + return rc; + } int main () { - in_port_t port = 25; - return (0); + char sbuf[512]; + char pbuf[512]; + int slen; + + strcpy(sbuf, strerror(ENOENT)); + errno = ENOENT; + slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m", + "wrong"); + return strcmp(sbuf, pbuf); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - isc_cv_have_in_port_t=yes +if ac_fn_c_try_run "$LINENO"; then : + ntp_cv_vsnprintf_percent_m=yes else - isc_cv_have_in_port_t=no + ntp_cv_vsnprintf_percent_m=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_vsnprintf_percent_m" >&5 +$as_echo "$ntp_cv_vsnprintf_percent_m" >&6; } + case "$ntp_cv_vsnprintf_percent_m" in + yes) + +$as_echo "#define VSNPRINTF_PERCENT_M 1" >>confdefs.h + + esac +esac + +for ac_header in sys/clockctl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_clockctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_CLOCKCTL_H 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5 -$as_echo "$isc_cv_have_in_port_t" >&6; } -case "$isc_cv_have_in_port_t" in - no) -$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h +done + + +# Check whether --enable-clockctl was given. +if test "${enable_clockctl+set}" = set; then : + enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval +else + ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5 +$as_echo_n "checking if we should use /dev/clockctl... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5 +$as_echo "$ntp_use_dev_clockctl" >&6; } + +for ac_header in sys/capability.h sys/prctl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5 +$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; } + +case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in + yesyes) + case "$host" in + mips-sgi-irix*) + ntp_have_linuxcaps=no + ;; + *) ntp_have_linuxcaps=yes + ;; + esac + ;; + *) + ntp_have_linuxcaps=no + ;; esac -case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in - *yes*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5 -$as_echo_n "checking for struct snd_size... " >&6; } -if ${ntp_cv_struct_snd_size+:} false; then : +# Check whether --enable-linuxcaps was given. +if test "${enable_linuxcaps+set}" = set; then : + enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5 +$as_echo "$ntp_have_linuxcaps" >&6; } + +case "$ntp_have_linuxcaps" in + yes) + +$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h + + LIBS="$LIBS -lcap" + ;; +esac + + +for ac_header in priv.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default" +if test "x$ac_cv_header_priv_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PRIV_H 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have solaris privileges" >&5 +$as_echo_n "checking if we have solaris privileges... " >&6; } + +case "$ac_cv_header_priv_h" in + yes) + case "$host" in + *-solaris*) + ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv" +if test "x$ac_cv_func_setppriv" = xyes; then : + ntp_have_solarisprivs=yes +else + ntp_have_solarisprivs=no + +fi + + ;; + esac +esac + +# Check whether --enable-solarisprivs was given. +if test "${enable_solarisprivs+set}" = set; then : + enableval=$enable_solarisprivs; ntp_have_solarisprivs=$enableval + +fi + + + +case "$ntp_have_solarisprivs" in + yes) + +$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h + +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5 +$as_echo "$ntp_have_solarisprivs" >&6; } + +case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in + *yes*) + +$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h + +esac + +case "$host" in + *-*-darwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5 +$as_echo_n "checking for library containing res_9_init... " >&6; } +if ${ac_cv_search_res_9_init+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef HAVE_MACHINE_SOUNDCARD_H - # include <machine/soundcard.h> - #endif - #ifdef HAVE_SYS_SOUNDCARD_H - # include <sys/soundcard.h> - #endif - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_9_init (); int main () { +return res_9_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' resolv; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_res_9_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_res_9_init+:} false; then : + break +fi +done +if ${ac_cv_search_res_9_init+:} false; then : - extern struct snd_size *ss; - return ss->rec_size; +else + ac_cv_search_res_9_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5 +$as_echo "$ac_cv_search_res_9_init" >&6; } +ac_res=$ac_cv_search_res_9_init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi + ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 +$as_echo_n "checking for library containing res_init... " >&6; } +if ${ac_cv_search_res_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_init (); +int +main () +{ +return res_init (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_snd_size=yes +for ac_lib in '' resolv; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_res_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_res_init+:} false; then : + break +fi +done +if ${ac_cv_search_res_init+:} false; then : + else - ntp_cv_struct_snd_size=no + ac_cv_search_res_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 +$as_echo "$ac_cv_search_res_init" >&6; } +ac_res=$ac_cv_search_res_init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + ;; +esac +for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include <arpa/nameser.h> /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5 -$as_echo "$ntp_cv_struct_snd_size" >&6; } - case "$ntp_cv_struct_snd_size" in - yes) -$as_echo "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h +done - esac -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5 -$as_echo_n "checking struct clockinfo for hz... " >&6; } -if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : +#HMS: Why do we do this check so "early"? +for ac_func in res_init +do : + ac_fn_c_check_func "$LINENO" "res_init" "ac_cv_func_res_init" +if test "x$ac_cv_func_res_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RES_INIT 1 +_ACEOF + +else + for ac_func in __res_init +do : + ac_fn_c_check_func "$LINENO" "__res_init" "ac_cv_func___res_init" +if test "x$ac_cv_func___res_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE___RES_INIT 1 +_ACEOF + +fi +done + +fi +done + + +# We also need -lsocket, but we have tested for that already. +ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" +if test "x$ac_cv_func_inet_ntop" = xyes; then : + +else + +$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes; then : + +else + +$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "$ac_includes_default" +if test "x$ac_cv_type_int32" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT32 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "u_int32" "ac_cv_type_u_int32" "$ac_includes_default" +if test "x$ac_cv_type_u_int32" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_U_INT32 1 +_ACEOF + + +fi + + + + +case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in + no::yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int32 with DNS headers included" >&5 +$as_echo_n "checking for int32 with DNS headers included... " >&6; } +if ${ntp_cv_type_int32_with_dns+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/time.h> + #ifdef HAVE_ARPA_NAMESER_H + # include <arpa/nameser.h> + #endif + #include <resolv.h> int main () { - extern struct clockinfo *pc; - return pc->hz; + size_t cb = sizeof(int32); ; @@ -18614,39 +27455,44 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_clockinfo_has_hz=yes + ntp_cv_type_int32_with_dns=yes else - ntp_cv_struct_clockinfo_has_hz=no + ntp_cv_type_int32_with_dns=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 -$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } -case "$ntp_cv_struct_clockinfo_has_hz" in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_int32_with_dns" >&5 +$as_echo "$ntp_cv_type_int32_with_dns" >&6; } + case "$ntp_cv_type_int32_with_dns" in + yes) -$as_echo "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h +$as_echo "#define HAVE_INT32_ONLY_WITH_DNS 1" >>confdefs.h + esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5 -$as_echo_n "checking struct clockinfo for tickadj... " >&6; } -if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : +case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in + no::yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int32 with DNS headers included" >&5 +$as_echo_n "checking for u_int32 with DNS headers included... " >&6; } +if ${ntp_cv_type_u_int32_with_dns+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/time.h> + #ifdef HAVE_ARPA_NAMESER_H + # include <arpa/nameser.h> + #endif + #include <resolv.h> int main () { - extern struct clockinfo *pc; - return pc->tickadj; + size_t cb = sizeof(u_int32); ; @@ -18654,23 +27500,46 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_struct_clockinfo_has_hz=yes + ntp_cv_type_u_int32_with_dns=yes else - ntp_cv_struct_clockinfo_has_hz=no + ntp_cv_type_u_int32_with_dns=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 -$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } -case "$ntp_cv_struct_clockinfo_has_hz" in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int32_with_dns" >&5 +$as_echo "$ntp_cv_type_u_int32_with_dns" >&6; } + case "$ntp_cv_type_u_int32_with_dns" in + yes) -$as_echo "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h +$as_echo "#define HAVE_U_INT32_ONLY_WITH_DNS 1" >>confdefs.h + esac esac +for ac_header in sys/timepps.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" " + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #ifdef HAVE_ERRNO_H + # include <errno.h> + #endif + + +" +if test "x$ac_cv_header_sys_timepps_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEPPS_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5 $as_echo_n "checking for struct timespec... " >&6; } if ${ntp_cv_struct_timespec+:} false; then : @@ -18759,298 +27628,1087 @@ $as_echo "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h esac -ac_fn_c_check_member "$LINENO" "struct ntptimeval" "time.tv_nsec" "ac_cv_member_struct_ntptimeval_time_tv_nsec" " - #ifdef HAVE_SYS_TIME_H - #include <sys/time.h> - #else - # ifdef HAVE_TIME_H - # include <time.h> - # endif - #endif - #ifdef HAVE_SYS_TIMEX_H - # include <sys/timex.h> - #else - # ifdef HAVE_TIMEX_H - # include <timex.h> - # endif +for ac_header in md5.h +do : + ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" " + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> #endif " -if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes; then : +if test "x$ac_cv_header_md5_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MD5_H 1 +_ACEOF -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1 +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5 +$as_echo_n "checking for library containing MD5Init... " >&6; } +if ${ac_cv_search_MD5Init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char MD5Init (); +int +main () +{ +return MD5Init (); + ; + return 0; +} _ACEOF +for ac_lib in '' md5 md; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_MD5Init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_MD5Init+:} false; then : + break +fi +done +if ${ac_cv_search_MD5Init+:} false; then : +else + ac_cv_search_MD5Init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5 +$as_echo "$ac_cv_search_MD5Init" >&6; } +ac_res=$ac_cv_search_MD5Init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi +for ac_func in MD5Init sysconf getdtablesize sigaction sigset sigvec +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5 +$as_echo_n "checking for SIGIO... " >&6; } +if ${ntp_cv_hdr_def_sigio+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif + + #include <signal.h> + + #ifndef SIGIO + # error + #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw +if ac_fn_c_try_cpp "$LINENO"; then : + ntp_cv_hdr_def_sigio=yes +else + ntp_cv_hdr_def_sigio=no + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done +rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5 +$as_echo "$ntp_cv_hdr_def_sigio" >&6; } -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use SIGIO" >&5 +$as_echo_n "checking if we want to use SIGIO... " >&6; } +ans=no +case "$ntp_cv_hdr_def_sigio" in + yes) + ans=yes + case "$host" in + alpha*-dec-osf4*|alpha*-dec-osf5*) + ans=no + ;; + *-convex-*) + ans=no + ;; + *-dec-*) + ans=no + ;; + *-pc-cygwin*) + ans=no + ;; + *-sni-sysv*) + ans=no + ;; + *-univel-sysv*) + ans=no + ;; + *-*-irix6*) + ans=no + ;; + *-*-freebsd*) + ans=no + ;; + *-*-*linux*) + ans=no + ;; + *-*-unicosmp*) + ans=no + ;; + *-*-kfreebsd*) + ans=no + ;; + m68k-*-mint*) + ans=no + ;; esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF ;; esac +case "$ans" in + yes) +$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h -case "$ac_cv_c_inline" in - '') +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5 +$as_echo_n "checking for SIGPOLL... " >&6; } +if ${ntp_cv_hdr_def_sigpoll+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <signal.h> + + #ifndef SIGPOLL + # error + #endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ntp_cv_hdr_def_sigpoll=yes +else + ntp_cv_hdr_def_sigpoll=no + +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5 +$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5 +$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; } +ans=no +case "$ntp_cv_hdr_def_sigpoll" in + yes) + case "$host" in + mips-sgi-irix*) + ans=no + ;; + vax-dec-bsd) + ans=no + ;; + *-pc-cygwin*) + ans=no + ;; + *-sni-sysv*) + ans=no + ;; + *-*-aix[4-9]*) + # XXX Only verified thru AIX6 + ans=no + ;; + *-*-hpux*) + ans=no + ;; + *-*-*linux*) + ans=no + ;; + *-*-osf*) + ans=no + ;; + *-*-qnx*) + ans=no + ;; + *-*-sunos*) + ans=no + ;; + *-*-solaris*) + ans=no + ;; + *-*-ultrix*) + ans=no + ;; + *-*-unicosmp*) + ans=no + ;; + *-*-kfreebsd*) + ans=no + ;; + *) ans=yes + ;; + esac ;; - *) +esac +case "$ans" in + yes) -$as_echo "#define HAVE_INLINE 1" >>confdefs.h +$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5 +$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; } +ans=no +case "$ntp_cv_hdr_def_sigpoll" in + yes) + case "$host" in + mips-sgi-irix*) + ans=no + ;; + vax-dec-bsd) + ans=no + ;; + *-pc-cygwin*) + ans=no + ;; + *-sni-sysv*) + ans=no + ;; + *-*-aix[4-9]*) + # XXX Only verified thru AIX6 + ans=no + ;; + *-*-hpux*) + ans=no + ;; + *-*-*linux*) + ans=no + ;; + *-*-osf*) + ans=no + ;; + *-*-sunos*) + ans=no + ;; + *-*-ultrix*) + ans=no + ;; + *-*-qnx*) + ans=no + ;; + *-*-unicosmp*) + ans=no + ;; + *-*-kfreebsd*) + ans=no + ;; + *) ans=yes + ;; + esac + ;; esac +case "$ans" in + yes) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } -if ${ac_cv_c_char_unsigned+:} false; then : +$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h + +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5 +$as_echo_n "checking number of arguments to gettimeofday()... " >&6; } +if ${ntp_cv_func_Xettimeofday_nargs+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + + #include <sys/time.h> + int main () { -static int test_array [1 - 2 * !(((char) -1) < 0)]; -test_array [0] = 0 + + gettimeofday(0, 0); + settimeofday(0, 0); + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_char_unsigned=no + ntp_cv_func_Xettimeofday_nargs=2 else - ac_cv_c_char_unsigned=yes + ntp_cv_func_Xettimeofday_nargs=1 + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5 +$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; } +case "$ntp_cv_func_Xettimeofday_nargs" in + 1) + +$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h + +esac + +for ac_func in settimeofday +do : + ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday" +if test "x$ac_cv_func_settimeofday" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETTIMEOFDAY 1 +_ACEOF + +else + + case "$host" in + *-*-mpeix*) ac_cv_func_settimeofday=yes + esac fi - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 -$as_echo_n "checking size of signed char... " >&6; } -if ${ac_cv_sizeof_signed_char+:} false; then : +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5 +$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; } +ntp_warning='GRONK' +ans=none +case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in + yes*) + ntp_warning='' + ans='clock_settime()' + ;; + noyes*) + ntp_warning='But clock_settime() would be better (if we had it)' + ans='settimeofday()' + ;; + nonoyes) + ntp_warning='Which is the worst of the three' + ans='stime()' + ;; + *) + case "$build" in + $host) + ntp_warning='Which leaves us with nothing to use!' + esac +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } +case "$ntp_warning" in + '') + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5 +$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;} + ;; +esac + + +LDADD_LIBNTP="$LDADD_LIBNTP $LIBS" +LIBS=$__LIBS +{ __LIBS=; unset __LIBS;} + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5 +$as_echo_n "checking for deprecated --with-arlib... " >&6; } + +# Check whether --with-arlib was given. +if test "${with_arlib+set}" = set; then : + withval=$with_arlib; ans=$withval +else + ans=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + +case "$ans" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&5 +$as_echo "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&2;} + ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then : + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - if test "$ac_cv_type_signed_char" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (signed char) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_signed_char=0 - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + + test -n "$AWK" && break +done + +{ ac_cv_prog_AWK=; unset ac_cv_prog_AWK;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 -$as_echo "$ac_cv_sizeof_signed_char" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char -_ACEOF -ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default" -if test "x$ac_cv_type_s_char" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi -cat >>confdefs.h <<_ACEOF -#define HAVE_S_CHAR 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} _ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : + + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATH_PERL+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + case $PATH_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_PERL="$PATH_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PATH_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PATH_PERL=$ac_cv_path_PATH_PERL +if test -n "$PATH_PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5 +$as_echo "$PATH_PERL" >&6; } else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + +{ ac_cv_path_PATH_PERL=; unset ac_cv_path_PATH_PERL;} +# Extract the first word of "test", so it can be a program name with args. +set dummy test; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATH_TEST+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATH_TEST in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_TEST="$PATH_TEST" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PATH_TEST="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_TEST=$ac_cv_path_PATH_TEST +if test -n "$PATH_TEST"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5 +$as_echo "$PATH_TEST" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ ac_cv_path_PATH_TEST=; unset ac_cv_path_PATH_TEST;} +test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int + +# Check whether --with-net-snmp-config was given. +if test "${with_net_snmp_config+set}" = set; then : + withval=$with_net_snmp_config; ans=$withval +else + ans=yes + +fi + +case "$ans" in + no) + ;; + yes) + ans=net-snmp-config + ;; + /*) + ;; + */*) + as_fn_error $? "--with-net-snmp-config takes either a name or an absolute path" "$LINENO" 5 + ;; + *) + ;; +esac +PROG_NET_SNMP_CONFIG=$ans +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5 +$as_echo_n "checking for net-snmp-config path... " >&6; } +case "$PROG_NET_SNMP_CONFIG" in + no) ;; + /*) + PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG + ;; + *) + # Extract the first word of "$PROG_NET_SNMP_CONFIG", so it can be a program name with args. +set dummy $PROG_NET_SNMP_CONFIG; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATH_NET_SNMP_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATH_NET_SNMP_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_NET_SNMP_CONFIG="$PATH_NET_SNMP_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PATH_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_NET_SNMP_CONFIG=$ac_cv_path_PATH_NET_SNMP_CONFIG +if test -n "$PATH_NET_SNMP_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 +$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { ac_cv_path_PATH_NET_SNMP_CONFIG=; unset ac_cv_path_PATH_NET_SNMP_CONFIG;} +;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 +$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } + +case "$host" in + *-*-vxworks*) + ac_link="$ac_link $VX_KERNEL" + ;; +esac + +# HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 +$as_echo_n "checking for library containing openlog... " >&6; } +if ${ac_cv_search_openlog+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char openlog (); +int +main () +{ +return openlog (); + ; + return 0; +} _ACEOF +for ac_lib in '' gen syslog; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_openlog=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_openlog+:} false; then : + break +fi +done +if ${ac_cv_search_openlog+:} false; then : + +else + ac_cv_search_openlog=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 +$as_echo "$ac_cv_search_openlog" >&6; } +ac_res=$ac_cv_search_openlog +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : +# XXX library list will be in ac_cv_search_openlog + +# LIBSECCOMP is off by default -- needs testing with all the features +# Please send bug reports to loganaden@gmail.com +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use libseccomp sandboxing (EXPERIMENTAL)" >&5 +$as_echo_n "checking if we want to use libseccomp sandboxing (EXPERIMENTAL)... " >&6; } +# Check whether --enable-libseccomp was given. +if test "${enable_libseccomp+set}" = set; then : + enableval=$enable_libseccomp; ntp_ok=$enableval +else + ntp_ok=no + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +$as_echo "$ntp_ok" >&6; } +case "$ntp_ok" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing seccomp_init" >&5 +$as_echo_n "checking for library containing seccomp_init... " >&6; } +if ${ac_cv_search_seccomp_init+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char seccomp_init (); +int +main () +{ +return seccomp_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' seccomp; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_seccomp_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_seccomp_init+:} false; then : + break +fi +done +if ${ac_cv_search_seccomp_init+:} false; then : else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi + ac_cv_search_seccomp_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_seccomp_init" >&5 +$as_echo "$ac_cv_search_seccomp_init" >&6; } +ac_res=$ac_cv_search_seccomp_init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +$as_echo "#define LIBSECCOMP 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdio.h> + #include <stdlib.h> + #include <errno.h> + #include <sys/prctl.h> + #include <linux/seccomp.h> + + int main(void) + { + int ret; + ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0); + if (ret < 0) { + switch (errno) { + case ENOSYS: + return 1; + case EINVAL: + return 1; + default: + return 1; + } + } + ret = + prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); + if (ret < 0) { + switch (errno) { + case EINVAL: + return 1; + case EFAULT: + return 0; + default: + return 1; + } + } +return 1; +} -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF +if ac_fn_c_try_run "$LINENO"; then : +$as_echo "#define KERN_SECCOMP 1" >>confdefs.h -case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in - *yes) - # We have a typedef for s_char. Might as well believe it... +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + ;; - no0no) - # We have signed chars, can't say 'signed char', no s_char typedef. +esac -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h - ;; - no1no) - # We have signed chars, can say 'signed char', no s_char typedef. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for facilitynames in syslog.h" >&5 +$as_echo_n "checking for facilitynames in syslog.h... " >&6; } +if ${ac_cv_HAVE_SYSLOG_FACILITYNAMES+:} false; then : + $as_echo_n "(cached) " >&6 +else -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ;; - yes0no) - # We have unsigned chars, can't say 'signed char', no s_char typedef. - as_fn_error $? "No way to specify a signed character!" "$LINENO" 5 - ;; - yes1no) - # We have unsigned chars, can say 'signed char', no s_char typedef. +#define SYSLOG_NAMES +#include <stdlib.h> +#include <syslog.h> -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h +int +main () +{ + void *fnames; fnames = facilitynames; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes +else + ac_cv_HAVE_SYSLOG_FACILITYNAMES=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&5 +$as_echo "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&6; } +case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in + yes) +$as_echo "#define HAVE_SYSLOG_FACILITYNAMES 1" >>confdefs.h + + ;; + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No facilitynames in <syslog.h>" >&5 +$as_echo "$as_me: WARNING: No facilitynames in <syslog.h>" >&2;} + ;; + cross) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: facilitynames in <syslog.h> - cross-compiling" >&5 +$as_echo "$as_me: WARNING: facilitynames in <syslog.h> - cross-compiling" >&2;} ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : + + + +case "$host" in + *-*-*linux*) ;; + *-*-osf4*) ;; + *-*-osf5*) ;; + *) + # HMS: Make sure we check for -lrt for clock_* before this... + case "$ac_cv_search_clock_gettime" in + '') as_fn_error $? "Internal Error: Haven't looked for clock_gettime() yet!" "$LINENO" 5 ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_setscheduler" >&5 +$as_echo_n "checking for library containing sched_setscheduler... " >&6; } +if ${ac_cv_search_sched_setscheduler+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_setscheduler (); +int +main () +{ +return sched_setscheduler (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : - ac_cv_type_uid_t=yes -else - ac_cv_type_uid_t=no +for ac_lib in '' rt posix4; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sched_setscheduler=$ac_res fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sched_setscheduler+:} false; then : + break +fi +done +if ${ac_cv_search_sched_setscheduler+:} false; then : +else + ac_cv_search_sched_setscheduler=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_setscheduler" >&5 +$as_echo "$ac_cv_search_sched_setscheduler" >&6; } +ac_res=$ac_cv_search_sched_setscheduler +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define uid_t int" >>confdefs.h +fi + ;; +esac -$as_echo "#define gid_t int" >>confdefs.h +for ac_header in bstring.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default" +if test "x$ac_cv_header_bstring_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BSTRING_H 1 +_ACEOF fi +done -case "$host" in - *-*-aix[456]*) - # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub - # (returning ENOSYS). I didn't check 4.2. If, in the future, - # IBM pulls its thumbs out long enough to implement clock_settime, - # this conditional will need to change. Maybe use AC_TRY_RUN - # instead to try to set the time to itself and check errno. - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : +ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default" +if test "x$ac_cv_header_dns_sd_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRegister" >&5 +$as_echo_n "checking for library containing DNSServiceRegister... " >&6; } +if ${ac_cv_search_DNSServiceRegister+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -19063,16 +28721,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char clock_gettime (); +char DNSServiceRegister (); int main () { -return clock_gettime (); +return DNSServiceRegister (); ; return 0; } _ACEOF -for ac_lib in '' rt; do +for ac_lib in '' dns_sd; do if test -z "$ac_lib"; then ac_res="none required" else @@ -19080,301 +28738,388 @@ for ac_lib in '' rt; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res + ac_cv_search_DNSServiceRegister=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : + if ${ac_cv_search_DNSServiceRegister+:} false; then : break fi done -if ${ac_cv_search_clock_gettime+:} false; then : +if ${ac_cv_search_DNSServiceRegister+:} false; then : else - ac_cv_search_clock_gettime=no + ac_cv_search_DNSServiceRegister=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRegister" >&5 +$as_echo "$ac_cv_search_DNSServiceRegister" >&6; } +ac_res=$ac_cv_search_DNSServiceRegister if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +$as_echo "#define HAVE_DNSREGISTRATION 1" >>confdefs.h + + fi - for ac_func in clock_gettime clock_settime + +fi + + +for ac_header in fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi + done - ;; -esac -for ac_func in daemon + +for ac_header in memory.h netdb.h poll.h do : - ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" -if test "x$ac_cv_func_daemon" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DAEMON 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi + done -for ac_func in finite +for ac_header in sgtty.h stdlib.h string.h termio.h do : - ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite" -if test "x$ac_cv_func_finite" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_FINITE 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else - for ac_func in isfinite +fi + +done + +for ac_header in termios.h timepps.h timex.h unistd.h do : - ac_fn_c_check_func "$LINENO" "isfinite" "ac_cv_func_isfinite" -if test "x$ac_cv_func_isfinite" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_ISFINITE 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isfinite with <math.h>" >&5 -$as_echo_n "checking for isfinite with <math.h>... " >&6; } - _libs=$LIBS - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +done - #include <math.h> -int -main () -{ +case "$host" in + *-*-aix*) + for ac_header in utmpx.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" +if test "x$ac_cv_header_utmpx_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UTMPX_H 1 +_ACEOF - float f = 0.0; - isfinite(f); +fi +done - ; - return 0; -} + case "$ac_cv_header_utmpx_h" in + yes) + ;; + *) + for ac_header in utmp.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" +if test "x$ac_cv_header_utmp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UTMP_H 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ans=yes -else - ans=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$_libs - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } - case "$ans" in - yes) - $as_echo "#define HAVE_ISFINITE 1" >>confdefs.h - esac +done + ;; + esac + ;; + *) + for ac_header in utmp.h utmpx.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi + done + ;; +esac + +# +# On Suns only (so far) getpass() truncates the typed password to 8 +# characters, but getpassphrase() allows up to 257. Most systems' +# getpass() does not truncate, at least not so as to affect ntpq and +# ntpdc password prompts. +# +# So check for getpassphrase(), but only on Sun operating systems. +# +case "$host" in + *-*-sunos*|*-*-solaris*) + for ac_func in getpassphrase +do : + ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase" +if test "x$ac_cv_func_getpassphrase" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPASSPHRASE 1 +_ACEOF fi done +esac + -for ac_func in getbootfile getclock getdtablesize +for ac_header in net/if6.h do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default" +if test "x$ac_cv_header_net_if6_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_NET_IF6_H 1 _ACEOF fi + done +for ac_header in net/route.h +do : + ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" " + #include <sys/types.h> + #include <sys/socket.h> + #include <net/if.h> -# Check whether --enable-getifaddrs was given. -if test "${enable_getifaddrs+set}" = set; then : - enableval=$enable_getifaddrs; want_getifaddrs="$enableval" -else - want_getifaddrs="yes" +" +if test "x$ac_cv_header_net_route_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NET_ROUTE_H 1 +_ACEOF fi +done -case $want_getifaddrs in - yes|glibc) - # - # Do we have getifaddrs() ? - # - case $host in - *-*linux*) - # Some recent versions of glibc support getifaddrs() which does not - # provide AF_INET6 addresses while the function provided by the USAGI - # project handles the AF_INET6 case correctly. We need to avoid - # using the former but prefer the latter unless overridden by - # --enable-getifaddrs=glibc. - case "$want_getifaddrs" in - glibc) - for ac_func in getifaddrs + +for ac_header in netinfo/ni.h do : - ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default" +if test "x$ac_cv_header_netinfo_ni_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 +#define HAVE_NETINFO_NI_H 1 _ACEOF fi + done - ;; - *) - save_LIBS="$LIBS" - LIBS="-L/usr/local/v6/lib $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs in -linet6" >&5 -$as_echo_n "checking for getifaddrs in -linet6... " >&6; } -if ${ac_cv_lib_inet6_getifaddrs+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet6 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +case "$ac_cv_header_netinfo_ni_h" in + yes) -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getifaddrs (); -int -main () -{ -return getifaddrs (); - ; - return 0; -} +$as_echo "#define HAVE_NETINFO 1" >>confdefs.h + +esac +for ac_header in sun/audioio.h sys/audioio.h sys/file.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_inet6_getifaddrs=yes -else - ac_cv_lib_inet6_getifaddrs=no + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +done + +case "$host" in + *-*-sunos4*) + ;; + *) + for ac_header in sys/ioctl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_IOCTL_H 1 +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_getifaddrs" >&5 -$as_echo "$ac_cv_lib_inet6_getifaddrs" >&6; } -if test "x$ac_cv_lib_inet6_getifaddrs" = xyes; then : - ans=yes -else - ans=no + +done + + ;; +esac +for ac_header in sys/ipc.h sys/lock.h sys/mman.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi - case "$ans" in - yes) - LIBS="$LIBS -linet6" - $as_echo "#define HAVE_GETIFADDRS 1" >>confdefs.h +done - ;; - *) - LIBS=${save_LIBS} - ;; - esac - ;; - esac - ;; - esac +# HMS: Check sys/proc.h and sys/resource.h after some others +for ac_header in sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +case "$ac_cv_header_sched_h" in + yes) ;; *) - for ac_func in getifaddrs + for ac_header in sys/sched.h do : - ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sched_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 +#define HAVE_SYS_SCHED_H 1 _ACEOF fi + done ;; esac +# HMS: Check sys/shm.h after some others +for ac_header in sys/select.h sys/signal.h sys/sockio.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5 -$as_echo_n "checking type of socklen arg for getsockname()... " >&6; } -if ${ntp_cv_getsockname_socklen_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi - getsockname_socklen_type_found=no - for getsockname_arg2 in 'struct sockaddr *' 'void *'; do - for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +done - #ifdef HAVE_SYS_TYPES_H - # include <sys/types.h> - #endif - #ifdef HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #endif +# HMS: Checked sys/socket.h earlier +case "$host" in + *-*-netbsd*) + ;; + *) + for ac_header in machine/soundcard.h sys/soundcard.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -int -main () -{ +fi - extern - getsockname(int, $getsockname_arg2, - $ntp_cv_getsockname_socklen_type *); +done + + ;; +esac +for ac_header in sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi - ; - return 0; -} +done + +for ac_header in sys/systune.h sys/termios.h sys/tpro.h sys/wait.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - getsockname_socklen_type_found=yes ; break 2 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done - case "$getsockname_socklen_type_found" in - no) - ntp_cv_getsockname_socklen_type='socklen_t' - esac - { getsockname_arg2=; unset getsockname_arg2;} - { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;} +done + +case "$host" in +*-convex-*) + for ac_header in /sys/sync/queue.h /sys/sync/sema.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5 -$as_echo "$ntp_cv_getsockname_socklen_type" >&6; } -cat >>confdefs.h <<_ACEOF -#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type +done + + ;; +*-*-bsdi*) + for ac_header in machine/inline.h sys/pcl720.h sys/i8253.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -for ac_func in getuid getrusage hstrerror +done + + ;; +esac + +case "$host" in + *-*-solaris2.6) + # Broken... + ;; + *) + for ac_func in ntp_adjtime ntp_gettime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19386,26 +29131,97 @@ _ACEOF fi done -ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" -if test "x$ac_cv_func_gettimeofday" = xyes; then : - -else - -case "$host" in - *-*-mpeix*) ac_cv_func_gettimeofday=yes ;; esac + +case "$host" in + *-*-*linux*) + case "$ac_cv_func_ntp_gettime" in + yes) + ;; + *) + for ac_func in __ntp_gettime +do : + ac_fn_c_check_func "$LINENO" "__ntp_gettime" "ac_cv_func___ntp_gettime" +if test "x$ac_cv_func___ntp_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE___NTP_GETTIME 1 +_ACEOF + fi +done + case "$ac_cv_func___ntp_gettime" in + yes) -# -# Check for if_nametoindex() for IPv6 scoped addresses support -# -case "$host" in - *-hp-hpux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5 -$as_echo_n "checking for library containing if_nametoindex... " >&6; } -if ${ac_cv_search_if_nametoindex+:} false; then : +$as_echo "#define ntp_gettime __ntp_gettime" >>confdefs.h + + +$as_echo "#define HAVE_NTP_GETTIME 1" >>confdefs.h + + esac + ;; + esac + for ac_func in adjtimex +do : + ac_fn_c_check_func "$LINENO" "adjtimex" "ac_cv_func_adjtimex" +if test "x$ac_cv_func_adjtimex" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ADJTIMEX 1 +_ACEOF + +fi +done + + case "$ac_cv_func_adjtimex" in + yes) + +$as_echo "#define ntp_adjtime adjtimex" >>confdefs.h + + +$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h + + have_adjtimex=1 + ;; + *) + for ac_func in __adjtimex +do : + ac_fn_c_check_func "$LINENO" "__adjtimex" "ac_cv_func___adjtimex" +if test "x$ac_cv_func___adjtimex" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE___ADJTIMEX 1 +_ACEOF + +fi +done + + case "$ac_cv_func___adjtimex" in + yes) + +$as_echo "#define ntp_adjtime __adjtimex" >>confdefs.h + + +$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h + + +$as_echo "#define adjtimex __adjtimex" >>confdefs.h + + +$as_echo "#define HAVE_ADJTIMEX 1" >>confdefs.h + + have_adjtimex=1 + esac + ;; + esac +esac +case "$have_adjtimex" in + '') + # nlist stuff is only needed for tickadj. + saved_LIBS="$LIBS" + LIBS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nlist" >&5 +$as_echo_n "checking for library containing nlist... " >&6; } +if ${ac_cv_search_nlist+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -19418,16 +29234,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char if_nametoindex (); +char nlist (); int main () { -return if_nametoindex (); +return nlist (); ; return 0; } _ACEOF -for ac_lib in '' ipv6; do +for ac_lib in '' elf ld mld; do if test -z "$ac_lib"; then ac_res="none required" else @@ -19435,52 +29251,34 @@ for ac_lib in '' ipv6; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_if_nametoindex=$ac_res + ac_cv_search_nlist=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_if_nametoindex+:} false; then : + if ${ac_cv_search_nlist+:} false; then : break fi done -if ${ac_cv_search_if_nametoindex+:} false; then : +if ${ac_cv_search_nlist+:} false; then : else - ac_cv_search_if_nametoindex=no + ac_cv_search_nlist=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5 -$as_echo "$ac_cv_search_if_nametoindex" >&6; } -ac_res=$ac_cv_search_if_nametoindex +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nlist" >&5 +$as_echo "$ac_cv_search_nlist" >&6; } +ac_res=$ac_cv_search_nlist if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -esac -for ac_func in if_nametoindex -do : - ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex" -if test "x$ac_cv_func_if_nametoindex" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IF_NAMETOINDEX 1 -_ACEOF - -fi -done - -case "$ac_cv_func_if_nametoindex" in - yes) - -$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h - -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 -$as_echo_n "checking for library containing inet_ntop... " >&6; } -if ${ac_cv_search_inet_ntop+:} false; then : + # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open" >&5 +$as_echo_n "checking for library containing kvm_open... " >&6; } +if ${ac_cv_search_kvm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -19493,83 +29291,752 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char inet_ntop (); +char kvm_open (); int main () { -return inet_ntop (); +return kvm_open (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' kvm; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib - LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS" + LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_inet_ntop=$ac_res + ac_cv_search_kvm_open=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_inet_ntop+:} false; then : + if ${ac_cv_search_kvm_open+:} false; then : break fi done -if ${ac_cv_search_inet_ntop+:} false; then : +if ${ac_cv_search_kvm_open+:} false; then : else - ac_cv_search_inet_ntop=no + ac_cv_search_kvm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 -$as_echo "$ac_cv_search_inet_ntop" >&6; } -ac_res=$ac_cv_search_inet_ntop +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kvm_open" >&5 +$as_echo "$ac_cv_search_kvm_open" >&6; } +ac_res=$ac_cv_search_kvm_open if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi + # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...' + for ac_header in nlist.h sys/var.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" -if test "x$ac_cv_func_inet_ntop" = xyes; then : +fi + +done + + case "$ac_cv_header_nlist_h" in + yes) + +$as_echo "#define NLIST_STRUCT 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5 +$as_echo_n "checking for n_un in struct nlist... " >&6; } +if ${ntp_cv_struct_nlist_n_un+:} false; then : + $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h + #include <nlist.h> + +int +main () +{ + + struct nlist n; + n.n_un.n_name = 0; + + + ; + return 0; +} + ntp_cv_struct_nlist_n_un=yes +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_nlist_n_un=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" -if test "x$ac_cv_func_inet_pton" = xyes; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5 +$as_echo "$ntp_cv_struct_nlist_n_un" >&6; } + case "$ntp_cv_struct_nlist_n_un" in + yes) + +$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h + + esac + esac + + LDADD_NLIST="$LIBS" + LIBS="$saved_LIBS" + { saved_LIBS=; unset saved_LIBS;} +esac + +for ac_header in sys/proc.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" " + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + +" +if test "x$ac_cv_header_sys_proc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PROC_H 1 +_ACEOF + +fi +done + + +for ac_header in sys/resource.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" " + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + +" +if test "x$ac_cv_header_sys_resource_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_RESOURCE_H 1 +_ACEOF + +fi + +done + + +for ac_header in sys/shm.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" " + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_IPC_H + # include <sys/ipc.h> + #endif + +" +if test "x$ac_cv_header_sys_shm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SHM_H 1 +_ACEOF + +fi + +done + + +for ac_header in sys/timex.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" " + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + +" +if test "x$ac_cv_header_sys_timex_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEX_H 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <signal.h> -$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> -case "$ac_cv_header_kvm_h" in +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5 +$as_echo_n "checking for a fallback value for HZ... " >&6; } +if ${ntp_cv_default_hz+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ntp_cv_default_hz=100 + case "$host" in + alpha*-dec-osf4*|alpha*-dec-osf5*) + ntp_cv_default_hz=1024 + ;; + mips-dec-ultrix4*) + ntp_cv_default_hz=256 + ;; + esac + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5 +$as_echo "$ntp_cv_default_hz" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_HZ $ntp_cv_default_hz +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5 +$as_echo_n "checking if we need to override the system's value for HZ... " >&6; } +if ${ntp_cv_override_hz+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ntp_cv_override_hz=no + case "$host" in + alpha*-dec-osf4*|alpha*-dec-osf5*) + ntp_cv_override_hz=yes + ;; + mips-dec-ultrix4*) + ntp_cv_override_hz=yes + ;; + *-*-freebsd*) + ntp_cv_override_hz=yes + ;; + *-*-sunos4*) + ntp_cv_override_hz=yes + ;; + *-*-kfreebsd*) + ntp_cv_override_hz=yes + ;; + esac + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5 +$as_echo "$ntp_cv_override_hz" >&6; } +case "$ntp_cv_override_hz" in yes) - for ac_func in kvm_open + +$as_echo "#define OVERRIDE_HZ 1" >>confdefs.h + +esac + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5 +$as_echo_n "checking for struct rt_msghdr... " >&6; } +if ${ntp_cv_struct_rt_msghdr+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/types.h> + #include <sys/socket.h> + #include <net/if.h> + #include <net/route.h> + +int +main () +{ + + struct rt_msghdr p; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_rt_msghdr=yes +else + ntp_cv_struct_rt_msghdr=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5 +$as_echo "$ntp_cv_struct_rt_msghdr" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5 +$as_echo_n "checking for struct rtattr... " >&6; } +if ${ntp_cv_rtattr+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stddef.h> + #include <sys/socket.h> + #include <linux/rtnetlink.h> + +int +main () +{ + + struct rtattr p; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_rtattr=yes +else + ntp_cv_rtattr=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5 +$as_echo "$ntp_cv_rtattr" >&6; } + +case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in + *yes*) + +$as_echo "#define HAS_ROUTING_SOCKET 1" >>confdefs.h + + case "$ntp_cv_rtattr" in + yes) + +$as_echo "#define HAVE_RTNETLINK 1" >>confdefs.h + + esac +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5 +$as_echo_n "checking struct sigaction for sa_sigaction... " >&6; } +if ${ntp_cv_struct_sigaction_has_sa_sigaction+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <signal.h> + +int +main () +{ + + struct sigaction act; + act.sa_sigaction = 0; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_sigaction_has_sa_sigaction=yes +else + ntp_cv_struct_sigaction_has_sa_sigaction=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5 +$as_echo "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; } +case "$ntp_cv_struct_sigaction_has_sa_sigaction" in + yes) + +$as_echo "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h + +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5 +$as_echo_n "checking for struct ppsclockev... " >&6; } +if ${ntp_cv_struct_ppsclockev+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_TERMIOS_H + # include <sys/termios.h> + #endif + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #ifdef HAVE_SYS_PPSCLOCK_H + # include <sys/ppsclock.h> + #endif + +int +main () +{ + + extern struct ppsclockev *pce; + return pce->serial; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_ppsclockev=yes +else + ntp_cv_struct_ppsclockev=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5 +$as_echo "$ntp_cv_struct_ppsclockev" >&6; } +case "$ntp_cv_struct_ppsclockev" in + yes) + +$as_echo "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h + +esac + +case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in + *yes*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5 +$as_echo_n "checking for struct snd_size... " >&6; } +if ${ntp_cv_struct_snd_size+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_MACHINE_SOUNDCARD_H + # include <machine/soundcard.h> + #endif + #ifdef HAVE_SYS_SOUNDCARD_H + # include <sys/soundcard.h> + #endif + +int +main () +{ + + extern struct snd_size *ss; + return ss->rec_size; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_snd_size=yes +else + ntp_cv_struct_snd_size=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5 +$as_echo "$ntp_cv_struct_snd_size" >&6; } + case "$ntp_cv_struct_snd_size" in + yes) + +$as_echo "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h + + esac +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5 +$as_echo_n "checking struct clockinfo for hz... " >&6; } +if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/time.h> + +int +main () +{ + + extern struct clockinfo *pc; + return pc->hz; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_clockinfo_has_hz=yes +else + ntp_cv_struct_clockinfo_has_hz=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 +$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } +case "$ntp_cv_struct_clockinfo_has_hz" in + yes) + +$as_echo "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h + +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5 +$as_echo_n "checking struct clockinfo for tickadj... " >&6; } +if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/time.h> + +int +main () +{ + + extern struct clockinfo *pc; + return pc->tickadj; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_struct_clockinfo_has_hz=yes +else + ntp_cv_struct_clockinfo_has_hz=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 +$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } +case "$ntp_cv_struct_clockinfo_has_hz" in + yes) + +$as_echo "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h + +esac + +case "$ntp_cv_struct_ntptimeval" in + yes) + ac_fn_c_check_member "$LINENO" "struct ntptimeval" "time.tv_nsec" "ac_cv_member_struct_ntptimeval_time_tv_nsec" " + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #else + # ifdef HAVE_TIME_H + # include <time.h> + # endif + #endif + #ifdef HAVE_SYS_TIMEX_H + # include <sys/timex.h> + #else + # ifdef HAVE_TIMEX_H + # include <timex.h> + # endif + #endif + + +" +if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1 +_ACEOF + + +fi + +esac + +#### + +saved_LIBS="$LIBS" +LIBS="$LIBS $LDADD_LIBNTP" +for ac_func in daemon do : - ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open" -if test "x$ac_cv_func_kvm_open" = xyes; then : + ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" +if test "x$ac_cv_func_daemon" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_KVM_OPEN 1 +#define HAVE_DAEMON 1 _ACEOF fi done - ;; -esac +# XXX if we keep everything in LIBS and also keep separate lists, this simplifies. +LIBS="$saved_LIBS" +{ saved_LIBS=; unset saved_LIBS;} -for ac_func in memcpy memmove memset +for ac_func in finite +do : + ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite" +if test "x$ac_cv_func_finite" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FINITE 1 +_ACEOF + +else + for ac_func in isfinite +do : + ac_fn_c_check_func "$LINENO" "isfinite" "ac_cv_func_isfinite" +if test "x$ac_cv_func_isfinite" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ISFINITE 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isfinite with <math.h>" >&5 +$as_echo_n "checking for isfinite with <math.h>... " >&6; } + _libs=$LIBS + # XXX + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <math.h> + +int +main () +{ + + float f = 0.0; + isfinite(f); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ans=yes +else + ans=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$_libs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + case "$ans" in + yes) + $as_echo "#define HAVE_ISFINITE 1" >>confdefs.h + + esac + + +fi +done + + +fi +done + + +for ac_func in fnmatch getbootfile getuid getrusage nanosleep strsignal do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19581,9 +30048,27 @@ _ACEOF fi done + +# kvm_open() is only used by tickadj. Also see above. +case "$ac_cv_header_kvm_h" in + yes) + for ac_func in kvm_open +do : + ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open" +if test "x$ac_cv_func_kvm_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_KVM_OPEN 1 +_ACEOF + +fi +done + + ;; +esac + case "$host" in *-*-sco3.2v5.0.*) - # Just stubs. Idiots. + # Just stubs. Sigh. ;; *) for ac_func in mkstemp do : @@ -19610,20 +30095,22 @@ fi done case "$host" in - *-*-aix[456]*) - # Just a stub. Idiots. + *-*-aix[4-9]*) + # XXX only verified thru AIX6. + # Just a stub. Sigh. ;; *-*-irix[45]*) - # Just a stub in "old" Irix. Idiots. - ;; - *-*-*linux*) - # there, but more trouble than it is worth for now (resolver problems) + # Just a stub in "old" Irix. Sigh. ;; +# In the belief that the fix for bug 1223 fixes mlockall() under linux... +# *-*-*linux*) +# # there, but more trouble than it is worth for now (resolver problems) +# ;; *-*-qnx*) - # Apparently there but not working in QNX. Idiots? + # Apparently there but not working in QNX. Sigh? ;; *-*-sco3.2v5.0.*) - # Just a stub. Idiots. + # Just a stub. Sigh. ;; alpha*-dec-osf4*|alpha*-dec-osf5*) # mlockall is there, as a #define calling memlk via <sys/mman.h> @@ -19664,7 +30151,7 @@ done ;; esac -for ac_func in nice nlist +for ac_func in nice plock pututline pututxline readlink rtprio do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19677,10 +30164,27 @@ fi done case "$host" in - *-*-solaris2.6) - # Broken... + *-*-aix[4-9]*) + # XXX only verified thru AIX6. + # Just a stub in AIX 4. Sigh. + ;; + *-*-solaris2.5*) + # Just stubs in solaris2.5. Sigh. + ;; + *) for ac_func in sched_setscheduler +do : + ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" +if test "x$ac_cv_func_sched_setscheduler" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SCHED_SETSCHEDULER 1 +_ACEOF + +fi +done + ;; - *) for ac_func in ntp_adjtime ntp_gettime +esac +for ac_func in setlinebuf setpgid setpriority setsid setvbuf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19692,9 +30196,7 @@ _ACEOF fi done - ;; -esac -for ac_func in plock pututline pututxline readlink recvmsg rtprio +for ac_func in strdup strerror setrlimit strchr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19707,18 +30209,26 @@ fi done case "$host" in - *-*-aix[456]*) - # Just a stub in AIX 4. Idiots. + *-*-aix[4-9]*) + # XXX only verified thru AIX6. + # Just stubs. Sigh. ;; - *-*-solaris2.5*) - # Just stubs in solaris2.5. Idiots. + *-*-netbsd1*) + # Just stubs. Sigh. ;; - *) for ac_func in sched_setscheduler + *-*-netbsdelf1*) + # Just stubs. Sigh. + ;; + *-*-openbsd*) + # Just stubs. Sigh. + ;; + *) + for ac_func in timer_create do : - ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" -if test "x$ac_cv_func_sched_setscheduler" = xyes; then : + ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create" +if test "x$ac_cv_func_timer_create" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_SETSCHEDULER 1 +#define HAVE_TIMER_CREATE 1 _ACEOF fi @@ -19726,98 +30236,195 @@ done ;; esac -for ac_func in setlinebuf setpgid setpriority setsid -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_func in setrlimit -do : - ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit" -if test "x$ac_cv_func_setrlimit" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SETRLIMIT 1 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_MEMLOCK" >&5 +$as_echo_n "checking for RLIMIT_MEMLOCK... " >&6; } +if ${ntp_cv_rlimit_memlock+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #ifdef HAVE_SYS_RESOURCE_H + # include <sys/resource.h> + #endif + +int +main () +{ + + getrlimit(RLIMIT_MEMLOCK, 0); + + + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_rlimit_memlock=yes +else + ntp_cv_rlimit_memlock=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -for ac_func in settimeofday -do : - ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday" -if test "x$ac_cv_func_settimeofday" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SETTIMEOFDAY 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_memlock" >&5 +$as_echo "$ntp_cv_rlimit_memlock" >&6; } +case "$ntp_cv_rlimit_memlock" in + yes) + + HAVE_RLIMIT_MEMLOCK=" memlock 32" +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_STACK" >&5 +$as_echo_n "checking for RLIMIT_STACK... " >&6; } +if ${ntp_cv_rlimit_stack+:} false; then : + $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -case "$host" in - *-*-mpeix*) ac_cv_func_settimeofday=yes - ;; -esac -fi -done + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #ifdef HAVE_SYS_RESOURCE_H + # include <sys/resource.h> + #endif -for ac_func in setvbuf sigaction sigvec sigset sigsuspend stime strchr -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +int +main () +{ + + getrlimit(RLIMIT_STACK, 0); + + + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_rlimit_stack=yes +else + ntp_cv_rlimit_stack=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -for ac_func in sysconf sysctl snprintf strdup strerror strstr timegm -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_stack" >&5 +$as_echo "$ntp_cv_rlimit_stack" >&6; } +case "$ntp_cv_rlimit_stack" in + yes) + + HAVE_RLIMIT_STACK=" stacksize 50" +esac + + + +# HMS: Only if we are doing the MLOCKALL stuff... +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of 4k stack pages" >&5 +$as_echo_n "checking for the default number of 4k stack pages... " >&6; } + +# Check whether --with-stack-limit was given. +if test "${with_stack_limit+set}" = set; then : + withval=$with_stack_limit; ans=$withval +else + ans=yes fi -done -case "$host" in - *-*-aix[456]*) - # Just stubs. Idiots. +case "$ans" in + yes | no) + case "$host" in + *-*-openbsd*) + ans=200 + ;; + *) ans=50 + ;; + esac ;; - *-*-netbsd1*) - # Just stubs. Idiots. + [1-9][0-9]*) ;; - *-*-netbsdelf1*) - # Just stubs. Idiots. + *) as_fn_error $? "\"--with-stack-limit requires an integer argument.\"" "$LINENO" 5 ;; - *-*-openbsd*) - # Just stubs. Idiots. +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DFLT_RLIMIT_STACK $ans +_ACEOF + + +# HMS: only if we have RLIMIT_MEMLOCK +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of megabytes to MEMLOCK" >&5 +$as_echo_n "checking for the default number of megabytes to MEMLOCK... " >&6; } + +# Check whether --with-memlock was given. +if test "${with_memlock+set}" = set; then : + withval=$with_memlock; ans=$withval +else + ans=yes + +fi + +case "$ans" in + yes | no) + ans=32 ;; - *) for ac_func in timer_create timer_settime + [1-9][0-9]*) ;; + *) as_fn_error $? "\"--with-memlock requires an integer argument.\"" "$LINENO" 5 + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DFLT_RLIMIT_MEMLOCK $ans +_ACEOF + + + +# some OSes prefer _exit() in forked children to exit() +for ac_func in _exit do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + ac_fn_c_check_func "$LINENO" "_exit" "ac_cv_func__exit" +if test "x$ac_cv_func__exit" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE__EXIT 1 _ACEOF fi done +ntp_worker_child_exit=exit +case "$ac_cv_func__exit::$host_os" in + yes::netbsd*) + ntp_worker_child_exit=_exit + ;; + yes::openbsd*) + ntp_worker_child_exit=_exit ;; esac -for ac_func in umask uname updwtmp updwtmpx vsnprintf vsprintf + +cat >>confdefs.h <<_ACEOF +#define WORKER_CHILD_EXIT $ntp_worker_child_exit +_ACEOF + + +for ac_func in umask uname updwtmp updwtmpx do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19899,54 +30506,6 @@ $as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h esac esac -case "$host" in - *-*-sunos4*) - -$as_echo "#define SPRINTF_CHAR 1" >>confdefs.h - - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5 -$as_echo_n "checking number of arguments to gettimeofday()... " >&6; } -if ${ntp_cv_func_Xettimeofday_nargs+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <sys/time.h> - -int -main () -{ - - gettimeofday(0, 0); - settimeofday(0, 0); - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_func_Xettimeofday_nargs=2 -else - ntp_cv_func_Xettimeofday_nargs=1 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5 -$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; } -case "$ntp_cv_func_Xettimeofday_nargs" in - 1) - -$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h - -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments taken by setpgrp()" >&5 $as_echo_n "checking number of arguments taken by setpgrp()... " >&6; } if ${ntp_cv_func_setpgrp_nargs+:} false; then : @@ -19991,10 +30550,6 @@ $as_echo "#define HAVE_SETPGRP_0 1" >>confdefs.h esac - -$as_echo "#define QSORT_USES_VOID_P 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to declare 'errno'" >&5 $as_echo_n "checking if we need to declare 'errno'... " >&6; } if ${ntp_cv_decl_errno+:} false; then : @@ -20444,7 +30999,7 @@ if ${ntp_cv_func_ctty_for_f_setown+:} false; then : else case "$host" in - *-*-bsdi23*) + *-*-bsdi[23]*) ans=yes ;; *-*-freebsd*) @@ -20454,10 +31009,10 @@ else # while later versions will fail a ioctl(TIOCSCTTY, 0) call in # some cases and so should not have USE_FSETOWNCTTY. "netbsd" # in $host may be followed by "aout", "ecoff", or "elf". - *-*-netbsd*a-z3.0-8*|*-*-netbsd*a-z0-2.*|*-*-netbsd*a-z3.99.0-7) + *-*-netbsd*[a-z]3.[0-8]*|*-*-netbsd*[a-z][0-2].*|*-*-netbsd*[a-z]3.99.[0-7]) ans=yes ;; - *-*-netbsd3.0-8*|*-*-netbsd0-2.*|*-*-netbsd3.99.0-7) + *-*-netbsd3.[0-8]*|*-*-netbsd[0-2].*|*-*-netbsd3.99.[0-7]) ans=yes ;; *-*-openbsd*) @@ -20539,327 +31094,6 @@ $as_echo "#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5 -$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; } -ntp_warning='GRONK' -ans=none -case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in - yes*) - ntp_warning='' - ans='clock_settime()' - ;; - noyes*) - ntp_warning='But clock_settime() would be better (if we had it)' - ans='settimeofday()' - ;; - nonoyes) - ntp_warning='Which is the worst of the three' - ans='stime()' - ;; - *) - case "$build" in - $host) - ntp_warning='Which leaves us with nothing to use!' - esac -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } -case "$ntp_warning" in - '') - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5 -$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;} - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5 -$as_echo_n "checking for SIGIO... " >&6; } -if ${ntp_cv_hdr_def_sigio+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <signal.h> - - #ifdef SIGIO - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ntp_cv_hdr_def_sigio=yes -else - ntp_cv_hdr_def_sigio=no - -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5 -$as_echo "$ntp_cv_hdr_def_sigio" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use signalled IO" >&5 -$as_echo_n "checking if we want to use signalled IO... " >&6; } -if ${ntp_cv_var_signalled_io+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ans=no - case "$ntp_cv_hdr_def_sigio" in - yes) - ans=yes - case "$host" in - alpha*-dec-osf4*|alpha*-dec-osf5*) - ans=no - ;; - *-convex-*) - ans=no - ;; - *-dec-*) - ans=no - ;; - *-pc-cygwin*) - ans=no - ;; - *-sni-sysv*) - ans=no - ;; - *-univel-sysv*) - ans=no - ;; - *-*-irix6*) - ans=no - ;; - *-*-freebsd*) - ans=no - ;; - *-*-*linux*) - ans=no - ;; - *-*-unicosmp*) - ans=no - ;; - *-*-kfreebsd*) - ans=no - ;; - m68k-*-mint*) - ans=no - ;; - esac - ;; - esac - ntp_cv_var_signalled_io=$ans - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_signalled_io" >&5 -$as_echo "$ntp_cv_var_signalled_io" >&6; } -case "$ntp_cv_var_signalled_io" in - yes) - -$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h - -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5 -$as_echo_n "checking for SIGPOLL... " >&6; } -if ${ntp_cv_hdr_def_sigpoll+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <signal.h> - - #ifdef SIGPOLL - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ntp_cv_hdr_def_sigpoll=yes -else - ntp_cv_hdr_def_sigpoll=no - -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5 -$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGSYS" >&5 -$as_echo_n "checking for SIGSYS... " >&6; } -if ${ntp_cv_hdr_def_sigsys+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <signal.h> - - #ifdef SIGSYS - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ntp_cv_hdr_def_sigsys=yes -else - ntp_cv_hdr_def_sigsys=no - -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigsys" >&5 -$as_echo "$ntp_cv_hdr_def_sigsys" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5 -$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; } -if ${ntp_cv_var_use_udp_sigpoll+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ans=no - case "$ntp_cv_hdr_def_sigpoll" in - yes) - case "$host" in - mips-sgi-irix*) - ans=no - ;; - vax-dec-bsd) - ans=no - ;; - *-pc-cygwin*) - ans=no - ;; - *-sni-sysv*) - ans=no - ;; - *-*-aix[456]*) - ans=no - ;; - *-*-hpux*) - ans=no - ;; - *-*-*linux*) - ans=no - ;; - *-*-osf*) - ans=no - ;; - *-*-qnx*) - ans=no - ;; - *-*-sunos*) - ans=no - ;; - *-*-solaris*) - ans=no - ;; - *-*-ultrix*) - ans=no - ;; - *-*-unicosmp*) - ans=no - ;; - *-*-kfreebsd*) - ans=no - ;; - *) ans=yes - ;; - esac - ;; - esac - ntp_cv_var_use_udp_sigpoll=$ans - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_use_udp_sigpoll" >&5 -$as_echo "$ntp_cv_var_use_udp_sigpoll" >&6; } -case "$ntp_cv_var_use_udp_sigpoll" in - yes) - -$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h - -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5 -$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; } -if ${ntp_cv_var_use_tty_sigpoll+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ans=no - case "$ntp_cv_hdr_def_sigpoll" in - yes) - case "$host" in - mips-sgi-irix*) - ans=no - ;; - vax-dec-bsd) - ans=no - ;; - *-pc-cygwin*) - ans=no - ;; - *-sni-sysv*) - ans=no - ;; - *-*-aix[456]*) - ans=no - ;; - *-*-hpux*) - ans=no - ;; - *-*-*linux*) - ans=no - ;; - *-*-osf*) - ans=no - ;; - *-*-sunos*) - ans=no - ;; - *-*-ultrix*) - ans=no - ;; - *-*-qnx*) - ans=no - ;; - *-*-unicosmp*) - ans=no - ;; - *-*-kfreebsd*) - ans=no - ;; - *) ans=yes - ;; - esac - ;; - esac - ntp_cv_var_use_tty_sigpoll=$ans - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_use_tty_sigpoll" >&5 -$as_echo "$ntp_cv_var_use_tty_sigpoll" >&6; } -case "$ntp_cv_var_use_tty_sigpoll" in - yes) - -$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h - -esac - case "$host" in *-*-aix*) @@ -20932,25 +31166,6 @@ $as_echo "#define NO_PARENB_IGNPAR 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including ntpd debugging code" >&5 -$as_echo_n "checking if we're including ntpd debugging code... " >&6; } -# Check whether --enable-debugging was given. -if test "${enable_debugging+set}" = set; then : - enableval=$enable_debugging; ntp_ok=$enableval -else - ntp_ok=yes - -fi - -case "$ntp_ok" in - yes) - -$as_echo "#define DEBUG 1" >>confdefs.h - -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including processing time debugging code" >&5 $as_echo_n "checking if we're including processing time debugging code... " >&6; } # Check whether --enable-debug-timing was given. @@ -21007,168 +31222,6 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpd will use the deferred DNS lookup path" >&5 -$as_echo_n "checking if ntpd will use the deferred DNS lookup path... " >&6; } -# Check whether --enable-force-defer-DNS was given. -if test "${enable_force_defer_DNS+set}" = set; then : - enableval=$enable_force_defer_DNS; ans=$enableval -else - ans=no - -fi - -case "$ans" in - yes) - -$as_echo "#define FORCE_DEFER_DNS 1" >>confdefs.h - -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } - -case "$ac_cv_header_sys_sio_h" in - yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sio.h for TIOCDCDTIMESTAMP" >&5 -$as_echo_n "checking sys/sio.h for TIOCDCDTIMESTAMP... " >&6; } -if ${ntp_cv_hdr_def_tiocdcdtimestamp+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <sys/sio.h> - - #ifdef TIOCDCDTIMESTAMP - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ntp_cv_hdr_def_tiocdcdtimestamp=yes -else - ntp_cv_hdr_def_tiocdcdtimestamp=no - -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_tiocdcdtimestamp" >&5 -$as_echo "$ntp_cv_hdr_def_tiocdcdtimestamp" >&6; } -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have the tty_clk line discipline/streams module" >&5 -$as_echo_n "checking if we have the tty_clk line discipline/streams module... " >&6; } -if ${ntp_cv_tty_clk+:} false; then : - $as_echo_n "(cached) " >&6 -else - - case "$ac_cv_header_sys_clkdefs_h$ntp_cv_hdr_def_tiocdcdtimestamp" in - *yes*) - ntp_cv_tty_clk=yes - ;; - *) - ntp_cv_tty_clk=no - ;; - esac - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tty_clk" >&5 -$as_echo "$ntp_cv_tty_clk" >&6; } -case "$ntp_cv_tty_clk" in - yes) - -$as_echo "#define TTYCLK 1" >>confdefs.h - -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ppsclock streams module" >&5 -$as_echo_n "checking for the ppsclock streams module... " >&6; } -case "$ntp_cv_struct_ppsclockev" in - yes) - ans=yes - -$as_echo "#define PPS 1" >>confdefs.h - - ;; - *) - ans=no -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5 -$as_echo_n "checking for multicast IP support... " >&6; } -if ${ntp_cv_multicast+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ntp_cv_multicast=no - case "$host" in - i386-sequent-sysv4) - ;; - *) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #ifdef HAVE_NETINET_IN_H - #include <netinet/in.h> - #endif - -int -main () -{ - - struct ip_mreq ipmr; - ipmr.imr_interface.s_addr = 0; - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ntp_cv_multicast=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - esac - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5 -$as_echo "$ntp_cv_multicast" >&6; } -case "$ntp_cv_multicast" in - yes) - -$as_echo "#define MCAST 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5 -$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; } -if ${ntp_cv_typeof_ip_multicast_loop+:} false; then : - $as_echo_n "(cached) " >&6 -else - - case "$host" in - *-*-netbsd*|*-*-*linux*) - ntp_cv_typeof_ip_multicast_loop=u_int - ;; - *) - ntp_cv_typeof_ip_multicast_loop=u_char - esac - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5 -$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; } - -cat >>confdefs.h <<_ACEOF -#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop -_ACEOF - -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of ntp_{adj,get}time()" >&5 $as_echo_n "checking availability of ntp_{adj,get}time()... " >&6; } if ${ntp_cv_var_ntp_syscalls+:} false; then : @@ -21188,19 +31241,16 @@ else /* end confdefs.h. */ #include <sys/syscall.h> - - #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime) - yes + #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_cv_var_ntp_syscalls=kernel fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext ;; esac @@ -21230,21 +31280,18 @@ else /* end confdefs.h. */ #include <sys/timex.h> - - #ifdef STA_FLL - yes + #ifndef STA_FLL + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_cv_var_sta_fll=yes else ntp_cv_var_sta_fll=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_sta_fll" >&5 @@ -21314,21 +31361,18 @@ case "$ac_cv_header_termios_h" in /* end confdefs.h. */ #include <termios.h> - - #ifdef TIOCGPPSEV - yes + #ifndef TIOCGPPSEV + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_ok=yes else ntp_ok=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext ;; *) ntp_ok=no @@ -21352,21 +31396,18 @@ case "$ac_cv_header_termios_h" in /* end confdefs.h. */ #include <termios.h> - - #ifdef TIOCSPPS - yes + #ifndef TIOCSPPS + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_ok=yes else ntp_ok=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext ;; *) ntp_ok=no @@ -21390,21 +31431,18 @@ case "$ac_cv_header_sys_ppsclock_h" in /* end confdefs.h. */ #include <sys/ppsclock.h> - - #ifdef CIOGETEV - yes + #ifndef CIOGETEV + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_ok=yes else ntp_ok=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext ;; *) ntp_ok=no @@ -21464,28 +31502,30 @@ $as_echo_n "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS #include <sys/ppsclock.h> #include <linux/serial.h> - #ifdef TIOCGSERIAL - #ifdef TIOCSSERIAL - #ifdef ASYNC_PPS_CD_POS - #ifdef ASYNC_PPS_CD_NEG - #ifdef CIOGETEV - yes + #ifndef TIOCGSERIAL + # error #endif + #ifndef TIOCSSERIAL + # error #endif + #ifndef ASYNC_PPS_CD_POS + # error #endif + #ifndef ASYNC_PPS_CD_NEG + # error #endif + #ifndef CIOGETEV + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_ok=yes else ntp_ok=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } ;; @@ -21533,12 +31573,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_BANC 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$host" in @@ -21558,12 +31600,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_GPSVME 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$host" in @@ -21702,12 +31746,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ACTS 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21721,12 +31767,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ARBITER 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21740,12 +31788,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ARCRON_MSF 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21759,12 +31809,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_AS2201 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21781,12 +31833,14 @@ fi case "$ntp_atom_ok" in no) ntp_ok=no ;; esac -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ATOM 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21800,12 +31854,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_CHRONOLOG 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21819,12 +31875,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_CHU 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } ntp_refclock_chu=$ntp_ok @@ -21844,11 +31902,6 @@ else fi -if test "$ntp_ok" = "yes"; then - -$as_echo "#define AUDIO_CHU 1" >>confdefs.h - -fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } # We used to check for sunos/solaris target... @@ -21876,12 +31929,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_DATUM 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21895,12 +31950,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_DUMBCLOCK 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21914,12 +31971,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_FG 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21934,12 +31993,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_HEATH 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21953,12 +32014,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_HOPF_SERIAL 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21972,12 +32035,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_HOPF_PCI 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -21991,12 +32056,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_HPGPS 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22015,12 +32082,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_IRIG 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canaudio" in @@ -22038,12 +32107,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_JJY 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22059,12 +32130,14 @@ fi case "$ntp_jupiter_ok" in no) ntp_ok=no ;; esac -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_JUPITER 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22078,12 +32151,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_LEITCH 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22097,12 +32172,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_LOCAL 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22127,12 +32204,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_MX4200 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$host" in @@ -22150,12 +32229,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_NEOCLOCK4X 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22169,12 +32250,49 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_NMEA 1" >>confdefs.h + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +$as_echo "$ntp_ok" >&6; } + +for ac_func in strtoll +do : + ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOLL 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPSD JSON receiver" >&5 +$as_echo_n "checking for GPSD JSON receiver... " >&6; } +# Check whether --enable-GPSD was given. +if test "${enable_GPSD+set}" = set; then : + enableval=$enable_GPSD; ntp_ok=$enableval +else + case "$ac_cv_func_strtoll" in + yes) ntp_ok=$ntp_eac ;; + *) ntp_ok="no" ;; + esac + fi + +case "$ntp_ok" in + yes) + ntp_refclock=yes + +$as_echo "#define CLOCK_GPSDJSON 1" >>confdefs.h + + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22191,12 +32309,14 @@ fi case "$ntp_oncore_ok" in no) ntp_ok=no ;; esac -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ONCORE 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22211,12 +32331,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_PALISADE 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22230,12 +32352,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_PCF 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22249,12 +32373,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_PST 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22272,12 +32398,14 @@ fi case "$ntp_ripe_ncc_ok" in no) ntp_ok=no ;; esac -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_RIPENCC /**/" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22298,12 +32426,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_SHM 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22317,12 +32447,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_SPECTRACOM 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22345,12 +32477,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_TPRO 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ac_cv_header_sys_tpro" in @@ -22358,7 +32492,6 @@ case "$ntp_ok$ac_cv_header_sys_tpro" in $as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac - # Not on a vax-dec-bsd { $as_echo "$as_me:${as_lineno-$LINENO}: checking Kinemetrics/TrueTime receivers" >&5 $as_echo_n "checking Kinemetrics/TrueTime receivers... " >&6; } @@ -22379,12 +32512,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_TRUETIME 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$host" in @@ -22402,12 +32537,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_TT560 /**/" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22421,12 +32558,43 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ULINK 1" >>confdefs.h + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +$as_echo "$ntp_ok" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom TSYNC PCI timing board" >&5 +$as_echo_n "checking Spectracom TSYNC PCI timing board... " >&6; } +# Check whether --enable-TSYNCPCI was given. +if test "${enable_TSYNCPCI+set}" = set; then : + enableval=$enable_TSYNCPCI; ntp_ok=$enableval +else + + case "$host" in + *-*-*linux*) + ntp_ok=$ntp_eac + ;; + *) + ntp_ok=no + esac + + fi + +case "$ntp_ok" in + yes) + ntp_refclock=yes + +$as_echo "#define CLOCK_TSYNCPCI 1" >>confdefs.h + + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22445,12 +32613,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_WWV 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canaudio" in @@ -22468,12 +32638,14 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_refclock=yes $as_echo "#define CLOCK_ZYFER 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } @@ -22520,13 +32692,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_COMPUTIME 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22544,13 +32718,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_DCF7000 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22568,13 +32744,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_HOPF6021 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22592,13 +32770,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_MEINBERG 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22616,7 +32796,8 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_parseutil=yes ntp_refclock=yes @@ -22624,7 +32805,8 @@ if test "$ntp_ok" = "yes"; then $as_echo "#define CLOCK_RAWDCF 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22670,13 +32852,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_RCC8000 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22694,13 +32878,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_SCHMID 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22718,13 +32904,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_TRIMTAIP 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22742,13 +32930,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_TRIMTSIP 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22766,13 +32956,15 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_WHARTON_400A 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in @@ -22790,18 +32982,44 @@ else fi -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_libparse=yes ntp_refclock=yes $as_echo "#define CLOCK_VARITEXT 1" >>confdefs.h + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +$as_echo "$ntp_ok" >&6; } +case "$ntp_ok$ntp_canparse" in + yesno) + as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SEL240X clock" >&5 +$as_echo_n "checking SEL240X clock... " >&6; } +# Check whether --enable-SEL240X was given. +if test "${enable_SEL240X+set}" = set; then : + enableval=$enable_SEL240X; ntp_ok=$enableval +else + ntp_ok=$ntp_eapc +fi + +if test "$ntp_ok" = "yes"; then + ntp_libparse=yes + ntp_refclock=yes + +$as_echo "#define CLOCK_SEL240X 1" >>confdefs.h + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 + ;; esac @@ -22828,176 +33046,357 @@ $as_echo "$ans" >&6; } +ntp_pkgconfig_min_version='0.15.0' +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi +{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;} +{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;} +case "$PKG_CONFIG" in + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5 +$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + ;; +esac + + + + + +VER_SUFFIX= + + + + +# Check whether --with-crypto was given. +if test "${with_crypto+set}" = set; then : + withval=$with_crypto; +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5 -$as_echo_n "checking for openssl library directory... " >&6; } # Check whether --with-openssl-libdir was given. if test "${with_openssl_libdir+set}" = set; then : - withval=$with_openssl_libdir; ans=$withval -else + withval=$with_openssl_libdir; +fi - case "$build" in - $host) ans=yes ;; - *) ans=no ;; - esac + +# Check whether --with-openssl-incdir was given. +if test "${with_openssl_incdir+set}" = set; then : + withval=$with_openssl_incdir; +fi +# Check whether --with-rpath was given. +if test "${with_rpath+set}" = set; then : + withval=$with_rpath; fi -case "$ans" in - no) - ;; - yes) # Look in: - ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib /lib" - ;; - *) # Look where they said - ;; +ntp_openssl=no +ntp_openssl_from_pkg_config=no +with_crypto=${with_crypto:-openssl,libcrypto} +case "$with_crypto" in + yes) + with_crypto=openssl,libcrypto +esac +case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${with_openssl_incdir-notgiven}" in + no:*) ;; + *:notempty:notgiven:notgiven) + for pkg in `echo $with_crypto | sed -e 's/,/ /'`; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config for $pkg" >&5 +$as_echo_n "checking pkg-config for $pkg... " >&6; } + if $PKG_CONFIG --exists $pkg ; then + CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I $pkg`" + CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other $pkg`" + LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-L $pkg`" + LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-l $pkg`" + LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-other $pkg`" + VER_SUFFIX=o + ntp_openssl=yes + ntp_openssl_from_pkg_config=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + break + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + done esac -case "$ans" in - no) - ;; - *) # Look for libcrypto.a and libssl.a: - for i in $ans no - do +case "$with_crypto:$ntp_openssl" in + no:*) ;; + *:no) + need_dash_r= + need_dash_Wlrpath= + case "${with_rpath-notgiven}" in + yes) + # Lame - what to do if we need -Wl... but not -R? + need_dash_r=1 + ;; + notgiven) case "$host" in - *-*-darwin*) - test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break + *-*-linux*) + # This may really only be true for gcc + need_dash_Wlrpath=1 + ;; + *-*-netbsd*) + need_dash_r=1 + ;; + *-*-solaris*) + need_dash_r=1 + ;; + esac + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5 +$as_echo_n "checking for openssl library directory... " >&6; } + with_openssl_libdir=${with_openssl_libdir-notgiven} + case "$with_openssl_libdir" in + notgiven) + case "$build" in + $host) + with_openssl_libdir=default ;; *) - test -f $i/libcrypto.so -a -f $i/libssl.so && break - test -f $i/libcrypto.a -a -f $i/libssl.a && break + with_openssl_libdir=no ;; esac - done - case "$i" in + esac + case "$with_openssl_libdir" in + default) + # Look in: + with_openssl_libdir="/usr/lib /usr/lib/openssl /usr/sfw/lib" + with_openssl_libdir="$with_openssl_libdir /usr/local/lib" + with_openssl_libdir="$with_openssl_libdir /usr/local/ssl/lib /lib" + esac + case "$with_openssl_libdir" in no) - ans=no - OPENSSL_LIB= ;; - *) ans=$i - OPENSSL_LIB=$ans + *) # Look for libcrypto.a and libssl.a: + for i in $with_openssl_libdir no + do + case "$host" in + *-*-darwin*) + test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break + ;; + *) + test -f $i/libcrypto.so -a -f $i/libssl.so && break + test -f $i/libcrypto.a -a -f $i/libssl.a && break + ;; + esac + done + openssl_libdir=$i ;; esac - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_libdir" >&5 +$as_echo "$openssl_libdir" >&6; } + case "$openssl_libdir" in + no) + openssl_libdir= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&5 +$as_echo "$as_me: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&2;} + esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5 $as_echo_n "checking for openssl include directory... " >&6; } - -# Check whether --with-openssl-incdir was given. -if test "${with_openssl_incdir+set}" = set; then : - withval=$with_openssl_incdir; ans=$withval -else - - case "$build" in - $host) ans=yes ;; - *) ans=no ;; - esac - - -fi - -case "$ans" in - no) - ;; - yes) # look in: - ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include" - ;; - *) # Look where they said - ;; -esac -case "$ans" in - no) - ;; - *) # look for openssl/opensslconf.h: - for i in $ans no - do - test -f $i/openssl/opensslconf.h && break - done - case "$i" in + with_openssl_incdir=${with_openssl_incdir-notgiven} + case "$with_openssl_incdir" in + notgiven) + # Look in: + with_openssl_incdir="/usr/include /usr/sfw/include" + with_openssl_incdir="$with_openssl_incdir /usr/local/include" + with_openssl_incdir="$with_openssl_incdir /usr/local/ssl/include" + esac + case "$with_openssl_incdir" in no) - ans=no - OPENSSL_INC= ;; - *) ans=$i - OPENSSL_INC=$ans + *) # look for openssl/evp.h: + for i in $with_openssl_incdir no + do + test -f $i/openssl/evp.h && break + done + openssl_incdir=$i ;; esac - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5 -$as_echo_n "checking if we will use crypto... " >&6; } - -# Check whether --with-crypto was given. -if test "${with_crypto+set}" = set; then : - withval=$with_crypto; ans=$withval -else - ans=yes - -fi - -case "$ans" in - no) - ;; - yes|openssl) - if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC" + { i=; unset i;} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_incdir" >&5 +$as_echo "$openssl_incdir" >&6; } + case "$openssl_incdir" in + no) + openssl_incdir= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&5 +$as_echo "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&2;} + esac + if test -z "$openssl_libdir" -o -z "$openssl_incdir" then - ans=no + ntp_openssl=no else - ans=yes + ntp_openssl=yes + VER_SUFFIX=o fi + case "$ntp_openssl" in + yes) + # We have OpenSSL inc/lib dirs - use them. + case "$openssl_incdir" in + /usr/include) + ;; + *) + CPPFLAGS_NTP="$CPPFLAGS_NTP -I$openssl_incdir" + ;; + esac + case "$openssl_libdir" in + /usr/lib) + ;; + *) + LDADD_NTP="$LDADD_NTP -L$openssl_libdir" + case "$need_dash_r" in + 1) + LDFLAGS_NTP="$LDFLAGS_NTP -R$openssl_libdir" + esac + case "$need_dash_Wlrpath" in + 1) + LDFLAGS_NTP="$LDFLAGS_NTP -Wl,-rpath,$openssl_libdir" + esac + ;; + esac + LDADD_NTP="$LDADD_NTP -lcrypto" + esac esac -ntp_openssl=$ans -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5 +$as_echo_n "checking if we will use crypto... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_openssl" >&5 +$as_echo "$ntp_openssl" >&6; } case "$ntp_openssl" in yes) - # We have OpenSSL inc/lib - use them. - case "$OPENSSL_INC" in - /usr/include) - ;; - *) - CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC" - ;; - esac - case "$OPENSSL_LIB" in - /usr/lib) - ;; - *) - LDFLAGS="$LDFLAGS -L$OPENSSL_LIB" - case "$need_dash_r" in - 1) - LDFLAGS="$LDFLAGS -R$OPENSSL_LIB" - esac - ;; - esac - LCRYPTO=-lcrypto +$as_echo "#define OPENSSL /**/" >>confdefs.h -$as_echo "#define OPENSSL 1" >>confdefs.h - + case "$VER_SUFFIX" in + *o*) ;; + *) as_fn_error $? "OPENSSL set but no 'o' in VER_SUFFIX!" "$LINENO" 5 ;; + esac + ;; esac +NTPO_SAVED_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP" +NTPO_SAVED_LIBS="$LIBS" + # -# check for linking with -lcrypto failure, and try -lz -lcrypto. +# check for linking with -lcrypto failure, and try -lcrypto -lz. # Helps m68k-atari-mint # -case "$ntp_openssl" in - yes) - NTPO_SAVED_LIBS="$LIBS" - LIBS="$NTPO_SAVED_LIBS $LCRYPTO" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO alone works" >&5 -$as_echo_n "checking if linking with $LCRYPTO alone works... " >&6; } +case "$ntp_openssl:$ntp_openssl_from_pkg_config" in + yes:no) + LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto alone works" >&5 +$as_echo_n "checking if linking with -lcrypto alone works... " >&6; } if ${ntp_cv_bare_lcrypto+:} false; then : $as_echo_n "(cached) " >&6 else @@ -23033,9 +33432,9 @@ fi $as_echo "$ntp_cv_bare_lcrypto" >&6; } case "$ntp_cv_bare_lcrypto" in no) - LIBS="$NTPO_SAVED_LIBS $LCRYPTO -lz" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO -lz works" >&5 -$as_echo_n "checking if linking with $LCRYPTO -lz works... " >&6; } + LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto -lz works" >&5 +$as_echo_n "checking if linking with -lcrypto -lz works... " >&6; } if ${ntp_cv_lcrypto_lz+:} false; then : $as_echo_n "(cached) " >&6 else @@ -23071,11 +33470,9 @@ fi $as_echo "$ntp_cv_lcrypto_lz" >&6; } case "$ntp_cv_lcrypto_lz" in yes) - LCRYPTO="$LCRYPTO -lz" + LDADD_NTP="$LDADD_NTP -lz" esac esac - LIBS="$NTPO_SAVED_LIBS" - { NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;} esac # @@ -23092,10 +33489,10 @@ esac # # openssl_triggers_warnings=unknown -SAVED_CFLAGS="$CFLAGS" +NTPO_SAVED_CFLAGS="$CFLAGS" -case "$GCC$ntp_openssl" in - yesyes) +case "$ntp_openssl:$GCC" in + yes:yes) CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23159,43 +33556,102 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext esac case "$openssl_triggers_warnings" in yes) - CFLAGS="$SAVED_CFLAGS -Wno-strict-prototypes" + CFLAGS_NTP="$CFLAGS_NTP -Wno-strict-prototypes" ;; *) - CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" + CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes" esac ;; - yesno) + no:yes) # gcc without OpenSSL - CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" + CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes" esac +CFLAGS="$NTPO_SAVED_CFLAGS" +CPPFLAGS="$NTPO_SAVED_CPPFLAGS" +LIBS="$NTPO_SAVED_LIBS" +{ NTPO_SAVED_CFLAGS=; unset NTPO_SAVED_CFLAGS;} +{ NTPO_SAVED_CPPFLAGS=; unset NTPO_SAVED_CPPFLAGS;} +{ NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;} +{ openssl_triggers_warnings=; unset openssl_triggers_warnings;} +{ ntp_openssl_from_pkg_config=; unset ntp_openssl_from_pkg_config;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to compile with ElectricFence" >&5 -$as_echo_n "checking if we want to compile with ElectricFence... " >&6; } -# Check whether --with-electricfence was given. -if test "${with_electricfence+set}" = set; then : - withval=$with_electricfence; ans=$withval + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use OpenSSL's crypto random (if available)" >&5 +$as_echo_n "checking if we want to use OpenSSL's crypto random (if available)... " >&6; } +# Check whether --enable-openssl-random was given. +if test "${enable_openssl_random+set}" = set; then : + enableval=$enable_openssl_random; ntp_use_openssl_random=$enableval else - ans=no + ntp_use_openssl_random=yes fi -case "$ans" in - no) ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_openssl_random" >&5 +$as_echo "$ntp_use_openssl_random" >&6; } + +# The following might need extra libraries +NTPO_SAVED_LIBS="$LIBS" +LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" +for ac_func in RAND_bytes RAND_poll +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +LIBS="$NTPO_SAVED_LIBS" +case "$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in + yesyesyes) + +$as_echo "#define USE_OPENSSL_CRYPTO_RAND 1" >>confdefs.h + + ;; + *) ntp_use_openssl_random=no ;; +esac + + + +# if we are using OpenSSL (--with-crypto), by default Autokey is enabled +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to include NTP Autokey protocol support" >&5 +$as_echo_n "checking if we want to include NTP Autokey protocol support... " >&6; } +# Check whether --enable-autokey was given. +if test "${enable_autokey+set}" = set; then : + enableval=$enable_autokey; ntp_autokey=$enableval +else + ntp_autokey=$ntp_openssl + +fi + +case "$ntp_autokey" in + no) + ;; *) - LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a" - EF_PROGS="eftest tstheap" + case "$ntp_openssl" in + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&5 +$as_echo "$as_me: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&2;} + ntp_autokey=no + ;; + *) - EF_LIBS=libefence.a +$as_echo "#define AUTOKEY 1" >>confdefs.h - ans=yes + ntp_autokey=yes + ;; + esac ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_autokey" >&5 +$as_echo "$ntp_autokey" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to run check-layout" >&5 @@ -23217,14 +33673,16 @@ $as_echo "$ans" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make dcf parse utilities" >&5 $as_echo_n "checking if we can make dcf parse utilities... " >&6; } ans=no -if test "$ntp_parseutil" = "yes"; then +case "$ntp_parseutil" in + yes) case "$host" in *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*) ans="dcfd testdcf" DCFD=dcfd - TESTDCF=testdcf + TESTDCF=testdcf esac -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } @@ -23270,14 +33728,18 @@ $as_echo "$ans" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need basic refclock support" >&5 $as_echo_n "checking if we need basic refclock support... " >&6; } -if test "$ntp_refclock" = "yes"; then +case "$ntp_refclock" in + yes) $as_echo "#define REFCLOCK 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_refclock" >&5 $as_echo "$ntp_refclock" >&6; } +PROPDELAY=propdelay + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want HP-UX adjtimed support" >&5 @@ -23289,12 +33751,19 @@ case "$host" in *) ans=no ;; esac -if test "$ans" = "yes"; then +case "$ans" in + yes) MAKE_ADJTIMED=adjtimed $as_echo "#define NEED_HPUX_ADJTIME 1" >>confdefs.h -fi + ;; + *) ADJTIMED_DB= + ADJTIMED_DL= + ADJTIMED_DS= + ADJTIMED_MS= + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } @@ -23307,11 +33776,13 @@ case "$host" in *) ans=no ;; esac -if test "$ans" = "yes"; then +case "$ans" in + yes) $as_echo "#define NEED_QNX_ADJTIME 1" >>confdefs.h -fi + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } @@ -23325,6 +33796,7 @@ case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in ans=yes ;; *) ans=no + ;; esac case "$host" in @@ -23389,7 +33861,8 @@ case "$host" in *-fujitsu-uxp*) ans=yes ;; - *-ibm-aix[456]*) + *-ibm-aix[4-9]*) + # XXX only verified thru AIX6. ans=yes ;; *-*-*linux*) @@ -23405,6 +33878,7 @@ case "$host" in ans=yes ;; *) ans=no + ;; esac # --enable-accurate-adjtime / --disable-accurate-adjtime @@ -23448,7 +33922,8 @@ else *-hp-hpux*) ans=old_tick ;; - *-ibm-aix[3456]*) + *-ibm-aix[3-9]*) + # XXX only verified thru AIX6. ans=no ;; *-*-mpeix*) @@ -23789,18 +34264,21 @@ case "$host" in case "$can_kmem" in no) ans=1000 + ;; esac ;; *-*-domainos) # Skippy: won't be found... case "$can_kmem" in no) ans=668 + ;; esac ;; *-*-hpux*) case "$adjtime_is_accurate" in yes) ans='tick/16' + ;; esac ;; *-*-irix*) @@ -23817,6 +34295,7 @@ case "$host" in ;; *-*-unicosmp*) ans=150 + ;; esac # Check whether --enable-tickadj was given. @@ -23919,6 +34398,12 @@ case "$ac_cv_make_ntptime" in yes) MAKE_NTPTIME=ntptime ;; + *) + NTPTIME_DB= + NTPTIME_DL= + NTPTIME_DS= + NTPTIME_MS= + ;; esac @@ -23968,6 +34453,17 @@ $as_echo "$ntp_cv_make_tickadj" >&6; } case "$ntp_cv_make_tickadj" in yes) MAKE_TICKADJ=tickadj + ;; + *) + CALC_TICKADJ_DB= + CALC_TICKADJ_DL= + CALC_TICKADJ_DS= + CALC_TICKADJ_MS= + TICKADJ_DB= + TICKADJ_DL= + TICKADJ_DS= + TICKADJ_MS= + ;; esac @@ -23996,6 +34492,12 @@ $as_echo "$ntp_cv_make_timetrim" >&6; } case "$ntp_cv_make_timetrim" in yes) MAKE_TIMETRIM=timetrim + ;; + *) TIMETRIM_DB= + TIMETRIM_DL= + TIMETRIM_DS= + TIMETRIM_MS= + ;; esac @@ -24017,6 +34519,13 @@ case "$ans" in yes) MAKE_NTPDSIM=ntpdsim MAKE_LIBNTPSIM=libntpsim.a + ;; + *) + NTPDSIM_DB= + NTPDSIM_DL= + NTPDSIM_DS= + NTPDSIM_MS= + ;; esac case "$build" in @@ -24031,6 +34540,40 @@ case "$build" in esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sntp will be built" >&5 +$as_echo_n "checking if sntp will be built... " >&6; } + +# Check whether --with-sntp was given. +if test "${with_sntp+set}" = set; then : + withval=$with_sntp; +else + with_sntp="${withsntp=yes}" + +fi + +case "$with_sntp" in + no) + SNTP= + ;; + *) + SNTP=sntp + ;; +esac + + if test -n "$SNTP"; then + BUILD_SNTP_TRUE= + BUILD_SNTP_FALSE='#' +else + BUILD_SNTP_TRUE='#' + BUILD_SNTP_FALSE= +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sntp" >&5 +$as_echo "$with_sntp" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build ntpsnmpd" >&5 $as_echo_n "checking if we want to build ntpsnmpd... " >&6; } @@ -24142,8 +34685,11 @@ $as_echo "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h esac CFLAGS=$save_CFLAGS + { save_CFLAGS=; unset save_CFLAGS;} CPPFLAGS=$save_CPPFLAGS + { save_CPPFLAGS=; unset save_CPPFLAGS;} LIBS=$save_LIBS + { save_LIBS=; unset save_LIBS;} ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&5 @@ -24154,6 +34700,14 @@ $as_echo "$as_me: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be fou esac +case "$MAKE_NTPSNMPD" in + '') + NTPSNMPD_DB= + NTPSNMPD_DL= + NTPSNMPD_DS= + NTPSNMPD_MS= + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should always slew the time" >&5 $as_echo_n "checking if we should always slew the time... " >&6; } @@ -24247,6 +34801,7 @@ case "$host" in ans=yes ;; *) ans=no + ;; esac # Check whether --enable-ntpdate-step was given. @@ -24279,6 +34834,7 @@ case "$host" in ;; *) ans=no + ;; esac # Check whether --enable-hourly-todr-sync was given. @@ -24321,6 +34877,7 @@ case "$host" in ;; *) ans=yes + ;; esac ;; *-*-solaris2.7) @@ -24341,10 +34898,12 @@ case "$host" in ;; *) ans=yes + ;; esac ;; *) ans=no + ;; esac # Check whether --enable-kernel-fll-bug was given. @@ -24396,6 +34955,7 @@ case "$host" in ans=yes ;; *) ans=no + ;; esac # Check whether --enable-irig-sawtooth was given. @@ -24415,7 +34975,6 @@ $as_echo "#define IRIG_SUCKS 1" >>confdefs.h esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5 $as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; } @@ -24438,7 +34997,6 @@ $as_echo "#define LOCKCLOCK 1" >>confdefs.h ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5 $as_echo_n "checking if we want support for Samba's signing daemon... " >&6; } @@ -24477,136 +35035,223 @@ cat >>confdefs.h <<_ACEOF #define NTP_SIGND_PATH "$ntp_signd_path" _ACEOF + ;; esac - -for ac_header in sys/clockctl.h +for ac_header in libscf.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_clockctl_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default" +if test "x$ac_cv_header_libscf_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_CLOCKCTL_H 1 +#define HAVE_LIBSCF_H 1 _ACEOF fi done - -case "$host" in - *-*-netbsd*) - ans=yes - ;; - *) ans=no - ;; +LSCF= +case "$ac_cv_header_libscf_h" in + yes) + LSCF='-lscf' esac -# Check whether --enable-clockctl was given. -if test "${enable_clockctl+set}" = set; then : - enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 +$as_echo_n "checking for struct sockaddr_storage... " >&6; } +if ${ntp_cv_sockaddr_storage+:} false; then : + $as_echo_n "(cached) " >&6 else - ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif +int +main () +{ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5 -$as_echo_n "checking if we should use /dev/clockctl... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5 -$as_echo "$ntp_use_dev_clockctl" >&6; } + struct sockaddr_storage n; -for ac_header in sys/capability.h sys/prctl.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_sockaddr_storage=yes +else + ntp_cv_sockaddr_storage=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5 +$as_echo "$ntp_cv_sockaddr_storage" >&6; } +case "$ntp_cv_sockaddr_storage" in + yes) +$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5 -$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5 +$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; } +if ${ntp_cv_have___ss_family+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in - yesyes) - case "$host" in - mips-sgi-irix*) - ntp_have_linuxcaps=no - ;; - *) ntp_have_linuxcaps=yes - ;; - esac - ;; - *) - ntp_have_linuxcaps=no - ;; -esac + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif -# Check whether --enable-linuxcaps was given. -if test "${enable_linuxcaps+set}" = set; then : - enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval +int +main () +{ -fi + struct sockaddr_storage s; + s.__ss_family = 1; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5 -$as_echo "$ntp_have_linuxcaps" >&6; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_have___ss_family=yes +else + ntp_cv_have___ss_family=no -case "$ntp_have_linuxcaps" in - yes) +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5 +$as_echo "$ntp_cv_have___ss_family" >&6; } + case "$ntp_cv_have___ss_family" in + yes) + +$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h + + esac - LIBS="$LIBS -lcap" esac -case "$ntp_use_dev_clockctl$ntp_have_linuxcaps" in - *yes*) -$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h +# +# Look for in_port_t. +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 +$as_echo_n "checking for in_port_t... " >&6; } +if ${isc_cv_have_in_port_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -esac + #include <sys/types.h> + #include <netinet/in.h> +int +main () +{ -for ac_header in libscf.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default" -if test "x$ac_cv_header_libscf_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSCF_H 1 + in_port_t port = 25; + return (0); + + + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + isc_cv_have_in_port_t=yes +else + isc_cv_have_in_port_t=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5 +$as_echo "$isc_cv_have_in_port_t" >&6; } +case "$isc_cv_have_in_port_t" in + no) -LSCF= -case "$ac_cv_header_libscf_h" in - yes) - LSCF='-lscf' -esac +$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h +esac -ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv" -if test "x$ac_cv_func_setppriv" = xyes; then : - ans=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5 +$as_echo_n "checking type of socklen arg for getsockname()... " >&6; } +if ${ntp_cv_getsockname_socklen_type+:} false; then : + $as_echo_n "(cached) " >&6 else - ans=no + getsockname_socklen_type_found=no + for getsockname_arg2 in 'struct sockaddr *' 'void *'; do + for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + # include <sys/socket.h> + #endif + +int +main () +{ + + extern + getsockname(int, $getsockname_arg2, + $ntp_cv_getsockname_socklen_type *); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + getsockname_socklen_type_found=yes ; break 2 fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done + case "$getsockname_socklen_type_found" in + no) + ntp_cv_getsockname_socklen_type='socklen_t' + esac + { getsockname_arg2=; unset getsockname_arg2;} + { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;} -case "$ans" in - yes) -$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5 +$as_echo "$ntp_cv_getsockname_socklen_type" >&6; } -esac +cat >>confdefs.h <<_ACEOF +#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type +_ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5 @@ -24899,24 +35544,25 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 $as_echo_n "checking for in6addr_any... " >&6; } -if ${isc_cv_have_in6addr_any+:} false; then : +if ${isc_cv_in6addr_any_links+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> - $isc_netinetin6_hack - $isc_netinet6in6_hack + SAVED_LIBS="$LIBS" + LIBS="$LDADD_LIBNTP $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + #include <sys/socket.h> + #include <netinet/in.h> + $isc_netinetin6_hack + $isc_netinet6in6_hack int main () { - struct in6_addr in6; - in6 = in6addr_any; + printf("%x", in6addr_any.s6_addr[15]); ; @@ -24924,19 +35570,22 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - isc_cv_have_in6addr_any=yes + isc_cv_in6addr_any_links=yes else - isc_cv_have_in6addr_any=no + isc_cv_in6addr_any_links=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVED_LIBS" + { SAVED_LIBS=; unset SAVED_LIBS;} + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6addr_any" >&5 -$as_echo "$isc_cv_have_in6addr_any" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_in6addr_any_links" >&5 +$as_echo "$isc_cv_in6addr_any_links" >&6; } -case "$isc_cv_have_in6addr_any" in +case "$isc_cv_in6addr_any_links" in no) $as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h @@ -25026,6 +35675,201 @@ $as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5 +$as_echo_n "checking for multicast IP support... " >&6; } +if ${ntp_cv_multicast+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ntp_cv_multicast=no + case "$host" in + i386-sequent-sysv4) + ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + +int +main () +{ + + struct ip_mreq ipmr; + ipmr.imr_interface.s_addr = 0; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ntp_cv_multicast=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5 +$as_echo "$ntp_cv_multicast" >&6; } +case "$ntp_cv_multicast" in + yes) + +$as_echo "#define MCAST 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5 +$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; } +if ${ntp_cv_typeof_ip_multicast_loop+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host" in + *-*-netbsd*|*-*-*linux*) + ntp_cv_typeof_ip_multicast_loop=u_int + ;; + *) + ntp_cv_typeof_ip_multicast_loop=u_char + ;; + esac + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5 +$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop +_ACEOF + +esac + +# Check whether --enable-getifaddrs was given. +if test "${enable_getifaddrs+set}" = set; then : + enableval=$enable_getifaddrs; want_getifaddrs="$enableval" +else + want_getifaddrs="yes" + +fi + + +case $want_getifaddrs in + glibc) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-getifaddrs=glibc is no longer required" >&5 +$as_echo "$as_me: WARNING: --enable-getifaddrs=glibc is no longer required" >&2;} +esac +case $want_getifaddrs in + no) + ;; + *) + SAVED_LIBS="$LIBS" + LIBS="$LDADD_LIBNTP $LIBS" + for ac_func in getifaddrs +do : + ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" +if test "x$ac_cv_func_getifaddrs" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETIFADDRS 1 +_ACEOF + +fi +done + + LIBS="$SAVED_LIBS" + { SAVED_LIBS=; unset SAVED_LIBS;} + ;; +esac + +# +# Check for if_nametoindex() for IPv6 scoped addresses support +# +case "$host" in + *-hp-hpux*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5 +$as_echo_n "checking for library containing if_nametoindex... " >&6; } +if ${ac_cv_search_if_nametoindex+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char if_nametoindex (); +int +main () +{ +return if_nametoindex (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ipv6; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_if_nametoindex=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_if_nametoindex+:} false; then : + break +fi +done +if ${ac_cv_search_if_nametoindex+:} false; then : + +else + ac_cv_search_if_nametoindex=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5 +$as_echo "$ac_cv_search_if_nametoindex" >&6; } +ac_res=$ac_cv_search_if_nametoindex +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +esac +SAVED_LIBS="$LIBS" +LIBS="$LDADD_LIBNTP $LIBS" +for ac_func in if_nametoindex +do : + ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex" +if test "x$ac_cv_func_if_nametoindex" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IF_NAMETOINDEX 1 +_ACEOF + +fi +done + +LIBS="$SAVED_LIBS" +{ SAVED_LIBS=; unset SAVED_LIBS;} +case "$ac_cv_func_if_nametoindex" in + yes) + +$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h + +esac + + + + # # Look for a sysctl call to get the list of network interfaces. # @@ -25040,20 +35884,18 @@ else #include <sys/param.h> #include <sys/sysctl.h> #include <sys/socket.h> - #ifdef NET_RT_IFLIST - found_rt_iflist + #ifndef NET_RT_IFLIST + # error #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "found_rt_iflist" >/dev/null 2>&1; then : +if ac_fn_c_try_cpp "$LINENO"; then : ntp_cv_iflist_sysctl=yes else ntp_cv_iflist_sysctl=no fi -rm -f conftest* - +rm -f conftest.err conftest.i conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_iflist_sysctl" >&5 @@ -25078,12 +35920,14 @@ else fi ntp_saveconfig_enabled=0 -if test "$ntp_ok" = "yes"; then +case "$ntp_ok" in + yes) ntp_saveconfig_enabled=1 $as_echo "#define SAVECONFIG 1" >>confdefs.h -fi + ;; +esac if test x$ntp_saveconfig_enabled = x1; then SAVECONFIG_ENABLED_TRUE= SAVECONFIG_ENABLED_FALSE='#' @@ -25095,25 +35939,128 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 $as_echo "$ntp_ok" >&6; } + +gta=false + +# Check whether --with-gtest was given. +if test "${with_gtest+set}" = set; then : + withval=$with_gtest; try_gtest=$withval +else + try_gtest=yes + +fi + +case "$try_gtest" in + yes) + # Extract the first word of "gtest-config", so it can be a program name with args. +set dummy gtest-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTEST_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTEST_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTEST_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTEST_CONFIG=$ac_cv_path_GTEST_CONFIG +if test -n "$GTEST_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5 +$as_echo "$GTEST_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { ac_cv_path_GTEST_CONFIG=; unset ac_cv_path_GTEST_CONFIG;} + case x${GTEST_CONFIG} in + x) ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking gtest version" >&5 +$as_echo_n "checking gtest version... " >&6; } + gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow` + case "$gtest_version_test" in + toolow*) + ;; + *) + GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags` + GTEST_LIBS=`$GTEST_CONFIG --libs` + GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags` + GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags` + + + + + gta=true + ;; + esac + gtest_version=`$GTEST_CONFIG --version` + case "$gta" in + true) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) ok" >&5 +$as_echo "($gtest_version) ok" >&6; } + ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) not ok" >&5 +$as_echo "($gtest_version) not ok" >&6; } + ;; + esac + { gtest_version_test=; unset gtest_version_test;} + { gtest_version=; unset gtest_version;} + esac +esac + if $gta; then + GTEST_AVAILABLE_TRUE= + GTEST_AVAILABLE_FALSE='#' +else + GTEST_AVAILABLE_TRUE='#' + GTEST_AVAILABLE_FALSE= +fi + + + + ### - ac_expanded=`( - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" - eval echo \""$sysconfdir"\" - )` + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$sysconfdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + NTP_KEYSDIR="$ac_define_dir" + cat >>confdefs.h <<_ACEOF -#define NTP_KEYSDIR "$ac_expanded" +#define NTP_KEYSDIR "$ac_define_dir" _ACEOF + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE ac_config_files="$ac_config_files Makefile" -ac_config_files="$ac_config_files ElectricFence/Makefile" - ac_config_files="$ac_config_files adjtimed/Makefile" ac_config_files="$ac_config_files clockstuff/Makefile" @@ -25132,6 +36079,8 @@ ac_config_files="$ac_config_files libparse/Makefile" ac_config_files="$ac_config_files ntpd/Makefile" +ac_config_files="$ac_config_files ntpd/complete.conf" + ac_config_files="$ac_config_files ntpdate/Makefile" ac_config_files="$ac_config_files ntpdc/Makefile" @@ -25146,21 +36095,25 @@ ac_config_files="$ac_config_files parseutil/Makefile" ac_config_files="$ac_config_files scripts/Makefile" -ac_config_files="$ac_config_files scripts/calc_tickadj" +ac_config_files="$ac_config_files scripts/lib/Makefile" + +ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj" -ac_config_files="$ac_config_files scripts/checktime" +ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile" -ac_config_files="$ac_config_files scripts/freq_adj" +ac_config_files="$ac_config_files scripts/build/mkver" -ac_config_files="$ac_config_files scripts/html2man" +ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait" -ac_config_files="$ac_config_files scripts/mkver" +ac_config_files="$ac_config_files scripts/ntp-wait/Makefile" -ac_config_files="$ac_config_files scripts/ntp-wait" +ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep" -ac_config_files="$ac_config_files scripts/ntpsweep" +ac_config_files="$ac_config_files scripts/ntpsweep/Makefile" -ac_config_files="$ac_config_files scripts/ntptrace" +ac_config_files="$ac_config_files scripts/ntptrace/ntptrace" + +ac_config_files="$ac_config_files scripts/ntptrace/Makefile" ac_config_files="$ac_config_files scripts/ntpver" @@ -25168,9 +36121,49 @@ ac_config_files="$ac_config_files scripts/plot_summary" ac_config_files="$ac_config_files scripts/summary" +ac_config_files="$ac_config_files scripts/build/Makefile" + +ac_config_files="$ac_config_files tests/Makefile" + +ac_config_files="$ac_config_files tests/libntp/Makefile" + +ac_config_files="$ac_config_files tests/ntpd/Makefile" + ac_config_files="$ac_config_files util/Makefile" +perllibdir="${datadir}/ntp/lib" + + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$perllibdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + PERLLIBDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define PERLLIBDIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + +calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts" + +ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts" + +ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts" + +ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts" + +summary_opts="$srcdir/scripts/summary-opts" + +plot_summary_opts="$srcdir/scripts/plot_summary-opts" + + subdirs="$subdirs sntp" @@ -25305,10 +36298,27 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${VPATH_HACK_TRUE}" && test -z "${VPATH_HACK_FALSE}"; then as_fn_error $? "conditional \"VPATH_HACK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WANT_CALC_TICKADJ_MS_TRUE}" && test -z "${WANT_CALC_TICKADJ_MS_FALSE}"; then + as_fn_error $? "conditional \"WANT_CALC_TICKADJ_MS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; then + as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${INSTALL_LIBOPTS_TRUE}" && test -z "${INSTALL_LIBOPTS_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LIBOPTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -25321,15 +36331,22 @@ if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; th as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${NTP_BINSUBDIR_IS_BIN_TRUE}" && test -z "${NTP_BINSUBDIR_IS_BIN_FALSE}"; then - as_fn_error $? "conditional \"NTP_BINSUBDIR_IS_BIN\" was never defined. +if test -z "${PTHREADS_TRUE}" && test -z "${PTHREADS_FALSE}"; then + as_fn_error $? "conditional \"PTHREADS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SNTP_TRUE}" && test -z "${BUILD_SNTP_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SNTP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi - if test -z "${SAVECONFIG_ENABLED_TRUE}" && test -z "${SAVECONFIG_ENABLED_FALSE}"; then as_fn_error $? "conditional \"SAVECONFIG_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GTEST_AVAILABLE_TRUE}" && test -z "${GTEST_AVAILABLE_FALSE}"; then + as_fn_error $? "conditional \"GTEST_AVAILABLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -25739,7 +36756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.6p5, which was +This file was extended by ntp4 $as_me 4.2.8, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25799,13 +36816,14 @@ $config_headers Configuration commands: $config_commands -Report bugs to the package provider." +Report bugs to <http://bugs.ntp.org./>. +ntp4 home page: <http://www.ntp.org./>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ntp config.status 4.2.6p5 +ntp4 config.status 4.2.8 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -26064,6 +37082,61 @@ enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_sub enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -26142,7 +37215,39 @@ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ -striplib; do +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_flag_spec_ld_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" @@ -26172,7 +37277,18 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" @@ -26203,6 +37319,8 @@ fi + + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -26215,7 +37333,6 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "ElectricFence/Makefile") CONFIG_FILES="$CONFIG_FILES ElectricFence/Makefile" ;; "adjtimed/Makefile") CONFIG_FILES="$CONFIG_FILES adjtimed/Makefile" ;; "clockstuff/Makefile") CONFIG_FILES="$CONFIG_FILES clockstuff/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; @@ -26225,6 +37342,7 @@ do "libntp/Makefile") CONFIG_FILES="$CONFIG_FILES libntp/Makefile" ;; "libparse/Makefile") CONFIG_FILES="$CONFIG_FILES libparse/Makefile" ;; "ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpd/Makefile" ;; + "ntpd/complete.conf") CONFIG_FILES="$CONFIG_FILES ntpd/complete.conf" ;; "ntpdate/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdate/Makefile" ;; "ntpdc/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdc/Makefile" ;; "ntpdc/nl.pl") CONFIG_FILES="$CONFIG_FILES ntpdc/nl.pl" ;; @@ -26232,17 +37350,23 @@ do "ntpsnmpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpsnmpd/Makefile" ;; "parseutil/Makefile") CONFIG_FILES="$CONFIG_FILES parseutil/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; - "scripts/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj" ;; - "scripts/checktime") CONFIG_FILES="$CONFIG_FILES scripts/checktime" ;; - "scripts/freq_adj") CONFIG_FILES="$CONFIG_FILES scripts/freq_adj" ;; - "scripts/html2man") CONFIG_FILES="$CONFIG_FILES scripts/html2man" ;; - "scripts/mkver") CONFIG_FILES="$CONFIG_FILES scripts/mkver" ;; - "scripts/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait" ;; - "scripts/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep" ;; - "scripts/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace" ;; + "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;; + "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;; + "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;; + "scripts/build/mkver") CONFIG_FILES="$CONFIG_FILES scripts/build/mkver" ;; + "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;; + "scripts/ntp-wait/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/Makefile" ;; + "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;; + "scripts/ntpsweep/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/Makefile" ;; + "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;; + "scripts/ntptrace/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/Makefile" ;; "scripts/ntpver") CONFIG_FILES="$CONFIG_FILES scripts/ntpver" ;; "scripts/plot_summary") CONFIG_FILES="$CONFIG_FILES scripts/plot_summary" ;; "scripts/summary") CONFIG_FILES="$CONFIG_FILES scripts/summary" ;; + "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;; + "tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -26292,7 +37416,24 @@ ac_tmp=$tmp # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then - +if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then + ac_cs_awk_getline=: + ac_cs_awk_pipe_init= + ac_cs_awk_read_file=' + while ((getline aline < (F[key])) > 0) + print(aline) + close(F[key])' + ac_cs_awk_pipe_fini= +else + ac_cs_awk_getline=false + ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" + ac_cs_awk_read_file=' + print "|#_!!_#|" + print "cat " F[key] " &&" + '$ac_cs_awk_pipe_init + # The final `:' finishes the AND list. + ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' +fi ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this @@ -26310,6 +37451,17 @@ fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF +# Create commands to substitute file output variables. +{ + echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && + echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && + echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && + echo "_ACAWK" && + echo "_ACEOF" +} >conf$$files.sh && +. ./conf$$files.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +rm -f conf$$files.sh { echo "cat >conf$$subs.awk <<_ACEOF" && @@ -26386,7 +37538,7 @@ _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" - + \$ac_cs_awk_pipe_init } { line = $ 0 @@ -26404,10 +37556,16 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && } else len += 1 + keylen } - + if (nfields == 3 && !substed) { + key = field[2] + if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { + \$ac_cs_awk_read_file + next + } + } print line } - +\$ac_cs_awk_pipe_fini _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -26754,7 +37912,12 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | +if $ac_cs_awk_getline; then + $AWK -f "$ac_tmp/subs.awk" +else + $AWK -f "$ac_tmp/subs.awk" | $SHELL +fi \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && @@ -26984,7 +38147,7 @@ $as_echo X"$file" | # The names of the tagged configurations supported by this script. -available_tags="" +available_tags="CXX " # ### BEGIN LIBTOOL CONFIG @@ -27372,6 +38535,20 @@ file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + # ### END LIBTOOL CONFIG _LT_EOF @@ -27564,16 +38741,171 @@ fi (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + ;; + "ntpd/complete.conf":F) sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf ;; "ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;; - "scripts/calc_tickadj":F) chmod +x scripts/calc_tickadj ;; - "scripts/checktime":F) chmod +x scripts/checktime ;; - "scripts/freq_adj":F) chmod +x scripts/freq_adj ;; - "scripts/html2man":F) chmod +x scripts/html2man ;; - "scripts/mkver":F) chmod +x scripts/mkver ;; - "scripts/ntp-wait":F) chmod +x scripts/ntp-wait ;; - "scripts/ntpsweep":F) chmod +x scripts/ntpsweep ;; - "scripts/ntptrace":F) chmod +x scripts/ntptrace ;; + "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;; + "scripts/build/mkver":F) chmod +x scripts/build/mkver ;; + "scripts/ntp-wait/ntp-wait":F) chmod +x scripts/ntp-wait/ntp-wait ;; + "scripts/ntpsweep/ntpsweep":F) chmod +x scripts/ntpsweep/ntpsweep ;; + "scripts/ntptrace/ntptrace":F) chmod +x scripts/ntptrace/ntptrace ;; "scripts/ntpver":F) chmod +x scripts/ntpver ;; "scripts/plot_summary":F) chmod +x scripts/plot_summary ;; "scripts/summary":F) chmod +x scripts/summary ;; |