-dnl Don't think we need these anymore, but it's a good reference
-dnl if test "x$PERL" != "x"; then
-dnl PERLCCFLAGS=`$PERL -MConfig -e 'print $Config{ccflags};'`
-dnl PERLCPPFLAGS=`$PERL -MConfig -e 'print $Config{cppflags};'`
-dnl PERLLIBS=`$PERL -MConfig -e 'print $Config{perllibs};'`
-dnl fi
+ AS_IF([test "${pandora_cv_perl_dev}" = "no"],
+ [with_perl=no])
+
+ AC_CACHE_CHECK([for Perl install location],
+ [pandora_cv_perl_archdir],[
+ AS_IF([test "${with_perl_arch}" = "no"],[
+ pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{sitearch}'`
+ ],[
+ pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{archlib}'`
+ ])
+ pandora_cv_perl_archdir="${pandora_cv_perl_archdir}"
+ ])
+
+ PERL_ARCHDIR="${pandora_cv_perl_archdir}"
+ ])
+ AC_SUBST([PERL_CPPFLAGS])
+ AC_SUBST([PERL_ARCHDIR])
+
+ AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" != "no"])