Skip to content
configure 834 KiB
Newer Older
powelld's avatar
powelld committed
19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000

$as_echo "#define HAVE_ATOMIC_BUILTINS 1" >>confdefs.h

fi

case $host in
    powerpc-405-*)
        # The IBM ppc405cr processor has a bugged stwcx instruction.

$as_echo "#define PPC405_ERRATA 1" >>confdefs.h

        ;;
    *)
        ;;
esac


if test "$GCC" = "yes"; then
  MKDEP='$(CC) -MM'
else
  rm -f conftest.c
  cat > conftest.c <<EOF
#include <sys/types.h>
  int main() { return 0; }
EOF
  MKDEP="true"
  for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $i can create proper make dependencies" >&5
$as_echo_n "checking if $i can create proper make dependencies... " >&6; }
    if $i conftest.c 2>/dev/null | grep 'conftest.o: conftest.c' >/dev/null; then
      MKDEP=$i
      { $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
  rm -f conftest.c
fi




proc_mutex_is_global=0

config_subdirs="none"
INSTALL_SUBDIRS="none"
OBJECTS_PLATFORM='$(OBJECTS_unix)'

case $host in
   i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
       OSDIR="aix"

  if test "x$LDFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting LDFLAGS to \"-lld\""
    LDFLAGS="-lld"
  else
    apr_addto_bugger="-lld"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $LDFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to LDFLAGS"
        LDFLAGS="$LDFLAGS $i"
      fi
    done
  fi

       eolstr="\\n"
       OBJECTS_PLATFORM='$(OBJECTS_aix)'
       ;;
   *-os2*)

  if test "x$CPPFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting CPPFLAGS to \"-DOS2\""
    CPPFLAGS="-DOS2"
  else
    apr_addto_bugger="-DOS2"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $CPPFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $i"
      fi
    done
  fi


  if test "x$CFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting CFLAGS to \"-Zmt\""
    CFLAGS="-Zmt"
  else
    apr_addto_bugger="-Zmt"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $CFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to CFLAGS"
        CFLAGS="$CFLAGS $i"
      fi
    done
  fi

       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for random in -lbsd" >&5
$as_echo_n "checking for random in -lbsd... " >&6; }
if ${ac_cv_lib_bsd_random+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd  $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 random ();
int
main ()
{
return random ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_bsd_random=yes
else
  ac_cv_lib_bsd_random=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_bsd_random" >&5
$as_echo "$ac_cv_lib_bsd_random" >&6; }
if test "x$ac_cv_lib_bsd_random" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBBSD 1
_ACEOF

  LIBS="-lbsd $LIBS"

fi

       OSDIR="os2"
       enable_threads="system_threads"
       eolstr="\\r\\n"
       file_as_socket="0"
       proc_mutex_is_global=1
       OBJECTS_PLATFORM='$(OBJECTS_os2)'
       ;;
   *beos*)
       OSDIR="beos"

  if test "x$CPPFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting CPPFLAGS to \"-DBEOS\""
    CPPFLAGS="-DBEOS"
  else
    apr_addto_bugger="-DBEOS"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $CPPFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $i"
      fi
    done
  fi

       enable_threads="system_threads"
       native_mmap_emul="1"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BONE_VERSION in sys/socket.h" >&5
$as_echo_n "checking for BONE_VERSION in sys/socket.h... " >&6; }
if ${ac_cv_define_BONE_VERSION+:} false; then :
  $as_echo_n "(cached) " >&6
else

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <sys/socket.h>
#ifdef BONE_VERSION
YES_IS_DEFINED
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "YES_IS_DEFINED" >/dev/null 2>&1; then :
  ac_cv_define_BONE_VERSION=yes
else
  ac_cv_define_BONE_VERSION=no
fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_BONE_VERSION" >&5
$as_echo "$ac_cv_define_BONE_VERSION" >&6; }
  if test "$ac_cv_define_BONE_VERSION" = "yes"; then

