Karsten Hopp fb2c79
To: vim_dev@googlegroups.com
Karsten Hopp fb2c79
Subject: Patch 7.4.676
Karsten Hopp fb2c79
Fcc: outbox
Karsten Hopp fb2c79
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fb2c79
Mime-Version: 1.0
Karsten Hopp fb2c79
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fb2c79
Content-Transfer-Encoding: 8bit
Karsten Hopp fb2c79
------------
Karsten Hopp fb2c79
Karsten Hopp fb2c79
Patch 7.4.676
Karsten Hopp fb2c79
Problem:    On Mac, when not using the default Python framework configure
Karsten Hopp fb2c79
	    doesn't do the right thing.
Karsten Hopp fb2c79
Solution:   Use a linker search path. (Kazunobu Kuriyama)
Karsten Hopp fb2c79
Files:	    src/configure.in, src/auto/configure
Karsten Hopp fb2c79
Karsten Hopp fb2c79
Karsten Hopp fb2c79
*** ../vim-7.4.675/src/configure.in	2015-03-05 16:47:15.764151809 +0100
Karsten Hopp fb2c79
--- src/configure.in	2015-03-24 12:14:13.317567690 +0100
Karsten Hopp fb2c79
***************
Karsten Hopp fb2c79
*** 1126,1131 ****
Karsten Hopp fb2c79
--- 1126,1134 ----
Karsten Hopp fb2c79
  	@echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
Karsten Hopp fb2c79
  	@echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
Karsten Hopp fb2c79
  	@echo "python_INSTSONAME='$(INSTSONAME)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'"
Karsten Hopp fb2c79
  eof
Karsten Hopp fb2c79
  	    dnl -- delete the lines from make about Entering/Leaving directory
Karsten Hopp fb2c79
  	    eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp fb2c79
***************
Karsten Hopp fb2c79
*** 1133,1144 ****
Karsten Hopp fb2c79
--- 1136,1169 ----
Karsten Hopp fb2c79
  	    if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
Karsten Hopp fb2c79
  		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
Karsten Hopp fb2c79
  	      vi_cv_path_python_plibs="-framework Python"
Karsten Hopp fb2c79
+ 	      if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
Karsten Hopp fb2c79
+ 		  vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
Karsten Hopp fb2c79
+ 	      fi
Karsten Hopp fb2c79
  	    else
Karsten Hopp fb2c79
  	      if test "${vi_cv_var_python_version}" = "1.4"; then
Karsten Hopp fb2c79
  		  vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
Karsten Hopp fb2c79
  	      else
Karsten Hopp fb2c79
  		  vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
Karsten Hopp fb2c79
  	      fi
Karsten Hopp fb2c79
+ 	      dnl -- Check if the path contained in python_LINKFORSHARED is
Karsten Hopp fb2c79
+ 	      dnl    usable for vim build. If not, make and try other
Karsten Hopp fb2c79
+ 	      dnl    candidates.
Karsten Hopp fb2c79
+ 	      if test -n "${python_LINKFORSHARED}"; then
Karsten Hopp fb2c79
+ 	        python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]].*/\1/'`
Karsten Hopp fb2c79
+ 		python_link_path=`echo ${python_LINKFORSHARED} |   sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]][[ \t]]*\(.*\)/\2/'`
Karsten Hopp fb2c79
+ 	        if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
Karsten Hopp fb2c79
+ 	          dnl -- The path looks relative. Guess the absolute one using
Karsten Hopp fb2c79
+ 		  dnl    the prefix and try that.
Karsten Hopp fb2c79
+ 	          python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}"
Karsten Hopp fb2c79
+ 		  if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
Karsten Hopp fb2c79
+ 		    dnl -- A last resort.
Karsten Hopp fb2c79
+ 		    python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}"
Karsten Hopp fb2c79
+ 	            dnl -- No check is done. The last word is left to the
Karsten Hopp fb2c79
+ 	            dnl    "sanity" test on link flags that follows shortly.
Karsten Hopp fb2c79
+ 		  fi
Karsten Hopp fb2c79
+ 	          python_LINKFORSHARED="${python_link_symbol} ${python_link_path}"
Karsten Hopp fb2c79
+ 	        fi
Karsten Hopp fb2c79
+ 	      fi
Karsten Hopp fb2c79
  	      vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
