bbdc261999-08-12Martin Stjernholm # $Id: configure.in,v 1.6 1999/08/12 17:12:44 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()
7d680e1999-01-07Fredrik Hübinette (Hubbe) AC_CHECK_PROGS(perl, perl perl5, x)
bbdc261999-08-12Martin Stjernholm AC_MSG_CHECKING(if perl is embeddable)
9b403d1998-12-21Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_perlmod_have_perl, [ pike_cv_perlmod_have_perl=no
5a2b431998-11-22Fredrik Hübinette (Hubbe) objs=
71f3a21998-11-22Fredrik Hübinette (Hubbe) 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`
5a2b431998-11-22Fredrik Hübinette (Hubbe)  if test "x$PERL_LDFLAGS$PERL_CCFLAGS" != x; then
9b403d1998-12-21Fredrik Hübinette (Hubbe)  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-}"
5a2b431998-11-22Fredrik Hübinette (Hubbe)  fi
71f3a21998-11-22Fredrik Hübinette (Hubbe) fi
9b403d1998-12-21Fredrik Hübinette (Hubbe) ]) if test "x$pike_cv_perlmod_have_perl" = xyes ; then extra_objs='perlxsi.o'
7d680e1999-01-07Fredrik Hübinette (Hubbe)  if test "x$PERL_CCFLAGS" = x ; then PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts` PERL_CCFLAGS=`perl -MExtUtils::Embed -e ccopts` fi
9b403d1998-12-21Fredrik Hübinette (Hubbe)  AC_DEFINE(HAVE_PERL) AC_MSG_RESULT(yes) else
dd990d1998-12-31Fredrik Hübinette (Hubbe)  PERL_LDFLAGS='' PERL_CCFLAGS=''
9b403d1998-12-21Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(no) fi
71f3a21998-11-22Fredrik Hübinette (Hubbe)  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 )