Develop and Download Open Source Software

Browse CVS Repository

Diff of /satellite/satellite4/configure

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.17 by orrisroot, Sun Oct 30 19:09:51 2005 UTC revision 1.18 by orrisroot, Sun Oct 30 19:40:54 2005 UTC
# Line 20692  acx_pthread_flags="pthreads none -Kthrea Line 20692  acx_pthread_flags="pthreads none -Kthrea
20692  # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it  # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
20693  #      doesn't hurt to check since this sometimes defines pthreads too;  #      doesn't hurt to check since this sometimes defines pthreads too;
20694  #      also defines -D_REENTRANT)  #      also defines -D_REENTRANT)
 #      ... -mt is also the pthreads flag for HP/aCC  
20695  # pthread: Linux, etcetera  # pthread: Linux, etcetera
20696  # --thread-safe: KAI C++  # --thread-safe: KAI C++
20697  # pthread-config: use pthread-config program (for GNU Pth library)  # pthread-config: use pthread-config program (for GNU Pth library)
# Line 20702  case "${host_cpu}-${host_os}" in Line 20701  case "${host_cpu}-${host_os}" in
20701    
20702          # On Solaris (at least, for some versions), libc contains stubbed          # On Solaris (at least, for some versions), libc contains stubbed
20703          # (non-functional) versions of the pthreads routines, so link-based          # (non-functional) versions of the pthreads routines, so link-based
20704          # tests will erroneously succeed.  (We need to link with -pthreads/-mt/          # tests will erroneously succeed.  (We need to link with -pthread or
20705          # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather          # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
20706          # a function called by this macro, so we could check for that, but          # a function called by this macro, so we could check for that, but
20707          # who knows whether they'll stub that too in a future libc.)  So,          # who knows whether they'll stub that too in a future libc.)  So,
20708          # we'll just look for -pthreads and -lpthread first:          # we'll just look for -pthreads and -lpthread first:
20709    
20710          acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"          acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
20711          ;;          ;;
20712  esac  esac
20713    
20714  if test x"$acx_pthread_ok" = xno; then  if test x"$acx_pthread_ok" = xno; then
20715  for flag in $acx_pthread_flags; do  for flag in $acx_pthread_flags; do
20716    
20717            tryPTHREAD_CFLAGS=""
20718            tryPTHREAD_LIBS=""
20719          case $flag in          case $flag in
20720                  none)                  none)
20721                  echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5                  echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
# Line 20724  echo $ECHO_N "checking whether pthreads Line 20725  echo $ECHO_N "checking whether pthreads
20725                  -*)                  -*)
20726                  echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5                  echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
20727  echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6  echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6
20728                  PTHREAD_CFLAGS="$flag"                  tryPTHREAD_CFLAGS="$flag"
20729                  ;;                  ;;
20730    
20731                  pthread-config)                  pthread-config)
20732                  # Extract the first word of "pthread-config", so it can be a program name with args.                  # skip this if we already have flags defined, for PostgreSQL
20733                    if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi
20734                    # Extract the first word of "pthread-config", so it can be a program name with args.
20735  set dummy pthread-config; ac_word=$2  set dummy pthread-config; ac_word=$2
20736  echo "$as_me:$LINENO: checking for $ac_word" >&5  echo "$as_me:$LINENO: checking for $ac_word" >&5
20737  echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6  echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
# Line 20764  else Line 20767  else
20767  echo "${ECHO_T}no" >&6  echo "${ECHO_T}no" >&6
20768  fi  fi
20769    
20770                  if test x"$acx_pthread_config" = xno; then continue; fi                  if test x"$acx_pthread_config" = xno; then continue; fi
20771                  PTHREAD_CFLAGS="`pthread-config --cflags`"                  tryPTHREAD_CFLAGS="`pthread-config --cflags`"
20772                  PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"                  tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
20773                  ;;                  ;;
20774    
20775                  *)                  *)
20776                  echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5                  echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
20777  echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6  echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6
20778                  PTHREAD_LIBS="-l$flag"                  tryPTHREAD_LIBS="-l$flag"
20779                  ;;                  ;;
20780          esac          esac
20781    
20782          save_LIBS="$LIBS"          save_LIBS="$LIBS"
20783          save_CFLAGS="$CFLAGS"          save_CFLAGS="$CFLAGS"
20784          LIBS="$PTHREAD_LIBS $LIBS"          LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS"
20785          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"          CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
20786    
20787          # Check for various functions.  We must include pthread.h,          # Check for various functions.  We must include pthread.h,
20788          # since some functions may be macros.  (On the Sequent, we          # since some functions may be macros.  (On the Sequent, we
# Line 20834  else Line 20837  else
20837    echo "$as_me: failed program was:" >&5    echo "$as_me: failed program was:" >&5
20838  sed 's/^/| /' conftest.$ac_ext >&5  sed 's/^/| /' conftest.$ac_ext >&5
20839    
20840    acx_pthread_ok=no
20841  fi  fi
20842  rm -f conftest.err conftest.$ac_objext \  rm -f conftest.err conftest.$ac_objext \
20843        conftest$ac_exeext conftest.$ac_ext        conftest$ac_exeext conftest.$ac_ext
20844    
20845            if test "x$acx_pthread_ok" = xyes; then
20846                # Don't use options that are ignored by the compiler.
20847                # We find them by checking stderror.
20848                cat >conftest.$ac_ext <<_ACEOF
20849    int
20850    main (int argc, char **argv)
20851    {
20852      (void) argc;
20853      (void) argv;
20854      return 0;
20855    }
20856    _ACEOF
20857                rm -f conftest.$ac_objext conftest$ac_exeext
20858                if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then
20859                    # we continue with more flags because Linux needs -lpthread
20860                    # for libpq builds on PostgreSQL.  The test above only
20861                    # tests for building binaries, not shared libraries.
20862                    PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS"
20863                    PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
20864                else   acx_pthread_ok=no
20865                fi
20866            fi
20867    
20868          LIBS="$save_LIBS"          LIBS="$save_LIBS"
20869          CFLAGS="$save_CFLAGS"          CFLAGS="$save_CFLAGS"
20870    
20871          echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5          echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
20872  echo "${ECHO_T}$acx_pthread_ok" >&6  echo "${ECHO_T}$acx_pthread_ok" >&6
         if test "x$acx_pthread_ok" = xyes; then  
                 break;  
         fi  
   
         PTHREAD_LIBS=""  
         PTHREAD_CFLAGS=""  
