pike.git/
src/
modules/
Perl/
configure.in
Branch:
Tag:
Non-build tags
All tags
No tags
1998-12-21
1998-12-21 23:18:04 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
9b403d9362fc64b3c380a92e57676e595c8d430b (
56
lines) (+
50
/-
6
)
[
Show
|
Annotate
]
Branch:
7.9
better configure test for embeddable perl
Rev: src/modules/Perl/configure.in:1.3
1:
-
# $Id: configure.in,v 1.
2
1998/
11
/
22
13
:
02
:
06
hubbe Exp $
+
# $Id: configure.in,v 1.
3
1998/
12
/
21
23
:
18
:
04
hubbe Exp $
AC_INIT(perlmod.c) AC_CONFIG_HEADER(perl_machine.h) AC_MODULE_INIT()
-
+
AC_CACHE_VAL(pike_cv_perlmod_have_perl,
+
[
+
pike_cv_perlmod_have_perl=no
+
AC_CHECK_PROGS(perl, perl perl5, x) objs= if test x$perl != xx ; then # We have perl, but do we have perlembed?
-
#
PERL
_
LDFLAGS=`perl -V:lddlflags | sed "s/^lddlflags='\
(
.*\);$/\1/"`
-
#
PERL_CCFLAGS=`perl
-V:ccflags | sed "s/^ccflags='\(.*\
)
;$/\1/"`
-
+
AC
_
MSG_CHECKING
(
if
perl
is
embeddable
)
PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts` PERL_CCFLAGS=`perl -MExtUtils::Embed -e ccopts` if test "x$PERL_LDFLAGS$PERL_CCFLAGS" != x; then
-
+
OLD_LIBS="${LDFLAGS-}"
+
OLD_CFLAGS="${CFLAGS-}"
+
CFLAGS="$CFLAGS $PERL_CCFLAGS"
+
LIBS="$LIBS $PERL_LDFLAGS"
+
+
AC_TRY_RUN([
+
#include <EXTERN.h>
+
#include <perl.h>
+
#include <unistd.h>
+
+
static PerlInterpreter *my_perl;
+
+
int main(int argc, char **argv, char **env)
+
{
+
char *args[4];
+
args[0]="perl";
+
args[1]="-e";
+
args[2]="1";
+
args[3]=0;
+
alarm(10);
+
+
perl_destruct_level=2;
+
my_perl = perl_alloc();
+
perl_construct(my_perl);
+
perl_parse(my_perl, NULL, 2, args, (char **)NULL);
+
perl_run(my_perl);
+
perl_destruct(my_perl);
+
perl_free(my_perl);
+
}
+
],pike_cv_perlmod_have_perl=yes)
+
+
LIBS="${OLD_LIBS-}"
+
CFLAGS="${OLD_CFLAGS-}"
+
fi
+
fi
+
])
+
+
if test "x$pike_cv_perlmod_have_perl" = xyes ; then
extra_objs='perlxsi.o' AC_DEFINE(HAVE_PERL)
-
+
AC_MSG_RESULT(yes)
+
else
+
AC_MSG_RESULT(no)
fi
-
fi
+
-
+
AC_SUBST(perl) AC_SUBST(extra_objs) AC_SUBST(PERL_LDFLAGS)