Karsten Hopp fb2c79
  	      dnl remove -ltermcap, it can conflict with an earlier -lncurses
Karsten Hopp fb2c79
  	      vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
Karsten Hopp fb2c79
*** ../vim-7.4.675/src/auto/configure	2015-03-05 16:47:15.768151744 +0100
Karsten Hopp fb2c79
--- src/auto/configure	2015-03-24 12:14:19.901586591 +0100
Karsten Hopp fb2c79
***************
Karsten Hopp fb2c79
*** 5888,5905 ****
Karsten Hopp fb2c79
--- 5888,5922 ----
Karsten Hopp fb2c79
  	@echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
Karsten Hopp fb2c79
  	@echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
Karsten Hopp fb2c79
  	@echo "python_INSTSONAME='$(INSTSONAME)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'"
Karsten Hopp fb2c79
+ 	@echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'"
Karsten Hopp fb2c79
  eof
Karsten Hopp fb2c79
  	    	    eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp fb2c79
  	    rm -f -- "${tmp_mkf}"
Karsten Hopp fb2c79
  	    if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
Karsten Hopp fb2c79
  		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
Karsten Hopp fb2c79
  	      vi_cv_path_python_plibs="-framework Python"
Karsten Hopp fb2c79
+ 	      if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
Karsten Hopp fb2c79
+ 		  vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
Karsten Hopp fb2c79
+ 	      fi
Karsten Hopp fb2c79
  	    else
Karsten Hopp fb2c79
  	      if test "${vi_cv_var_python_version}" = "1.4"; then
Karsten Hopp fb2c79
  		  vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
Karsten Hopp fb2c79
  	      else
Karsten Hopp fb2c79
  		  vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
Karsten Hopp fb2c79
  	      fi
Karsten Hopp fb2c79
+ 	      	      	      	      if test -n "${python_LINKFORSHARED}"; then
Karsten Hopp fb2c79
+ 	        python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t].*/\1/'`
Karsten Hopp fb2c79
+ 		python_link_path=`echo ${python_LINKFORSHARED} |   sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t][ \t]*\(.*\)/\2/'`
Karsten Hopp fb2c79
+ 	        if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
Karsten Hopp fb2c79
+ 	          		  	          python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}"
Karsten Hopp fb2c79
+ 		  if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
Karsten Hopp fb2c79
+ 		    		    python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}"
Karsten Hopp fb2c79
+ 	            	            		  fi
Karsten Hopp fb2c79
+ 	          python_LINKFORSHARED="${python_link_symbol} ${python_link_path}"
Karsten Hopp fb2c79
+ 	        fi
Karsten Hopp fb2c79
+ 	      fi
Karsten Hopp fb2c79
  	      vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
Karsten Hopp fb2c79
  	      	      vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
Karsten Hopp fb2c79
  	    fi
Karsten Hopp fb2c79
*** ../vim-7.4.675/src/version.c	2015-03-24 11:46:21.712636141 +0100
Karsten Hopp fb2c79
--- src/version.c	2015-03-24 12:19:02.901966841 +0100
Karsten Hopp fb2c79
***************
Karsten Hopp fb2c79
*** 743,744 ****
Karsten Hopp fb2c79
--- 743,746 ----
Karsten Hopp fb2c79
  {   /* Add new patch number below this line */
Karsten Hopp fb2c79
+ /**/
Karsten Hopp fb2c79
+     676,
Karsten Hopp fb2c79
  /**/
Karsten Hopp fb2c79
Karsten Hopp fb2c79
-- 
Karsten Hopp fb2c79
Be nice to your kids...  they'll be the ones choosing your nursing home.
Karsten Hopp fb2c79
Karsten Hopp fb2c79
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fb2c79
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fb2c79
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fb2c79
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///