Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3273 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Dec 24, 2004, 9:43:22 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/updater: checking if pthread is an option

Location:
orxonox/branches/updater
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/config.h.in

    r3264 r3273  
    4949/* Define to 1 if you have the <png.h> header file. */
    5050#undef HAVE_PNG_H
     51
     52/* Define to 1 if you have the <pthread.h> header file. */
     53#undef HAVE_PTHREAD_H
    5154
    5255/* Define to 1 if you have the <SDL/SDL.h> header file. */
  • orxonox/branches/updater/configure

    r3272 r3273  
    69696969
    69706970
    6971 checking for pthread libs
     6971##checking for pthread
     6972
     6973for ac_header in pthread.h
     6974do
     6975as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6976if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6977  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6978echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6979if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6980  echo $ECHO_N "(cached) $ECHO_C" >&6
     6981fi
     6982echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6983echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6984else
     6985  # Is the header compilable?
     6986echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6987echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6988cat >conftest.$ac_ext <<_ACEOF
     6989/* confdefs.h.  */
     6990_ACEOF
     6991cat confdefs.h >>conftest.$ac_ext
     6992cat >>conftest.$ac_ext <<_ACEOF
     6993/* end confdefs.h.  */
     6994$ac_includes_default
     6995#include <$ac_header>
     6996_ACEOF
     6997rm -f conftest.$ac_objext
     6998if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6999  (eval $ac_compile) 2>conftest.er1
     7000  ac_status=$?
     7001  grep -v '^ *+' conftest.er1 >conftest.err
     7002  rm -f conftest.er1
     7003  cat conftest.err >&5
     7004  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7005  (exit $ac_status); } &&
     7006         { ac_try='test -z "$ac_c_werror_flag"
     7007                         || test ! -s conftest.err'
     7008  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7009  (eval $ac_try) 2>&5
     7010  ac_status=$?
     7011  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7012  (exit $ac_status); }; } &&
     7013         { ac_try='test -s conftest.$ac_objext'
     7014  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7015  (eval $ac_try) 2>&5
     7016  ac_status=$?
     7017  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7018  (exit $ac_status); }; }; then
     7019  ac_header_compiler=yes
     7020else
     7021  echo "$as_me: failed program was:" >&5
     7022sed 's/^/| /' conftest.$ac_ext >&5
     7023
     7024ac_header_compiler=no
     7025fi
     7026rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7027echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     7028echo "${ECHO_T}$ac_header_compiler" >&6
     7029
     7030# Is the header present?
     7031echo "$as_me:$LINENO: checking $ac_header presence" >&5
     7032echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     7033cat >conftest.$ac_ext <<_ACEOF
     7034/* confdefs.h.  */
     7035_ACEOF
     7036cat confdefs.h >>conftest.$ac_ext
     7037cat >>conftest.$ac_ext <<_ACEOF
     7038/* end confdefs.h.  */
     7039#include <$ac_header>
     7040_ACEOF
     7041if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     7042  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     7043  ac_status=$?
     7044  grep -v '^ *+' conftest.er1 >conftest.err
     7045  rm -f conftest.er1
     7046  cat conftest.err >&5
     7047  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7048  (exit $ac_status); } >/dev/null; then
     7049  if test -s conftest.err; then
     7050    ac_cpp_err=$ac_c_preproc_warn_flag
     7051    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     7052  else
     7053    ac_cpp_err=
     7054  fi
     7055else
     7056  ac_cpp_err=yes
     7057fi
     7058if test -z "$ac_cpp_err"; then
     7059  ac_header_preproc=yes
     7060else
     7061  echo "$as_me: failed program was:" >&5
     7062sed 's/^/| /' conftest.$ac_ext >&5
     7063
     7064  ac_header_preproc=no
     7065fi
     7066rm -f conftest.err conftest.$ac_ext
     7067echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     7068echo "${ECHO_T}$ac_header_preproc" >&6
     7069
     7070# So?  What about this header?
     7071case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     7072  yes:no: )
     7073    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     7074echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     7075    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     7076echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     7077    ac_header_preproc=yes
     7078    ;;
     7079  no:yes:* )
     7080    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     7081echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     7082    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     7083echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     7084    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     7085echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     7086    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     7087echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     7088    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     7089echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     7090    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     7091echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     7092    (
     7093      cat <<\_ASBOX
     7094## ---------------------------------------------- ##
     7095## Report this to orxonox-dev at mail.datacore.ch ##
     7096## ---------------------------------------------- ##
     7097_ASBOX
     7098    ) |
     7099      sed "s/^/$as_me: WARNING:     /" >&2
     7100    ;;
     7101esac
     7102echo "$as_me:$LINENO: checking for $ac_header" >&5
     7103echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7104if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7105  echo $ECHO_N "(cached) $ECHO_C" >&6
     7106else
     7107  eval "$as_ac_Header=\$ac_header_preproc"
     7108fi
     7109echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7110echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7111
     7112fi
     7113if test `eval echo '${'$as_ac_Header'}'` = yes; then
     7114  cat >>confdefs.h <<_ACEOF
     7115#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     7116_ACEOF
     7117 pthreadHeader="yes"
     7118else
     7119  pthreadHeader="no"
     7120fi
     7121
     7122done
     7123
    69727124echo "$as_me:$LINENO: checking for main in -lpthread" >&5
    69737125echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
  • orxonox/branches/updater/configure.ac

    r3272 r3273  
    403403
    404404
    405 checking for pthread libs
     405##checking for pthread
     406AC_CHECK_HEADERS([pthread.h], pthreadHeader="yes", pthreadHeader="no")
    406407AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
    407408 if test "$FOUND_pthread" = "yes" ; then
  • orxonox/branches/updater/src/Makefile.in

    r3271 r3273  
    282282          esac; \
    283283        done; \
    284         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
     284        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
    285285        cd $(top_srcdir) && \
    286           $(AUTOMAKE) --foreign  src/Makefile
     286          $(AUTOMAKE) --gnu  src/Makefile
    287287.PRECIOUS: Makefile
    288288Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/updater/src/console/Makefile.in

    r3271 r3273  
    201201          esac; \
    202202        done; \
    203         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/console/Makefile'; \
     203        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/console/Makefile'; \
    204204        cd $(top_srcdir) && \
    205           $(AUTOMAKE) --foreign  src/console/Makefile
     205          $(AUTOMAKE) --gnu  src/console/Makefile
    206206.PRECIOUS: Makefile
    207207Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/updater/src/gui/Makefile.in

    r3271 r3273  
    232232          esac; \
    233233        done; \
    234         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/gui/Makefile'; \
     234        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/gui/Makefile'; \
    235235        cd $(top_srcdir) && \
    236           $(AUTOMAKE) --foreign  src/gui/Makefile
     236          $(AUTOMAKE) --gnu  src/gui/Makefile
    237237.PRECIOUS: Makefile
    238238Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/updater/src/gui/orxonox_gui_update.cc

    r3272 r3273  
    200200}
    201201
     202#ifdef HAVE_CURL
    202203CURL* OrxonoxGuiUpdate::curlHandle = NULL;
     204#endif /* HAVE_CURL */
     205
     206#ifdef HAVE_PTHREAD_H
    203207pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t;
     208#endif /* HAVE_PTHREAD_H */
    204209bool OrxonoxGuiUpdate::isDownloading = false;
    205210
     
    217222  strcpy (fileOnDisk, info->localRoot);
    218223  strcat (fileOnDisk, info->fileName);
    219   pthread_t test;
     224
    220225  if(curlHandle)
    221226    {
     
    234239        {
    235240          //! \todo check if threads really were created.
     241#ifdef HAVE_PTHREAD_H
    236242          pthread_create(downloadThreadID, NULL, downloadThread, info);
     243#else
     244          downloadThread(info);
     245#endif /* HAVE_PTHREAD_H */
     246         
    237247          //      else
    238248          //    PRINTF(1)("thread already in use\n");
     
    252262  if (curlHandle)
    253263    curl_easy_cleanup(curlHandle);
    254 
     264#ifdef HAVE_PTHREAD_H
    255265  pthread_join(*downloadThreadID, NULL);
     266#endif /* HAVE_PTHREAD_H */
    256267  PRINTF(3)("Closing the downloaded file.\n");
    257268  fclose(info->fileHandle);
  • orxonox/branches/updater/src/gui/orxonox_gui_update.h

    r3272 r3273  
    1414#include <curl/easy.h>
    1515#endif /* HAVE_CURL */
     16#ifdef HAVE_PTHREAD_H
    1617#include <pthread.h>
     18#endif /* HAVE_PTHREAD_H */
    1719using namespace std;
    1820
     
    6466  static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
    6567#endif /* HAVE_GTK2 */ 
     68#ifdef HAVE_PTHREAD_H
    6669  static pthread_t* downloadThreadID;
     70#endif /* HAVE_PTHREAD_H */
    6771  static bool isDownloading;
    6872
  • orxonox/branches/updater/src/importer/Makefile.in

    r3271 r3273  
    208208          esac; \
    209209        done; \
    210         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/importer/Makefile'; \
     210        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/importer/Makefile'; \
    211211        cd $(top_srcdir) && \
    212           $(AUTOMAKE) --foreign  src/importer/Makefile
     212          $(AUTOMAKE) --gnu  src/importer/Makefile
    213213.PRECIOUS: Makefile
    214214Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Note: See TracChangeset for help on using the changeset viewer.