1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
# $Id: configure.in,v 1.7 2000/02/09 01:16:07 leif Exp $ 
AC_INIT(perlmod.c) 
AC_CONFIG_HEADER(perl_machine.h) 
 
AC_MODULE_INIT() 
 
AC_CHECK_PROGS(perl, perl perl5, x) 
 
AC_MSG_CHECKING(if perl is embeddable) 
AC_CACHE_VAL(pike_cv_perlmod_have_perl, 
[ 
pike_cv_perlmod_have_perl=no 
 
objs= 
 
if test x$perl != xx ; then 
  # We have perl, but do we have perlembed? 
  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); 
  return 0; 
} 
],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' 
  if test "x$PERL_CCFLAGS" = x ; then 
    PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts` 
    PERL_CCFLAGS=`perl -MExtUtils::Embed -e ccopts` 
  fi 
  AC_DEFINE(HAVE_PERL) 
  AC_MSG_RESULT(yes) 
else 
  PERL_LDFLAGS='' 
  PERL_CCFLAGS='' 
  AC_MSG_RESULT(no) 
fi 
 
 
AC_SUBST(perl) 
AC_SUBST(extra_objs) 
AC_SUBST(PERL_LDFLAGS) 
AC_SUBST(PERL_CCFLAGS) 
 
 
AC_OUTPUT(Makefile,echo FOO >stamp-h )