c6f4a82002-01-27Martin Stjernholm # $Id: configure.in,v 1.12 2002/01/27 00:54:01 mast Exp $
71f3a21998-11-22Fredrik Hübinette (Hubbe) AC_INIT(perlmod.c)
5a2b431998-11-22Fredrik Hübinette (Hubbe) AC_CONFIG_HEADER(perl_machine.h)
71f3a21998-11-22Fredrik Hübinette (Hubbe)  AC_MODULE_INIT()
23a6da2000-04-19Henrik Grubbström (Grubba) AC_ARG_WITH(perl, [ --with-perl enable the Perl module],[],
83bc4a2000-05-20Leif Stensson  [with_perl="yes"])
7d680e1999-01-07Fredrik Hübinette (Hubbe) 
8c885e2001-02-13Mirar (Pontus Hagland) PIKE_FEATURE_WITHOUT(Perl)
f655492001-02-13Mirar (Pontus Hagland) 
23a6da2000-04-19Henrik Grubbström (Grubba) if test "x$with_perl" = "xno"; then :; else
9b403d1998-12-21Fredrik Hübinette (Hubbe) 
8c885e2001-02-13Mirar (Pontus Hagland)  PIKE_FEATURE_NODEP(Perl)
f655492001-02-13Mirar (Pontus Hagland) 
23a6da2000-04-19Henrik Grubbström (Grubba)  if test "x$with_perl" = "xyes"; then
c6f4a82002-01-27Martin Stjernholm  MY_AC_CHECK_PROGS(perl, perl perl5, x)
23a6da2000-04-19Henrik Grubbström (Grubba)  else
c6f4a82002-01-27Martin Stjernholm  MY_AC_CHECK_PROGS(perl, "$with_perl" perl perl5, x)
23a6da2000-04-19Henrik Grubbström (Grubba)  fi AC_MSG_CHECKING(if perl is embeddable) AC_CACHE_VAL(pike_cv_perlmod_have_perl, [ pike_cv_perlmod_have_perl=no
5a2b431998-11-22Fredrik Hübinette (Hubbe) 
23a6da2000-04-19Henrik Grubbström (Grubba)  objs=
5a2b431998-11-22Fredrik Hübinette (Hubbe) 
23a6da2000-04-19Henrik Grubbström (Grubba)  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`
9b403d1998-12-21Fredrik Hübinette (Hubbe) 
23a6da2000-04-19Henrik Grubbström (Grubba)  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([
9b403d1998-12-21Fredrik Hübinette (Hubbe) #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); my_perl = perl_alloc();
83bc4a2000-05-20Leif Stensson #ifndef DBsub /* perl5.6 */ PL_perl_destruct_level=2; #else /* perl5.005 */ perl_destruct_level=2; #endif
9b403d1998-12-21Fredrik Hübinette (Hubbe)  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);
18c6312000-02-09Leif Stensson  return 0;
9b403d1998-12-21Fredrik Hübinette (Hubbe) }
23a6da2000-04-19Henrik Grubbström (Grubba)  ],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)
8c885e2001-02-13Mirar (Pontus Hagland)  PIKE_FEATURE_OK(Perl)
23a6da2000-04-19Henrik Grubbström (Grubba)  else PERL_LDFLAGS='' PERL_CCFLAGS='' AC_MSG_RESULT(no)
5a2b431998-11-22Fredrik Hübinette (Hubbe)  fi
71f3a21998-11-22Fredrik Hübinette (Hubbe) fi AC_SUBST(perl)
5a2b431998-11-22Fredrik Hübinette (Hubbe) AC_SUBST(extra_objs)
71f3a21998-11-22Fredrik Hübinette (Hubbe) AC_SUBST(PERL_LDFLAGS) AC_SUBST(PERL_CCFLAGS)
5a2b431998-11-22Fredrik Hübinette (Hubbe) 
71f3a21998-11-22Fredrik Hübinette (Hubbe) AC_OUTPUT(Makefile,echo FOO >stamp-h )