20873  done  done
20874  fi  fi
20875    
# Line 20859  if test "x$acx_pthread_ok" = xyes; then Line 20880  if test "x$acx_pthread_ok" = xyes; then
20880          save_CFLAGS="$CFLAGS"          save_CFLAGS="$CFLAGS"
20881          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
20882    
20883          # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.          # Detect AIX lossage: threads are created detached by default
20884          echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5          # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
20885            echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
20886  echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6  echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6
20887          attr_name=unknown          cat >conftest.$ac_ext <<_ACEOF
         for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do  
             cat >conftest.$ac_ext <<_ACEOF  
20888  /* confdefs.h.  */  /* confdefs.h.  */
20889  _ACEOF  _ACEOF
20890  cat confdefs.h >>conftest.$ac_ext  cat confdefs.h >>conftest.$ac_ext
# Line 20874  cat >>conftest.$ac_ext <<_ACEOF Line 20894  cat >>conftest.$ac_ext <<_ACEOF
20894  int  int
20895  main ()  main ()
20896  {  {
20897  int attr=$attr; return attr;  int attr=PTHREAD_CREATE_JOINABLE;
20898    ;    ;
20899    return 0;    return 0;
20900  }  }
# Line 20901  if { (eval echo "$as_me:$LINENO: \"$ac_l Line 20921  if { (eval echo "$as_me:$LINENO: \"$ac_l
20921    ac_status=$?    ac_status=$?
20922    echo "$as_me:$LINENO: \$? = $ac_status" >&5    echo "$as_me:$LINENO: \$? = $ac_status" >&5
20923    (exit $ac_status); }; }; then    (exit $ac_status); }; }; then
20924    attr_name=$attr; break    ok=PTHREAD_CREATE_JOINABLE
20925  else  else
20926    echo "$as_me: failed program was:" >&5    echo "$as_me: failed program was:" >&5
20927  sed 's/^/| /' conftest.$ac_ext >&5  sed 's/^/| /' conftest.$ac_ext >&5
20928    
20929    ok=unknown
20930  fi  fi
20931  rm -f conftest.err conftest.$ac_objext \  rm -f conftest.err conftest.$ac_objext \
20932        conftest$ac_exeext conftest.$ac_ext        conftest$ac_exeext conftest.$ac_ext
20933          done          if test x"$ok" = xunknown; then
20934          echo "$as_me:$LINENO: result: $attr_name" >&5                  cat >conftest.$ac_ext <<_ACEOF
20935  echo "${ECHO_T}$attr_name" >&6  /* confdefs.h.  */
20936          if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then  _ACEOF
20937    cat confdefs.h >>conftest.$ac_ext
20938    cat >>conftest.$ac_ext <<_ACEOF
20939    /* end confdefs.h.  */
20940    #include <pthread.h>
20941    int
20942    main ()
20943    {
20944    int attr=PTHREAD_CREATE_UNDETACHED;
20945      ;
20946      return 0;
20947    }
20948    _ACEOF
20949    rm -f conftest.$ac_objext conftest$ac_exeext
20950    if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
20951      (eval $ac_link) 2>conftest.er1
20952      ac_status=$?
20953      grep -v '^ *+' conftest.er1 >conftest.err
20954      rm -f conftest.er1
20955      cat conftest.err >&5
20956      echo "$as_me:$LINENO: \$? = $ac_status" >&5
20957      (exit $ac_status); } &&
20958             { ac_try='test -z "$ac_c_werror_flag"
20959                             || test ! -s conftest.err'
20960      { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
20961      (eval $ac_try) 2>&5
20962      ac_status=$?
20963      echo "$as_me:$LINENO: \$? = $ac_status" >&5
20964      (exit $ac_status); }; } &&
20965             { ac_try='test -s conftest$ac_exeext'
20966      { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
20967      (eval $ac_try) 2>&5
20968      ac_status=$?
20969      echo "$as_me:$LINENO: \$? = $ac_status" >&5
20970      (exit $ac_status); }; }; then
20971      ok=PTHREAD_CREATE_UNDETACHED
20972    else
20973      echo "$as_me: failed program was:" >&5
20974    sed 's/^/| /' conftest.$ac_ext >&5
20975    
20976  cat >>confdefs.h <<_ACEOF  ok=unknown
20977  #define PTHREAD_CREATE_JOINABLE $attr_name  fi
20978    rm -f conftest.err conftest.$ac_objext \
20979          conftest$ac_exeext conftest.$ac_ext
20980            fi
20981            if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
20982    
20983    cat >>confdefs.h <<\_ACEOF
20984    #define PTHREAD_CREATE_JOINABLE $ok
20985  _ACEOF  _ACEOF
20986    
20987          fi          fi
20988            echo "$as_me:$LINENO: result: ${ok}" >&5
20989    echo "${ECHO_T}${ok}" >&6
20990            if test x"$ok" = xunknown; then
20991                    { echo "$as_me:$LINENO: WARNING: we do not know how to create joinable pthreads" >&5
20992    echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;}
20993            fi
20994    
20995          echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5          echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
20996  echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6  echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
20997          flag=no          flag=no
20998          case "${host_cpu}-${host_os}" in  # We always add these in PostgreSQL
20999              *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;  #       case "${host_cpu}-${host_os}" in
21000              *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;  #               *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
21001          esac  #               *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
21002    #       esac
21003          echo "$as_me:$LINENO: result: ${flag}" >&5          echo "$as_me:$LINENO: result: ${flag}" >&5
21004  echo "${ECHO_T}${flag}" >&6  echo "${ECHO_T}${flag}" >&6
21005          if test "x$flag" != xno; then          if test "x$flag" != xno; then
21006              PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"                  PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
21007          fi          fi
21008    
21009          LIBS="$save_LIBS"          LIBS="$save_LIBS"
21010          CFLAGS="$save_CFLAGS"          CFLAGS="$save_CFLAGS"
21011    
21012    # Supporting cc_r would require a special CC in all places that
21013    # use libpq, and that is ugly, so we don't do it.  Users can still
21014    # define their compiler as cc_r to do thread builds of everything.
21015          # More AIX lossage: must compile with cc_r          # More AIX lossage: must compile with cc_r
21016          # Extract the first word of "cc_r", so it can be a program name with args.          # Extract the first word of "cc_r", so it can be a program name with args.
21017  set dummy cc_r; ac_word=$2  set dummy cc_r; ac_word=$2
# Line 21000  ac_link='$CC -o conftest$ac_exeext $CFLA Line 21076  ac_link='$CC -o conftest$ac_exeext $CFLA
21076  ac_compiler_gnu=$ac_cv_c_compiler_gnu  ac_compiler_gnu=$ac_cv_c_compiler_gnu
21077    
21078    
21079    # Some platforms use these, so just defineed them.  They can't hurt if they
21080    # are not supported.
21081    PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
21082    # At this point, we don't want to muck with the compiler name for threading.
21083    # Let's see who fails, perhaps AIX.  2004-04-23
21084    if test "$PTHREAD_CC" != "$CC"; then
21085    { { echo "$as_me:$LINENO: error:
21086    satellite4 does not support platforms that require a special
21087    compiler binary for thread-safety.
21088    " >&5
21089    echo "$as_me: error:
21090    satellite4 does not support platforms that require a special
21091    compiler binary for thread-safety.
21092    " >&2;}
21093       { (exit 1); exit 1; }; }
21094    fi
21095    
21096  # check termcap library  # check termcap library
21097    TERMCAP_LIBS=""    TERMCAP_LIBS=""
21098    
# Line 23815  fi Line 23908  fi
23908    
23909    
23910    
 # added pthread flags  
 CC="$PTHREAD_CC"  
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"  
 CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"  
 LIBS="$PTHREAD_LIBS $LIBS"  
   
23911  # FIXME: Replace `main' with a function in `-lsatellite':  # FIXME: Replace `main' with a function in `-lsatellite':
23912  #AC_CHECK_LIB([satellite], [main])  #AC_CHECK_LIB([satellite], [main])
23913  # FIXME: Replace `main' with a function in `-lslshell':  # FIXME: Replace `main' with a function in `-lslshell':
# Line 27841  fi Line 27928  fi
27928  done  done
27929    
27930    
27931    # replaced cflags and libs for pthread support
27932    CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
27933    CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
27934    LIBS="$PTHREAD_LIBS $LIBS"
27935    
27936                                                                                                                                                                                                                                                                                                                                                                          ac_config_files="$ac_config_files Makefile satellite4-config lib/Makefile lib/common/Makefile lib/shell/Makefile shell/Makefile etc/Makefile modules/Makefile modules/util/Makefile modules/system/Makefile modules/ispp/Makefile modules/gpm/Makefile modules/gpm/lib/Makefile modules/gpm/command/Makefile modules/gpm/gpm2ps/Makefile modules/gpm/gpmwin/Makefile modules/bps/Makefile modules/bps/command/Makefile modules/ncs/Makefile modules/ncs/lib/Makefile modules/ncs/lib/common/Makefile modules/ncs/lib/simulation/Makefile modules/ncs/lib/main/Makefile modules/ncs/command/Makefile modules/ncs/ncspp/Makefile modules/npe/Makefile modules/npe/lib/Makefile modules/npe/lib/common/Makefile modules/npe/lib/estimation/Makefile modules/npe/lib/user/Makefile modules/npe/lib/ncs/Makefile modules/npe/command/Makefile modules/dcm/Makefile modules/statistics/Makefile modules/statistics/script/Makefile modules/statistics/script/data/Makefile"                                                                                                                                                                                                                                                                                                                                                                          ac_config_files="$ac_config_files Makefile satellite4-config lib/Makefile lib/common/Makefile lib/shell/Makefile shell/Makefile etc/Makefile modules/Makefile modules/util/Makefile modules/system/Makefile modules/ispp/Makefile modules/gpm/Makefile modules/gpm/lib/Makefile modules/gpm/command/Makefile modules/gpm/gpm2ps/Makefile modules/gpm/gpmwin/Makefile modules/bps/Makefile modules/bps/command/Makefile modules/ncs/Makefile modules/ncs/lib/Makefile modules/ncs/lib/common/Makefile modules/ncs/lib/simulation/Makefile modules/ncs/lib/main/Makefile modules/ncs/command/Makefile modules/ncs/ncspp/Makefile modules/npe/Makefile modules/npe/lib/Makefile modules/npe/lib/common/Makefile modules/npe/lib/estimation/Makefile modules/npe/lib/user/Makefile modules/npe/lib/ncs/Makefile modules/npe/command/Makefile modules/dcm/Makefile modules/statistics/Makefile modules/statistics/script/Makefile modules/statistics/script/data/Makefile"
27937    
27938  cat >confcache <<\_ACEOF  cat >confcache <<\_ACEOF

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26