apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr configure.in
Date Sun, 25 Feb 2001 15:42:56 GMT
trawick     01/02/25 07:42:56

  Modified:    .        configure.in
  Log:
  Move the check for threads to a point earlier in the configure
  phase so that if we adjust CPPFLAGS for threading support we'll
  use the same CPPFLAGS value for more of the tests.
  
  This fixes a build problem on Solaris.  We tested for the sigwait()
  flavor before updating CPPFLAGS for thread support, but with the
  updated CPPFLAGS we got the other flavor of sigwait().
  
  Submitted by:	Justin Erenkrantz <jerenkrantz@ebuilt.com>
  
  I've tested this on Solaris 8, FreeBSD 3.4, and RH 6.0 (glibc 2.11).
  
  Revision  Changes    Path
  1.241     +112 -112  apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.240
  retrieving revision 1.241
  diff -u -r1.240 -r1.241
  --- configure.in	2001/02/25 15:20:01	1.240
  +++ configure.in	2001/02/25 15:42:55	1.241
  @@ -147,6 +147,118 @@
           ;;
   esac
   
  +dnl #----------------------------- Checking for Threads
  +echo $ac_n "${nl}Checking for Threads...${nl}"
  +
  +if test -z "$enable_threads"; then
  +	AC_ARG_ENABLE(threads,
  +	[  --enable-threads        Enable threading support in APR.],
  +	[ enable_threads=$enableval] ,
  +	[ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] ,
  +	                       [ enable_threads="no" ] ) ] )
  +fi
  +
  +if test "$enable_threads" = "no"; then
  +echo "Don't enable threads"
  +    threads="0"
  +    pthreadh="0"
  +    pthreadser="0"
  +else
  +#
  +#   Play with CPPFLAGS given what was learned from APR_PRELOAD.
  +#
  +#   [Roy: I don't like this because it messes up an environment
  +#         variable that should remain pristine.  However, it is needed
  +#         for compatibility until all flag handling can be rewritten.]
  +#
  +    apr_save_cppflags="$CPPFLAGS"
  +    if test -n "$THREAD_CPPFLAGS"; then
  +        CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
  +    fi
  +    if test "$enable_threads" = "pthread"; then
  +# We have specified pthreads for our threading library, just make sure
  +# that we have everything we need
  +      APR_PTHREADS_CHECK
  +      APR_CHECK_PTHREADS_H([
  +          threads="1"
  +          pthreadh="1"
  +          pthreadser="1"
  +          AC_DEFINE(USE_THREADS) ], [
  +          threads="0"
  +          pthreadh="0"
  +          pthreadser="0" ] )
  +    elif test "$enable_threads" = "system_threads"; then
  +        threads="1"
  +        pthreadh="0"
  +        pthreadser="0"
  +    else
  +# We basically specified that we wanted threads, but not how to implement
  +# them.  In this case, just look for pthreads.  In the future, we can check
  +# for other threading libraries as well.
  +      APR_PTHREADS_CHECK
  +      APR_CHECK_PTHREADS_H([
  +          threads="1"
  +          pthreadh="1"
  +          pthreadser="1"
  +          AC_DEFINE(USE_THREADS) ], [
  +          threads="0"
  +          pthreadser="0"
  +          pthreadh="0"
  +          CPPFLAGS="$apr_save_cppflags" ] )
  +    fi
  +    if test "$pthreadh" = "1"; then
  +        APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
  +        APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
  +        AC_CHECK_FUNCS(pthread_key_delete)
  +    fi
  +fi
  +
  +ac_cv_define_READDIR_IS_THREAD_SAFE=no
  +if test "$threads" = "1"; then
  +    echo "APR will use threads"
  +    AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE))
  +else
  +    echo "APR will be non-threaded"
  +fi
  +
  +AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) 
  +
  +AC_SUBST(threads)
  +AC_SUBST(have_sigwait)
  +
  +dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a
  +dnl threaded poll() and we don't want to use sendfile on early FreeBSD 
  +dnl systems if we are also using threads.
  +
  +orig_sendfile=$sendfile
  +case "$OS" in
  +    *freebsd*)
  +        if test $os_version -le "410"; then
  +            if test "$threads" = "1"; then
  +                sendfile="0"
  +            fi
  +        fi
  +        ;;
  +    *alpha*-dec-osf* )
  +        sendfile="0"
  +        ;;
  +    s390-*-linux-gnu)
  +        sendfile="0"
  +        ;;
  +esac       
  +if test "$orig_sendfile" != "$sendfile"; then
  +  echo "sendfile support disabled to avoid system problem"
  +fi
  +AC_SUBST(sendfile)
  +
  +
  +AC_CHECK_FUNCS(poll)
  +
  +dnl #----------------------------- Checking for missing POSIX thread functions
  +AC_CHECK_FUNCS(getpwnam_r)
  +AC_CHECK_FUNCS(getpwuid_r)
  +AC_CHECK_FUNCS(getgrgid_r)
  +
   dnl #----------------------------- Checking for Shared Memory Support 
   echo $ac_n "${nl}Checking for Shared Memory Support...${nl}"
   
  @@ -562,118 +674,6 @@
   fi
   
   AC_SUBST(aprdso)
  -
  -dnl #----------------------------- Checking for Threads
  -echo $ac_n "${nl}Checking for Threads...${nl}"
  -
  -if test -z "$enable_threads"; then
  -	AC_ARG_ENABLE(threads,
  -	[  --enable-threads        Enable threading support in APR.],
  -	[ enable_threads=$enableval] ,
  -	[ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] ,
  -	                       [ enable_threads="no" ] ) ] )
  -fi
  -
  -if test "$enable_threads" = "no"; then
  -echo "Don't enable threads"
  -    threads="0"
  -    pthreadh="0"
  -    pthreadser="0"
  -else
  -#
  -#   Play with CPPFLAGS given what was learned from APR_PRELOAD.
  -#
  -#   [Roy: I don't like this because it messes up an environment
  -#         variable that should remain pristine.  However, it is needed
  -#         for compatibility until all flag handling can be rewritten.]
  -#
  -    apr_save_cppflags="$CPPFLAGS"
  -    if test -n "$THREAD_CPPFLAGS"; then
  -        CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
  -    fi
  -    if test "$enable_threads" = "pthread"; then
  -# We have specified pthreads for our threading library, just make sure
  -# that we have everything we need
  -      APR_PTHREADS_CHECK
  -      APR_CHECK_PTHREADS_H([
  -          threads="1"
  -          pthreadh="1"
  -          pthreadser="1"
  -          AC_DEFINE(USE_THREADS) ], [
  -          threads="0"
  -          pthreadh="0"
  -          pthreadser="0" ] )
  -    elif test "$enable_threads" = "system_threads"; then
  -        threads="1"
  -        pthreadh="0"
  -        pthreadser="0"
  -    else
  -# We basically specified that we wanted threads, but not how to implement
  -# them.  In this case, just look for pthreads.  In the future, we can check
  -# for other threading libraries as well.
  -      APR_PTHREADS_CHECK
  -      APR_CHECK_PTHREADS_H([
  -          threads="1"
  -          pthreadh="1"
  -          pthreadser="1"
  -          AC_DEFINE(USE_THREADS) ], [
  -          threads="0"
  -          pthreadser="0"
  -          pthreadh="0"
  -          CPPFLAGS="$apr_save_cppflags" ] )
  -    fi
  -    if test "$pthreadh" = "1"; then
  -        APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
  -        APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
  -        AC_CHECK_FUNCS(pthread_key_delete)
  -    fi
  -fi
  -
  -ac_cv_define_READDIR_IS_THREAD_SAFE=no
  -if test "$threads" = "1"; then
  -    echo "APR will use threads"
  -    AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE))
  -else
  -    echo "APR will be non-threaded"
  -fi
  -
  -AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) 
  -
  -AC_SUBST(threads)
  -AC_SUBST(have_sigwait)
  -
  -dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a
  -dnl threaded poll() and we don't want to use sendfile on early FreeBSD 
  -dnl systems if we are also using threads.
  -
  -orig_sendfile=$sendfile
  -case "$OS" in
  -    *freebsd*)
  -        if test $os_version -le "410"; then
  -            if test "$threads" = "1"; then
  -                sendfile="0"
  -            fi
  -        fi
  -        ;;
  -    *alpha*-dec-osf* )
  -        sendfile="0"
  -        ;;
  -    s390-*-linux-gnu)
  -        sendfile="0"
  -        ;;
  -esac       
  -if test "$orig_sendfile" != "$sendfile"; then
  -  echo "sendfile support disabled to avoid system problem"
  -fi
  -AC_SUBST(sendfile)
  -
  -
  -AC_CHECK_FUNCS(poll)
  -
  -dnl #----------------------------- Checking for missing POSIX thread functions
  -AC_CHECK_FUNCS(getpwnam_r)
  -AC_CHECK_FUNCS(getpwuid_r)
  -AC_CHECK_FUNCS(getgrgid_r)
   
   dnl #----------------------------- Checking for Processes
   echo $ac_n "${nl}Checking for Processes...${nl}"
  
  
  

Mime
View raw message