if test x$with_rlm_perl != xno; then
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
if test "$PERL" = "not-found" -o ! -x "$PERL"; then
- fail=$fail" perl"
+ fail=$fail" perl"
else
- old_CFLAGS="$CFLAGS"
+ old_CFLAGS="${CFLAGS}"
+ old_LIBS="${LIBS}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Calling ExtUtils::Embed to get 'ccopts'" >&5
+$as_echo "$as_me: Calling ExtUtils::Embed to get 'ccopts'" >&6;}
+ perl_cflags=$($PERL -MExtUtils::Embed -e ccopts)
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ExtUtil's ccopts were \"${perl_cflags}\"" >&5
+$as_echo "$as_me: ExtUtil's ccopts were \"${perl_cflags}\"" >&6;}
+
+ perl_cflags=$(echo "$perl_cflags" | sed 's/-arch [^ ]*//g;s/ / /g;s/^ *//;s/ *$//')
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Sanitized ccopts are \"${perl_cflags}\"" >&5
+$as_echo "$as_me: Sanitized ccopts are \"${perl_cflags}\"" >&6;}
+
+ CFLAGS="${perl_cflags} ${CFLAGS}"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl ccopts" >&5
-$as_echo_n "checking for Perl ccopts... " >&6; }
- perl_cflags=$($PERL -MExtUtils::Embed -e ccopts | sed 's/-arch [^ ]*[ ]*//g')
- CFLAGS+=" $perl_cflags"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_cflags" >&5
-$as_echo "$perl_cflags" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Calling ExtUtils::Embed to get 'ldflags'" >&5
+$as_echo "$as_me: Calling ExtUtils::Embed to get 'ldflags'" >&6;}
+ perl_ldflags=$($PERL -MExtUtils::Embed -e ldopts)
- smart_try_dir=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ExtUtil's ldopts were \"${perl_ldflags}\"" >&5
+$as_echo "$as_me: ExtUtil's ldopts were \"${perl_ldflags}\"" >&6;}
+
+ perl_ldflags=$(echo "$perl_ldflags" | sed 's/-arch [^ ]*//g;s/ / /g;s/^ *//;s/ *$//')
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Sanitized ldopts are \"${perl_ldflags}\"" >&5
+$as_echo "$as_me: Sanitized ldopts are \"${perl_ldflags}\"" >&6;}
+
+ LIBS="${perl_ldflags} ${LIBS}"
+
+ smart_try_dir=
$as_echo "no" >&6; }
fi
- if test "x$ac_cv_header_EXTERN_h" != "xyes"; then
- fail="$fail EXTERN.h"
- targetname=
- fi
+ if test "x$ac_cv_header_EXTERN_h" != "xyes"; then
+ fail="$fail EXTERN.h"
+ targetname=
+ fi
$as_echo "no" >&6; }
fi
- if test "x$ac_cv_header_perl_h" != "xyes"; then
- fail="$fail EXTERN.h"
- targetname=
- fi
-
- old_LIBS="$LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl ldopts" >&5
-$as_echo_n "checking for Perl ldopts... " >&6; }
- perl_ldflags=$($PERL -MExtUtils::Embed -e ldopts | sed 's/-arch [^ ]*[ ]*//g')
- LIBS+=" $perl_ldflags"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_ldflags" >&5
-$as_echo "$perl_ldflags" >&6; }
+ if test "x$ac_cv_header_perl_h" != "xyes"; then
+ fail="$fail EXTERN.h"
+ targetname=
+ fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking we can link to boot_DynaLoader" >&5
+$as_echo_n "checking we can link to boot_DynaLoader... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern char boot_DynaLoader();
+
int
main ()
{
- boot_DynaLoader()
+
+ extern char boot_DynaLoader();
+ boot_DynaLoader();
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- BROKEN=
+ LINKS="yes"
else
- BROKEN="yes"
+ LINKS="no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$BROKEN" != "x"; then
- fail="$fail libperl.so"
- targetname=
- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKS" >&5
+$as_echo "$LINKS" >&6; }
+ if test "x$LINKS" == "xno"; then
+ fail="$fail libperl.so"
+ targetname=
+ fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking we can link to Perl_hv_store()" >&5
+$as_echo_n "checking we can link to Perl_hv_store()... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern char Perl_hv_store();
+
int
main ()
{
- Perl_hv_store()
+
+ extern char Perl_hv_store();
+ Perl_hv_store();
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- BROKEN=
+ LINKS="yes"
else
- BROKEN="yes"
+ LINKS="no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$BROKEN" != "x"; then
- fail="$fail libperl.so"
- targetname=
- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKS" >&5
+$as_echo "$LINKS" >&6; }
+ if test "x$LINKS" == "xno"; then
+ fail="$fail libperl.so"
+ targetname=
+ fi
- CFLAGS=$old_CFLAGS
- LIBS=$old_libs
- fi
- targetname=rlm_perl
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+ targetname=rlm_perl
+ fi
else
- targetname=
- echo \*\*\* module rlm_perl is disabled. # keep this! Don't change!
+ targetname=
+ echo \*\*\* module rlm_perl is disabled. # keep this! Don't change!
fi
if test x"$fail" != x""; then
m4_include([ax_with_prog.m4])
if test x$with_[]modname != xno; then
-
AC_PROG_CC
AC_PROG_CPP
dnl set $fail to what's missing, on fatal errors.
dnl use AC_MSG_WARN() on important messages.
- AX_WITH_PROG([PERL],[perl],[not-found],[${PATH}:/usr/bin:/usr/local/bin])
+ AX_WITH_PROG([PERL],[perl],[not-found],[${PATH}:/usr/bin:/usr/local/bin])
if test "$PERL" = "not-found" -o ! -x "$PERL"; then
- fail=$fail" perl"
+ fail=$fail" perl"
else
- old_CFLAGS="$CFLAGS"
-
- AC_MSG_CHECKING([for Perl ccopts])
- perl_cflags=$($PERL -MExtUtils::Embed -e ccopts | sed ['s/-arch [^ ]*[ ]*//g'])
- CFLAGS+=" $perl_cflags"
- AC_MSG_RESULT([$perl_cflags])
-
- smart_try_dir=
- FR_SMART_CHECK_INCLUDE(EXTERN.h)
- if test "x$ac_cv_header_EXTERN_h" != "xyes"; then
- fail="$fail EXTERN.h"
- targetname=
- fi
-
- FR_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
- if test "x$ac_cv_header_perl_h" != "xyes"; then
- fail="$fail EXTERN.h"
- targetname=
- fi
-
- old_LIBS="$LIBS"
-
- AC_MSG_CHECKING([for Perl ldopts])
- perl_ldflags=$($PERL -MExtUtils::Embed -e ldopts | sed ['s/-arch [^ ]*[ ]*//g'])
- LIBS+=" $perl_ldflags"
- AC_MSG_RESULT([$perl_ldflags])
-
- AC_TRY_LINK([extern char boot_DynaLoader();],
- [ boot_DynaLoader()],
- BROKEN=,
- BROKEN="yes")
-
- if test "x$BROKEN" != "x"; then
- 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
- LIBS=$old_libs
- fi
- targetname=modname
-
+ old_CFLAGS="${CFLAGS}"
+ old_LIBS="${LIBS}"
+
+ dnl ############################################################
+ dnl # Call ExtUtils::Embed to get compiler flags
+ dnl ############################################################
+ AC_MSG_NOTICE([Calling ExtUtils::Embed to get 'ccopts'])
+ perl_cflags=$($PERL -MExtUtils::Embed -e ccopts)
+
+ AC_MSG_NOTICE([ExtUtil's ccopts were \"${perl_cflags}\"])
+
+ perl_cflags=[$(echo "$perl_cflags" | sed 's/-arch [^ ]*//g;s/ / /g;s/^ *//;s/ *$//')]
+
+ AC_MSG_NOTICE([Sanitized ccopts are \"${perl_cflags}\"])
+
+ CFLAGS="${perl_cflags} ${CFLAGS}"
+
+ dnl ############################################################
+ dnl # Call ExtUtils::Embed to get linker flags
+ dnl ############################################################
+ AC_MSG_NOTICE([Calling ExtUtils::Embed to get 'ldflags'])
+ perl_ldflags=$($PERL -MExtUtils::Embed -e ldopts)
+
+ AC_MSG_NOTICE([ExtUtil's ldopts were \"${perl_ldflags}\"])
+
+ perl_ldflags=[$(echo "$perl_ldflags" | sed 's/-arch [^ ]*//g;s/ / /g;s/^ *//;s/ *$//')]
+
+ AC_MSG_NOTICE([Sanitized ldopts are \"${perl_ldflags}\"])
+
+ LIBS="${perl_ldflags} ${LIBS}"
+
+ dnl ############################################################
+ dnl # Check required headers are available
+ dnl ############################################################
+ smart_try_dir=
+ FR_SMART_CHECK_INCLUDE(EXTERN.h)
+ if test "x$ac_cv_header_EXTERN_h" != "xyes"; then
+ fail="$fail EXTERN.h"
+ targetname=
+ fi
+
+ FR_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
+ if test "x$ac_cv_header_perl_h" != "xyes"; then
+ fail="$fail EXTERN.h"
+ targetname=
+ fi
+
+ dnl ############################################################
+ dnl # Link test functions
+ dnl ############################################################
+ AC_MSG_CHECKING([we can link to boot_DynaLoader])
+ AC_TRY_LINK([],
+ [
+ extern char boot_DynaLoader();
+ boot_DynaLoader();
+ ],
+ [LINKS="yes"], [LINKS="no"])
+
+ AC_MSG_RESULT($LINKS)
+ if test "x$LINKS" == "xno"; then
+ fail="$fail libperl.so"
+ targetname=
+ fi
+
+ AC_MSG_CHECKING([we can link to Perl_hv_store()])
+ AC_TRY_LINK([],
+ [
+ extern char Perl_hv_store();
+ Perl_hv_store();
+ ],
+ [LINKS="yes"], [LINKS="no"])
+
+ AC_MSG_RESULT($LINKS)
+ if test "x$LINKS" == "xno"; then
+ fail="$fail libperl.so"
+ targetname=
+ fi
+
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+
+ targetname=modname
+ fi
else
- targetname=
- echo \*\*\* module modname is disabled. # keep this! Don't change!
+ targetname=
+ echo \*\*\* module modname is disabled. # keep this! Don't change!
fi
dnl Don't change this section.