Patch to cross-compile Vim targeting Termux with perl, ruby and tcl support enabled it should be able to support either dymamic linking mode or dynamic loading mode for all three --- a/src/auto/configure +++ b/src/auto/configure @@ -6424,38 +6424,15 @@ printf "%s\n" "no" >&6; } fi - if test "X$vi_cv_path_perl" != "X"; then + if test "Xforce-enabled" != "X"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Perl version" >&5 printf %s "checking Perl version... " >&6; } - if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then - eval `$vi_cv_path_perl -V:usethreads` - eval `$vi_cv_path_perl -V:libperl` - if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then - badthreads=no - else - if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then - eval `$vi_cv_path_perl -V:use5005threads` - if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then - badthreads=no - else - badthreads=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: >>> Perl > 5.6 with 5.5 threads cannot be used <<<" >&5 -printf "%s\n" ">>> Perl > 5.6 with 5.5 threads cannot be used <<<" >&6; } - fi - else - badthreads=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: >>> Perl 5.5 with threads cannot be used <<<" >&5 -printf "%s\n" ">>> Perl 5.5 with threads cannot be used <<<" >&6; } - fi - fi + if true; then + badthreads="no" if test $badthreads = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OK" >&5 printf "%s\n" "OK" >&6; } - eval `$vi_cv_path_perl -V:shrpenv` - if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04 - shrpenv="" - fi - vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'` + vi_cv_perllib="@TERMUX_PREFIX@/lib/perl5/@PERL_VERSION@" vi_cv_perl_extutils=unknown_perl_extutils_path @@ -6495,20 +6472,9 @@ printf "%s\n" "$vi_cv_perl_xsubpp" >&6; } fi - perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ - -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \ - -e 's/-fdebug-prefix-map[^ ]*//g' \ - -e 's/-pipe //' \ - -e 's/-flto\(=auto\)\? //' \ - -e 's/-W[^ ]*//g' \ - -e 's/-D_FORTIFY_SOURCE=.//g'` - perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ - sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ - -e 's/-specs=[^ ]*//g' \ - -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//' \ - -e 's/-specs=[^ ]*//g' ` + perlcppflags="-D__USE_BSD=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I@TERMUX_PREFIX@/lib/perl5/@PERL_VERSION@/@PERL_PLATFORM@/CORE" + perllibs="-Wl,-E -landroid-utimes -L@TERMUX_PREFIX@/lib/perl5/@PERL_VERSION@/@PERL_PLATFORM@/CORE -lperl -lm" + perlldflags="-Wl,-E" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Perl are sane" >&5 printf %s "checking if compile and link flags for Perl are sane... " >&6; } @@ -6588,6 +6554,7 @@ printf "%s\n" ">>> too old; need Perl version 5.003_01 or later <<<" >&6; } PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` fi if test "$enable_perlinterp" = "dynamic"; then + libperl="libperl.so" if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then printf "%s\n" "#define DYNAMIC_PERL 1" >>confdefs.h @@ -7915,15 +7881,15 @@ fi fi - if test "X$vi_cv_path_tcl" != "X"; then + if test "Xforce-enabled" != "X"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Tcl version" >&5 printf %s "checking Tcl version... " >&6; } - if echo 'exit [expr [info tclversion] < 8.0]' | "$vi_cv_path_tcl" - ; then - tclver=`echo 'puts [info tclversion]' | $vi_cv_path_tcl -` + if true; then + tclver="@TCL_MAJOR_VERSION@" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tclver - OK" >&5 printf "%s\n" "$tclver - OK" >&6; }; - tclloc=`echo 'set l [info library];set i [string last lib $l];incr i -2;puts [string range $l 0 $i]' | $vi_cv_path_tcl -` - tcldll=`echo 'puts libtcl[info tclversion][info sharedlibextension]' | $vi_cv_path_tcl -` + tclloc="@TERMUX_PREFIX@" + tcldll="libtcl@TCL_MAJOR_VERSION@.so" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5 printf %s "checking for location of Tcl include... " >&6; } @@ -8108,43 +8074,32 @@ printf "%s\n" "no" >&6; } fi - if test "X$vi_cv_path_ruby" != "X"; then + if test "Xforce-enabled" != "X"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Ruby version" >&5 printf %s "checking Ruby version... " >&6; } - if $vi_cv_path_ruby -e 'RUBY_VERSION >= "1.9.1" or exit 1' >/dev/null 2>/dev/null; then + if true; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OK" >&5 printf "%s\n" "OK" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Ruby rbconfig" >&5 -printf %s "checking Ruby rbconfig... " >&6; } - ruby_rbconfig="RbConfig" - if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then - ruby_rbconfig="Config" - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ruby_rbconfig" >&5 -printf "%s\n" "$ruby_rbconfig" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Ruby header files" >&5 printf %s "checking Ruby header files... " >&6; } - rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG['rubyhdrdir'] || $ruby_rbconfig::CONFIG['archdir'] || \\$hdrdir" 2>/dev/null` + rubyhdrdir="@TERMUX_PREFIX@/include/ruby-@RUBY_MAJOR_VERSION@.0" if test "X$rubyhdrdir" != "X"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $rubyhdrdir" >&5 printf "%s\n" "$rubyhdrdir" >&6; } RUBY_CFLAGS="-I$rubyhdrdir" - rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG['rubyarchhdrdir'] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG['arch']"` + rubyarchdir="@TERMUX_PREFIX@/include/ruby-@RUBY_MAJOR_VERSION@.0/@RUBY_PLATFORM@" if test -d "$rubyarchdir"; then RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir" fi - rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"` - if test "X$rubyversion" = "X"; then - rubyversion=`$vi_cv_path_ruby -e "print RUBY_VERSION.gsub(/\./, '')[0,2]"` - fi + rubyversion=$(echo "@RUBY_MAJOR_VERSION@" | tr -d '.') RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" - rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LIBS']"` + rubylibs="-lm -lpthread " if test "X$rubylibs" != "X"; then RUBY_LIBS="$rubylibs" fi - librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` - librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` - rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` + librubyarg="-lruby" + librubya="libruby-static.a" + rubylibdir="@TERMUX_PREFIX@/lib" if test -f "$rubylibdir/$librubya" || expr "$librubyarg" : "-lruby" >/dev/null; then RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then @@ -8163,10 +8118,7 @@ printf "%s\n" "$rubyhdrdir" >&6; } printf "%s\n" "#define FEAT_RUBY 1" >>confdefs.h if test "$enable_rubyinterp" = "dynamic"; then - libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_ALIASES'].split[0]"` - if test -z "$libruby_soname"; then - libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_SO']"` - fi + libruby_soname="libruby.so.@RUBY_MAJOR_VERSION@" printf "%s\n" "#define DYNAMIC_RUBY 1" >>confdefs.h RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS"