+AC_PREREQ([2.53])
AC_INIT(rlm_perl.c)
AC_REVISION($Revision$)
AC_DEFUN(modname,[rlm_perl])
AC_PROG_CC
AC_PROG_CPP
- dnl put configuration checks here.
+ dnl put configuration checks here.
dnl set $fail to what's missing, on fatal errors.
dnl use AC_MSG_WARN() on important messages.
fail=$fail" perl"
else
old_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
+ CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`"
smart_try_dir=
- AC_SMART_CHECK_INCLUDE(EXTERN.h)
+ FR_SMART_CHECK_INCLUDE(EXTERN.h)
if test "x$ac_cv_header_EXTERN_h" = "xyes"; then
- perl_cflags="`perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
+ perl_cflags='`perl -MExtUtils::Embed -e ccopts`'
else
fail="$fail EXTERN.h"
targetname=
fi
- AC_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
+ FR_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
if test "x$ac_cv_header_perl_h" = "xyes"; then
- perl_cflags="`perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
+ perl_cflags='`perl -MExtUtils::Embed -e ccopts`'
else
fail="$fail perl.h"
targetname=
fi
- perl_ldflags='`perl -MExtUtils::Embed -e ldopts`'
+ old_LIBS="$LIBS"
+ LIBS="$old_LIBS `perl -MExtUtils::Embed -e ldopts`"
+ AC_TRY_LINK([extern char boot_DynaLoader();],
+ [ boot_DynaLoader()],
+ BROKEN=,
+ BROKEN="yes")
+
+ if test "x$BROKEN" = "x"; then
+ perl_ldflags='`perl -MExtUtils::Embed -e ldopts`'
+ else
+ fail="$fail libperl.so"
+ targetname=
+ fi
+
+ AC_TRY_LINK([extern char Perl_hv_store();],
+ [ Perl_hv_store()],
+ BROKEN=,
+ BROKEN="yes")
+
+ if test "x$BROKEN" != "x"; then
+ fail="$fail libperl.so"
+ targetname=
+ fi
CFLAGS=$old_CFLAGS
fi
AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
else
AC_MSG_WARN([silently not building ]modname[.])
- AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
+ AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
targetname=""
perl_cflags=""
perl_ldflags=""
AC_SUBST(targetname)
AC_OUTPUT(Makefile)
+AC_OUTPUT(all.mk)