To: vim_dev@googlegroups.com Subject: Patch 7.4a.029 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4a.029 Problem: Can't build with MzScheme on Ubuntu 13.04. Solution: Add configure check for the "ffi" library. Files: src/configure.in, src/auto/configure *** ../vim-7.4a.028/src/configure.in 2013-07-12 20:07:17.000000000 +0200 --- src/configure.in 2013-07-17 18:52:12.000000000 +0200 *************** *** 702,713 **** AC_MSG_RESULT(not needed) fi MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" ! MZSCHEME_SRC="if_mzsch.c" ! MZSCHEME_OBJ="objects/if_mzsch.o" ! MZSCHEME_PRO="if_mzsch.pro" ! AC_DEFINE(FEAT_MZSCHEME) fi AC_SUBST(MZSCHEME_SRC) AC_SUBST(MZSCHEME_OBJ) --- 702,735 ---- AC_MSG_RESULT(not needed) fi + dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'". + AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"]) + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" ! ! dnl Test that we can compile a simple program with these CFLAGS and LIBS. ! AC_MSG_CHECKING([if compile and link flags for MzScheme are sane]) ! cflags_save=$CFLAGS ! libs_save=$LIBS ! CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" ! LIBS="$LIBS $MZSCHEME_LIBS" ! AC_TRY_LINK(,[ ], ! AC_MSG_RESULT(yes); mzs_ok=yes, ! AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no) ! CFLAGS=$cflags_save ! LIBS=$libs_save ! if test $mzs_ok = yes; then ! MZSCHEME_SRC="if_mzsch.c" ! MZSCHEME_OBJ="objects/if_mzsch.o" ! MZSCHEME_PRO="if_mzsch.pro" ! AC_DEFINE(FEAT_MZSCHEME) ! else ! MZSCHEME_CFLAGS= ! MZSCHEME_LIBS= ! MZSCHEME_EXTRA= ! MZSCHEME_MZC= ! fi fi AC_SUBST(MZSCHEME_SRC) AC_SUBST(MZSCHEME_OBJ) *** ../vim-7.4a.028/src/auto/configure 2013-07-12 20:07:17.000000000 +0200 --- src/auto/configure 2013-07-17 18:52:16.000000000 +0200 *************** *** 5014,5026 **** $as_echo "not needed" >&6; } fi MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" - MZSCHEME_SRC="if_mzsch.c" - MZSCHEME_OBJ="objects/if_mzsch.o" - MZSCHEME_PRO="if_mzsch.pro" - $as_echo "#define FEAT_MZSCHEME 1" >>confdefs.h fi --- 5014,5103 ---- $as_echo "not needed" >&6; } fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi_type_void in -lffi" >&5 + $as_echo_n "checking for ffi_type_void in -lffi... " >&6; } + if test "${ac_cv_lib_ffi_ffi_type_void+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lffi $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ + #ifdef __cplusplus + extern "C" + #endif + char ffi_type_void (); + int + main () + { + return ffi_type_void (); + ; + return 0; + } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ffi_ffi_type_void=yes + else + ac_cv_lib_ffi_ffi_type_void=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_type_void" >&5 + $as_echo "$ac_cv_lib_ffi_ffi_type_void" >&6; } + if test "x$ac_cv_lib_ffi_ffi_type_void" = x""yes; then : + MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi" + fi + + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for MzScheme are sane" >&5 + $as_echo_n "checking if compile and link flags for MzScheme are sane... " >&6; } + cflags_save=$CFLAGS + libs_save=$LIBS + CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" + LIBS="$LIBS $MZSCHEME_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int + main () + { + + ; + return 0; + } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; }; mzs_ok=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 + $as_echo "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$cflags_save + LIBS=$libs_save + if test $mzs_ok = yes; then + MZSCHEME_SRC="if_mzsch.c" + MZSCHEME_OBJ="objects/if_mzsch.o" + MZSCHEME_PRO="if_mzsch.pro" + $as_echo "#define FEAT_MZSCHEME 1" >>confdefs.h + + else + MZSCHEME_CFLAGS= + MZSCHEME_LIBS= + MZSCHEME_EXTRA= + MZSCHEME_MZC= + fi fi *** ../vim-7.4a.028/src/version.c 2013-07-17 17:35:07.000000000 +0200 --- src/version.c 2013-07-17 18:56:32.000000000 +0200 *************** *** 729,730 **** --- 729,732 ---- { /* Add new patch number below this line */ + /**/ + 29, /**/ -- Engineers understand that their appearance only bothers other people and therefore it is not worth optimizing. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///