$as_echo "#define HAVE_BONE_VERSION 1" >>confdefs.h

  fi

       eolstr="\\n"
       osver=`uname -r`
       proc_mutex_is_global=1
       OBJECTS_PLATFORM='$(OBJECTS_beos)'
       case $osver in
          5.0.4)
             file_as_socket="1"
             ;;
          *)
             file_as_socket="0"
             ;;
       esac
       ;;
   *apple-darwin*)
       ac_cv_func_fdatasync="no" # Mac OS X wrongly reports it has fdatasync()
       OSDIR="unix"
       eolstr="\\n"
       ;;
   *os390)
       OSDIR="os390"
       OBJECTS_PLATFORM='$(OBJECTS_os390)'
       eolstr="\\n"
       ;;
   *os400)
       OSDIR="as400"
       eolstr="\\n"
       ;;
   *mingw*)
       OSDIR="win32"
       enable_threads="system_threads"
       eolstr="\\r\\n"
       file_as_socket=0
       proc_mutex_is_global=1
       OBJECTS_PLATFORM='$(OBJECTS_win32)'
       ;;
   *cygwin*)
       OSDIR="unix"
       enable_threads="no"
       eolstr="\\n"
       ;;
   *hpux10* )
       enable_threads="no"
       OSDIR="unix"
       eolstr="\\n"
       ;;
   *darwin* )
       ac_cv_func_fdatasync="no" # Mac OS X wrongly reports it has fdatasync()
       OSDIR="unix"
       eolstr="\\n"
       ;;
   *)
       OSDIR="unix"
       eolstr="\\n"
       ;;
esac



# Check whether LFS has explicitly been disabled
# Check whether --enable-lfs was given.
if test "${enable_lfs+set}" = set; then :
  enableval=$enable_lfs; apr_lfs_choice=$enableval
else
  apr_lfs_choice=yes
fi


if test "$apr_lfs_choice" = "yes"; then
   # Check whether the transitional LFS API is sufficient
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable -D_LARGEFILE64_SOURCE" >&5
$as_echo_n "checking whether to enable -D_LARGEFILE64_SOURCE... " >&6; }
if ${apr_cv_use_lfs64+:} false; then :
  $as_echo_n "(cached) " >&6
else

   apr_save_CPPFLAGS=$CPPFLAGS
   CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
   if test "$cross_compiling" = yes; then :
  apr_cv_use_lfs64=no
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

void main(void)
{
    int fd, ret = 0;
    struct stat64 st;
    off64_t off = 4242;

    if (sizeof(off64_t) != 8 || sizeof(off_t) != 4)
       exit(1);
    if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY, 0644)) < 0)
       exit(2);
    if (ftruncate64(fd, off) != 0)
       ret = 3;
    else if (fstat64(fd, &st) != 0 || st.st_size != off)
       ret = 4;
    else if (lseek64(fd, off, SEEK_SET) != off)
       ret = 5;
    else if (close(fd) != 0)
       ret = 6;
    else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off)
       ret = 7;
    else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off)
       ret = 8;
    unlink("conftest.lfs");

    exit(ret);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  apr_cv_use_lfs64=yes
else
  apr_cv_use_lfs64=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

   CPPFLAGS=$apr_save_CPPFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_use_lfs64" >&5
$as_echo "$apr_cv_use_lfs64" >&6; }
   if test "$apr_cv_use_lfs64" = "yes"; then

  if test "x$CPPFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting CPPFLAGS to \"-D_LARGEFILE64_SOURCE\""
    CPPFLAGS="-D_LARGEFILE64_SOURCE"
  else
    apr_addto_bugger="-D_LARGEFILE64_SOURCE"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $CPPFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $i"
      fi
    done
  fi

   fi
fi

# Check whether --enable-nonportable-atomics was given.
if test "${enable_nonportable_atomics+set}" = set; then :
  enableval=$enable_nonportable_atomics; if test $enableval = yes; then
   force_generic_atomics=no
 else
   force_generic_atomics=yes
 fi

