home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.393 < prev    next >
Encoding:
Internet Message Format  |  2003-03-14  |  5.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.393
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.393
  11. Problem:    When compiled with Python and threads, detaching the terminal may
  12.         cause Vim to loop forever.
  13. Solution:   Add -pthread to $CFLAGS when using Python and gcc. (Daniel
  14.         Elstner)
  15. Files:        src/auto/configure,, src/configure.in
  16.  
  17.  
  18. *** ../vim61.392/src/auto/configure    Sat Mar  8 20:33:31 2003
  19. --- src/auto/configure    Sat Mar 15 15:40:58 2003
  20. ***************
  21. *** 1648,1671 ****
  22.       fi
  23.       PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  24.   
  25. !                     echo $ac_n "checking if -pthread should be used""... $ac_c" 1>&6
  26. ! echo "configure:1636: checking if -pthread should be used" >&5
  27.       if test "`(uname) 2>/dev/null`" = FreeBSD; then
  28.         cflags_save=$CFLAGS
  29.         libs_save=$LIBS
  30. !       CFLAGS="$CFLAGS -D_THREAD_SAFE"
  31. !       LIBS="$LIBS -pthread"
  32.         cat > conftest.$ac_ext <<EOF
  33. ! #line 1643 "configure"
  34.   #include "confdefs.h"
  35.   
  36.   int main() {
  37.    
  38.   ; return 0; }
  39.   EOF
  40. ! if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  41.     rm -rf conftest*
  42. !   echo "$ac_t""yes" 1>&6; PYTHON_CFLAGS="$PYTHON_CFLAGS -D_THREAD_SAFE"
  43.   else
  44.     echo "configure: failed program was:" >&5
  45.     cat conftest.$ac_ext >&5
  46. --- 1648,1678 ----
  47.       fi
  48.       PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  49.   
  50. !                             echo $ac_n "checking if -pthread should be used""... $ac_c" 1>&6
  51. ! echo "configure:1653: checking if -pthread should be used" >&5
  52. !     threadsafe_flag=
  53. !     thread_lib=
  54. !     test "$GCC" = yes && threadsafe_flag="-pthread"
  55.       if test "`(uname) 2>/dev/null`" = FreeBSD; then
  56. +       threadsafe_flag="-D_THREAD_SAFE"
  57. +       thread_lib="-pthread"
  58. +     fi
  59. +     if test -n "$threadsafe_flag"; then
  60.         cflags_save=$CFLAGS
  61.         libs_save=$LIBS
  62. !       CFLAGS="$CFLAGS $threadsafe_flag"
  63. !       LIBS="$LIBS $thread_lib"
  64.         cat > conftest.$ac_ext <<EOF
  65. ! #line 1667 "configure"
  66.   #include "confdefs.h"
  67.   
  68.   int main() {
  69.    
  70.   ; return 0; }
  71.   EOF
  72. ! if { (eval echo configure:1674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  73.     rm -rf conftest*
  74. !   echo "$ac_t""yes" 1>&6; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag"
  75.   else
  76.     echo "configure: failed program was:" >&5
  77.     cat conftest.$ac_ext >&5
  78. *** ../vim61.392/src/configure.in    Sat Mar  8 20:33:31 2003
  79. --- src/configure.in    Sat Mar 15 15:37:52 2003
  80. ***************
  81. *** 381,398 ****
  82.       fi
  83.       PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  84.   
  85. !     dnl On FreeBSD "-pthread" is required to use threads.
  86.       dnl _THREAD_SAFE must be used for compiling then.
  87.       dnl The "-pthread" is added to $LIBS, so that the following check for
  88.       dnl sigaltstack() will look in libc_r (it's there in libc!).
  89.       AC_MSG_CHECKING([if -pthread should be used])
  90.       if test "`(uname) 2>/dev/null`" = FreeBSD; then
  91.         cflags_save=$CFLAGS
  92.         libs_save=$LIBS
  93. !       CFLAGS="$CFLAGS -D_THREAD_SAFE"
  94. !       LIBS="$LIBS -pthread"
  95.         AC_TRY_LINK(,[ ],
  96. !          AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS -D_THREAD_SAFE",
  97.            AC_MSG_RESULT(no); LIBS=$libs_save
  98.            )
  99.         CFLAGS=$cflags_save
  100. --- 381,407 ----
  101.       fi
  102.       PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  103.   
  104. !     dnl On FreeBSD linking with "-pthread" is required to use threads.
  105.       dnl _THREAD_SAFE must be used for compiling then.
  106.       dnl The "-pthread" is added to $LIBS, so that the following check for
  107.       dnl sigaltstack() will look in libc_r (it's there in libc!).
  108. +     dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS.  GCC
  109. +     dnl will then define target-specific defines, e.g., -D_REENTRANT.
  110.       AC_MSG_CHECKING([if -pthread should be used])
  111. +     threadsafe_flag=
  112. +     thread_lib=
  113. +     test "$GCC" = yes && threadsafe_flag="-pthread"
  114.       if test "`(uname) 2>/dev/null`" = FreeBSD; then
  115. +       threadsafe_flag="-D_THREAD_SAFE"
  116. +       thread_lib="-pthread"
  117. +     fi
  118. +     if test -n "$threadsafe_flag"; then
  119.         cflags_save=$CFLAGS
  120.         libs_save=$LIBS
  121. !       CFLAGS="$CFLAGS $threadsafe_flag"
  122. !       LIBS="$LIBS $thread_lib"
  123.         AC_TRY_LINK(,[ ],
  124. !          AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
  125.            AC_MSG_RESULT(no); LIBS=$libs_save
  126.            )
  127.         CFLAGS=$cflags_save
  128. *** ../vim61.392/src/version.c    Fri Mar 14 22:54:15 2003
  129. --- src/version.c    Sat Mar 15 16:08:08 2003
  130. ***************
  131. *** 613,614 ****
  132. --- 613,616 ----
  133.   {   /* Add new patch number below this line */
  134. + /**/
  135. +     393,
  136.   /**/
  137.  
  138. -- 
  139. hundred-and-one symptoms of being an internet addict:
  140. 88. Every single time you press the 'Get mail' button...it does get new mail.
  141.  
  142.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  143. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  144. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  145.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  146.