rxvt-unicode: support cross-compiling with perl enabled

This commit is contained in:
Dominik Honnef 2014-07-30 02:05:53 +02:00
parent 02332d81ed
commit 65d217f4f0
2 changed files with 75 additions and 1 deletions

View file

@ -0,0 +1,44 @@
--- configure.ac.orig 2014-07-30 00:57:35.525532956 +0200
+++ configure.ac 2014-07-30 01:24:04.531476426 +0200
@@ -717,39 +717,8 @@
IF_PERL=\#
if test x$support_perl = xyes; then
- AC_PATH_PROG(PERL, perl5, perl)
-
- AC_MSG_CHECKING(for $PERL suitability)
- if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>/dev/null; then
-
- save_CXXFLAGS="$CXXFLAGS"
- save_LIBS="$LIBS"
- CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts`"
- LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <EXTERN.h>
-#include <perl.h>
-#include <XSUB.h>
-]], [[
- PerlInterpreter *perl = perl_alloc ();
-]])],[rxvt_perl_link=yes],[rxvt_perl_link=no])
- CXXFLAGS="$save_CXXFLAGS"
- LIBS="$save_LIBS"
-
- if test x$rxvt_perl_link = xyes; then
- AC_MSG_RESULT(ok)
- AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
- IF_PERL=
- PERL_O=rxvtperl.o
- PERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
- PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
- PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
- else
- AC_MSG_ERROR([no, unable to link])
- fi
- else
- AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
- fi
+ AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
+ IF_PERL=
fi
AC_SUBST(PERLLIB)
AC_SUBST(PERLFLAGS)

View file

@ -20,7 +20,7 @@ distfiles="http://dist.schmorp.de/${pkgname}/${pkgname}-${version}.tar.bz2"
checksum=e73e13fe64b59fd3c8e6e20c00f149d388741f141b8155e4700d3ed40aa94b4e
pre_build() {
sed -i 's,tic,/bin/true,g' doc/Makefile
sed -i 's,tic,/bin/true,g' doc/Makefile
}
post_install() {
@ -45,6 +45,7 @@ fi
if [ "$build_option_perl" ]; then
configure_args+=" --enable-perl"
hostmakedepends+=" perl autoconf"
makedepends+=" perl"
else
configure_args+=" --disable-perl"
@ -62,3 +63,32 @@ if [ "$build_option_unicode3" ]; then
else
configure_args+=" --disable-unicode3"
fi
_cross_perl() {
if [ "$CROSS_BUILD" ]; then
sed -e "s#/usr/lib#${XBPS_CROSS_BASE}\0#g" \
-e "s#/usr/share#${XBPS_CROSS_BASE}\0#g"
else
cat
fi
}
pre_configure() {
if [ "$build_option_perl" ]; then
rm configure
./autogen.sh
fi
}
do_configure() {
if [ "$build_option_perl" ]; then
./configure $configure_args \
PERL=perl \
PERL_O=rxvtperl.o \
PERLFLAGS="$(perl -MExtUtils::Embed -e ccopts | _cross_perl)" \
PERLLIB="$(perl -MExtUtils::Embed -e ldopts | _cross_perl)" \
PERLPRIVLIBEXP="$(perl -MConfig -e 'print $Config{privlibexp}' | _cross_perl)"
else
./configure $configure_args
fi
}