else
  case $host_cpu in
   i[456]86) force_generic_atomics=yes ;;
   *) force_generic_atomics=no
      case $host in
         *solaris2.10*)
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <atomic.h>
int
main ()
{
void *ptr = NULL; atomic_cas_ptr(&ptr, NULL, NULL);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  force_generic_atomics=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
            if test $force_generic_atomics = yes; then
                { $as_echo "$as_me:${as_lineno-$LINENO}: nonportable atomic support disabled, system needs Patch-ID 118884 or 118885" >&5
$as_echo "$as_me: nonportable atomic support disabled, system needs Patch-ID 118884 or 118885" >&6;}
            fi
            ;;
      esac
      ;;
esac

fi


if test $force_generic_atomics = yes; then

$as_echo "#define USE_ATOMICS_GENERIC 1" >>confdefs.h

fi





# For some platforms we need a version string which allows easy numeric
# comparisons.
case $host in
    *freebsd*)
        if test -x /sbin/sysctl; then
            os_version=`/sbin/sysctl -n kern.osreldate`
        else
            os_version=000000
        fi
        ;;
    *linux*)
        os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`
        os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'`
        if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Configured for pre-2.4 Linux $os_major.$os_minor" >&5
$as_echo "$as_me: WARNING: Configured for pre-2.4 Linux $os_major.$os_minor" >&2;}
            os_pre24linux=1
        else
            os_pre24linux=0
            { $as_echo "$as_me:${as_lineno-$LINENO}: Configured for Linux $os_major.$os_minor" >&5
$as_echo "$as_me: Configured for Linux $os_major.$os_minor" >&6;}
        fi
        ;;
    *os390)
        os_version=`uname -r | sed -e 's/\.//g'`
        ;;
    *)
        os_version=OS_VERSION_IS_NOT_SET
        ;;
esac

echo "${nl}Checking for libraries..."

case $host in
   *mingw*)

  if test "x$LIBS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting LIBS to \"-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock\""
    LIBS="-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock"
  else
    apr_addto_bugger="-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $LIBS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to LIBS"
        LIBS="$LIBS $i"
      fi
    done
  fi

      ac_cv_func_CreateFileMapping=yes
      ;;
   *)
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
$as_echo_n "checking for library containing gethostbyname... " >&6; }
if ${ac_cv_search_gethostbyname+:} 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 gethostbyname ();
int
main ()
{
return gethostbyname ();
  ;
  return 0;
}
_ACEOF
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_gethostbyname=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_gethostbyname+:} false; then :
  break
fi
done
if ${ac_cv_search_gethostbyname+:} false; then :

else
  ac_cv_search_gethostbyname=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
$as_echo "$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
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 gethostname" >&5
$as_echo_n "checking for library containing gethostname... " >&6; }
if ${ac_cv_search_gethostname+:} 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 gethostname ();
int
main ()
{
return gethostname ();
  ;
  return 0;
}
_ACEOF
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_gethostname=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_gethostname+:} false; then :
  break
fi
done
if ${ac_cv_search_gethostname+:} false; then :

else
  ac_cv_search_gethostname=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostname" >&5
$as_echo "$ac_cv_search_gethostname" >&6; }
ac_res=$ac_cv_search_gethostname
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 socket" >&5
$as_echo_n "checking for library containing socket... " >&6; }
if ${ac_cv_search_socket+:} 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 socket ();
int
main ()
{
return socket ();
  ;
  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_socket=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_socket+:} false; then :
  break
fi
done
if ${ac_cv_search_socket+:} false; then :

else
  ac_cv_search_socket=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
$as_echo "$ac_cv_search_socket" >&6; }
ac_res=$ac_cv_search_socket
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 crypt" >&5
$as_echo_n "checking for library containing crypt... " >&6; }
if ${ac_cv_search_crypt+:} 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 crypt ();
int
main ()
{
return crypt ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' crypt ufc; 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_crypt=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_crypt+:} false; then :
  break
fi
done
if ${ac_cv_search_crypt+:} false; then :

else
  ac_cv_search_crypt=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
$as_echo "$ac_cv_search_crypt" >&6; }
ac_res=$ac_cv_search_crypt
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 main in -ltruerand" >&5
$as_echo_n "checking for main in -ltruerand... " >&6; }
if ${ac_cv_lib_truerand_main+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltruerand  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_truerand_main=yes
else
  ac_cv_lib_truerand_main=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_truerand_main" >&5
$as_echo "$ac_cv_lib_truerand_main" >&6; }
if test "x$ac_cv_lib_truerand_main" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBTRUERAND 1
_ACEOF

  LIBS="-ltruerand $LIBS"

fi

      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing modf" >&5
$as_echo_n "checking for library containing modf... " >&6; }
if ${ac_cv_search_modf+:} 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 modf ();
int
main ()
{
return modf ();
  ;
  return 0;
}
_ACEOF
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_modf=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_modf+:} false; then :
  break
fi
done
if ${ac_cv_search_modf+:} false; then :

else
  ac_cv_search_modf=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_modf" >&5
$as_echo "$ac_cv_search_modf" >&6; }
ac_res=$ac_cv_search_modf
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

       ;;
esac

echo "${nl}Checking for Threads..."

if test -z "$enable_threads"; then
	# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
  enableval=$enable_threads;  enable_threads=$enableval
else

  if test "$GCC" = "yes"; then
    SAVE_FL="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS -w"
    for ac_header in pthread.h
do :
  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 HAVE_PTHREAD_H 1
_ACEOF
   enable_threads="pthread"
else
    enable_threads="no"
fi

done

    CPPFLAGS="$SAVE_FL"
  else
    for ac_header in pthread.h
do :
  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 HAVE_PTHREAD_H 1
_ACEOF
   enable_threads="pthread"
else
    enable_threads="no"
fi

done

  fi

fi

fi

if test "$enable_threads" = "no"; then
    threads="0"
    pthreadh="0"
    pthreadser="0"
else
    if test "$enable_threads" = "pthread"; then
# We have specified pthreads for our threading library, just make sure
# that we have everything we need

  apr_pthsv_CFLAGS="$CFLAGS"
  apr_pthsv_LIBS="$LIBS"



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for pthreads" >&5
$as_echo_n "checking for CFLAGS needed for pthreads... " >&6; }
if ${apr_cv_pthreads_cflags+:} false; then :
  $as_echo_n "(cached) " >&6
else
  apr_ptc_cflags=$CFLAGS
 for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do
    CFLAGS=$apr_ptc_cflags
    test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag"

if test "$cross_compiling" = yes; then :
  apr_p_t_r=no
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    pthread_once_t once_init = PTHREAD_ONCE_INIT;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  apr_p_t_r=yes
else
  apr_p_t_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


if test $apr_p_t_r = yes; then

      apr_cv_pthreads_cflags="$flag"
      break

fi


 done
 CFLAGS=$apr_ptc_cflags

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_cflags" >&5
$as_echo "$apr_cv_pthreads_cflags" >&6; }

if test -n "$apr_cv_pthreads_cflags"; then
   pthreads_working=yes
   if test "x$apr_cv_pthreads_cflags" != "xnone"; then

  if test "x$CFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting CFLAGS to \"$apr_cv_pthreads_cflags\""
    CFLAGS="$apr_cv_pthreads_cflags"
  else
    apr_addto_bugger="$apr_cv_pthreads_cflags"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $CFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to CFLAGS"
        CFLAGS="$CFLAGS $i"
      fi
    done
  fi

   fi
fi

# The CFLAGS may or may not be sufficient to ensure that libapr
# depends on the pthreads library: some versions of libtool
# drop -pthread when passed on the link line; some versions of
# gcc ignore -pthread when linking a shared object.  So always
# try and add the relevant library to LIBS too.

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for pthreads" >&5
$as_echo_n "checking for LIBS needed for pthreads... " >&6; }
if ${apr_cv_pthreads_lib+:} false; then :
  $as_echo_n "(cached) " >&6
else

  apr_ptc_libs=$LIBS
  for lib in -lpthread -lpthreads -lc_r; do
    LIBS="$apr_ptc_libs $lib"

if test "$cross_compiling" = yes; then :
  apr_p_t_r=no
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    pthread_once_t once_init = PTHREAD_ONCE_INIT;
    int data = 1;