To: vim-dev@vim.org Subject: Patch 6.2.365 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.365 Problem: The configure checks for Perl and Python may add compile and link arguments that break building Vim. Solution: Do a sanity check: try building with the arguments. Files: src/auto/configure, src/configure.in *** ../vim-6.2.364/src/auto/configure Tue Feb 24 22:17:28 2004 --- src/auto/configure Tue Mar 16 17:59:01 2004 *************** *** 1599,1623 **** perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'` ! if test "X$perlcppflags" != "X"; then ! PERL_CFLAGS="$perlcppflags" ! fi ! PERL_LIBS=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` - perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` ! if test "X$perlldflags" != "X"; then ! LDFLAGS="$perlldflags $LDFLAGS" ! fi ! PERL_SRC="auto/if_perl.c if_perlsfio.c" ! PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" ! PERL_PRO="if_perl.pro if_perlsfio.pro" ! cat >> confdefs.h <<\EOF #define FEAT_PERL 1 EOF fi else echo "$ac_t"">>> too old; need Perl version 5.003_01 or later <<<" 1>&6 --- 1599,1655 ---- perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'` ! perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` ! ! echo $ac_n "checking if compile and link flags for Perl are sane""... $ac_c" 1>&6 ! echo "configure:1610: checking if compile and link flags for Perl are sane" >&5 ! cflags_save=$CFLAGS ! libs_save=$LIBS ! ldflags_save=$LDFLAGS ! CFLAGS="$CFLAGS $perlcppflags" ! LIBS="$LIBS $perllibs" ! LDFLAGS="$perlldflags $LDFLAGS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ! rm -rf conftest* ! echo "$ac_t""yes" 1>&6; perl_ok=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! echo "$ac_t""no: PERL DISABLED" 1>&6; perl_ok=no ! fi ! rm -f conftest* ! CFLAGS=$cflags_save ! LIBS=$libs_save ! LDFLAGS=$ldflags_save ! if test $perl_ok = yes; then ! if test "X$perlcppflags" != "X"; then ! PERL_CFLAGS="$perlcppflags" ! fi ! if test "X$perlldflags" != "X"; then ! LDFLAGS="$perlldflags $LDFLAGS" ! fi ! PERL_LIBS=$perllibs ! PERL_SRC="auto/if_perl.c if_perlsfio.c" ! PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" ! PERL_PRO="if_perl.pro if_perlsfio.pro" ! cat >> confdefs.h <<\EOF #define FEAT_PERL 1 EOF + fi fi else echo "$ac_t"">>> too old; need Perl version 5.003_01 or later <<<" 1>&6 *************** *** 1845,1871 **** thread_lib="-pthread" fi fi if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS - libs_save=$LIBS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ! echo "$ac_t""no" 1>&6; LIBS=$libs_save fi rm -f conftest* --- 1878,1904 ---- thread_lib="-pthread" fi fi + libs_save_old=$LIBS if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ! echo "$ac_t""no" 1>&6; LIBS=$libs_save_old fi rm -f conftest* *************** *** 1874,1883 **** echo "$ac_t""no" 1>&6 fi ! cat >> confdefs.h <<\EOF #define FEAT_PYTHON 1 EOF fi else --- 1907,1950 ---- echo "$ac_t""no" 1>&6 fi ! echo $ac_n "checking if compile and link flags for Python are sane""... $ac_c" 1>&6 ! echo "configure:1912: checking if compile and link flags for Python are sane" >&5 ! cflags_save=$CFLAGS ! libs_save=$LIBS ! CFLAGS="$CFLAGS $PYTHON_CFLAGS" ! LIBS="$LIBS $PYTHON_LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ! rm -rf conftest* ! echo "$ac_t""yes" 1>&6; python_ok=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! echo "$ac_t""no: PYTHON DISABLED" 1>&6; python_ok=no ! fi ! rm -f conftest* ! CFLAGS=$cflags_save ! LIBS=$libs_save ! if test $python_ok = yes; then ! cat >> confdefs.h <<\EOF #define FEAT_PYTHON 1 EOF + else + LIBS=$libs_save_old + PYTHON_SRC= + PYTHON_OBJ= + PYTHON_LIBS= + PYTHON_CFLAGS= + fi fi else *************** *** 8252,8263 **** s%@compiledby@%$compiledby%g s%@vi_cv_path_perl@%$vi_cv_path_perl%g s%@vi_cv_perllib@%$vi_cv_perllib%g - s%@PERL_LIBS@%$PERL_LIBS%g s%@shrpenv@%$shrpenv%g s%@PERL_SRC@%$PERL_SRC%g s%@PERL_OBJ@%$PERL_OBJ%g s%@PERL_PRO@%$PERL_PRO%g s%@PERL_CFLAGS@%$PERL_CFLAGS%g s%@vi_cv_path_python@%$vi_cv_path_python%g s%@PYTHON_CONFDIR@%$PYTHON_CONFDIR%g s%@PYTHON_LIBS@%$PYTHON_LIBS%g --- 8322,8333 ---- s%@compiledby@%$compiledby%g s%@vi_cv_path_perl@%$vi_cv_path_perl%g s%@vi_cv_perllib@%$vi_cv_perllib%g s%@shrpenv@%$shrpenv%g s%@PERL_SRC@%$PERL_SRC%g s%@PERL_OBJ@%$PERL_OBJ%g s%@PERL_PRO@%$PERL_PRO%g s%@PERL_CFLAGS@%$PERL_CFLAGS%g + s%@PERL_LIBS@%$PERL_LIBS%g s%@vi_cv_path_python@%$vi_cv_path_python%g s%@PYTHON_CONFDIR@%$PYTHON_CONFDIR%g s%@PYTHON_LIBS@%$PYTHON_LIBS%g *** ../vim-6.2.364/src/configure.in Tue Feb 24 22:17:28 2004 --- src/configure.in Tue Mar 16 17:51:30 2004 *************** *** 331,355 **** dnl Remove "-fno-something", it breaks using cproto. perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'` - if test "X$perlcppflags" != "X"; then - PERL_CFLAGS="$perlcppflags" - fi dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". ! PERL_LIBS=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` - AC_SUBST(PERL_LIBS) dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH dnl a test in configure may fail because of that. perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` ! if test "X$perlldflags" != "X"; then ! LDFLAGS="$perlldflags $LDFLAGS" fi - PERL_SRC="auto/if_perl.c if_perlsfio.c" - PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" - PERL_PRO="if_perl.pro if_perlsfio.pro" - AC_DEFINE(FEAT_PERL) fi else AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<) --- 331,373 ---- dnl Remove "-fno-something", it breaks using cproto. perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'` dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". ! perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH dnl a test in configure may fail because of that. perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` ! ! dnl check that compiling a simple program still works with the flags ! dnl added for Perl. ! AC_MSG_CHECKING([if compile and link flags for Perl are sane]) ! cflags_save=$CFLAGS ! libs_save=$LIBS ! ldflags_save=$LDFLAGS ! CFLAGS="$CFLAGS $perlcppflags" ! LIBS="$LIBS $perllibs" ! LDFLAGS="$perlldflags $LDFLAGS" ! AC_TRY_LINK(,[ ], ! AC_MSG_RESULT(yes); perl_ok=yes, ! AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no) ! CFLAGS=$cflags_save ! LIBS=$libs_save ! LDFLAGS=$ldflags_save ! if test $perl_ok = yes; then ! if test "X$perlcppflags" != "X"; then ! PERL_CFLAGS="$perlcppflags" ! fi ! if test "X$perlldflags" != "X"; then ! LDFLAGS="$perlldflags $LDFLAGS" ! fi ! PERL_LIBS=$perllibs ! PERL_SRC="auto/if_perl.c if_perlsfio.c" ! PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" ! PERL_PRO="if_perl.pro if_perlsfio.pro" ! AC_DEFINE(FEAT_PERL) fi fi else AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<) *************** *** 383,388 **** --- 401,407 ---- AC_SUBST(PERL_OBJ) AC_SUBST(PERL_PRO) AC_SUBST(PERL_CFLAGS) + AC_SUBST(PERL_LIBS) AC_MSG_CHECKING(--enable-pythoninterp argument) AC_ARG_ENABLE(pythoninterp, *************** *** 517,537 **** thread_lib="-pthread" fi fi if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS - libs_save=$LIBS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", ! AC_MSG_RESULT(no); LIBS=$libs_save ) CFLAGS=$cflags_save else AC_MSG_RESULT(no) fi ! AC_DEFINE(FEAT_PYTHON) fi else --- 536,576 ---- thread_lib="-pthread" fi fi + libs_save_old=$LIBS if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", ! AC_MSG_RESULT(no); LIBS=$libs_save_old ) CFLAGS=$cflags_save else AC_MSG_RESULT(no) fi ! dnl check that compiling a simple program still works with the flags ! dnl added for Python. ! AC_MSG_CHECKING([if compile and link flags for Python are sane]) ! cflags_save=$CFLAGS ! libs_save=$LIBS ! CFLAGS="$CFLAGS $PYTHON_CFLAGS" ! LIBS="$LIBS $PYTHON_LIBS" ! AC_TRY_LINK(,[ ], ! AC_MSG_RESULT(yes); python_ok=yes, ! AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no) ! CFLAGS=$cflags_save ! LIBS=$libs_save ! if test $python_ok = yes; then ! AC_DEFINE(FEAT_PYTHON) ! else ! LIBS=$libs_save_old ! PYTHON_SRC= ! PYTHON_OBJ= ! PYTHON_LIBS= ! PYTHON_CFLAGS= ! fi fi else *** ../vim-6.2.364/src/version.c Tue Mar 16 16:06:45 2004 --- src/version.c Tue Mar 16 17:58:51 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 365, /**/ -- Everyone has a photographic memory. Some don't have film. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///