Subject: Fix broken perl detection somewhat.
From: Nathan Phillip Brink <[email-masked]>

--- a/configure.in
+++ b/configure.in
@@ -636,25 +636,27 @@
 dnl
 
 AC_MSG_CHECKING(whether to support Perl)
-AC_ARG_WITH(perl,
-[  --with-perl[=PATH]       Compile with perl support.],
-[ test -z "$withval" && withval=yes ],
-)
-test "xno" != "x$withval" && for base in $withval /usr/local /usr /
-do
-	FOUND=
-	for ext in so a dll ; do
-		test -r $base/lib/libperl.$ext && FOUND=1
-		test -r $base/libperl.$ext && FOUND=1
-	done
-	test -n "$FOUND" || continue
-	AC_MSG_RESULT(yes)
-	LIBS="$LIBS `perl -MExtUtils::Embed -e ldopts`"
-	PERLDOTOH="perl.o"
-	AC_DEFINE(PERL)
-	break
-done
-test -z "$PERLDOTOH" && AC_MSG_RESULT(no)
+AC_ARG_WITH([perl],
+	[AS_HELP_STRING([--with-perl[=PATH]], [Compile with perl support.])],
+	[],
+	[with_perl=maybe])
+AS_IF([test "xno" != "x$with_perl"],
+	[
+	PERL_LIBS="`perl -MExtUtils::Embed -e ldopts`"
+	AS_IF([test -n "$PERL_LIBS"],
+		[
+		AC_MSG_RESULT([yes])
+		LIBS="$LIBS $PERL_LIBS"
+		AC_DEFINE([PERL], [], [Define if perl support should be compiled])
+		PERLDOTOH="perl.o"
+		],
+		[
+		AC_MSG_RESULT([no])
+		AS_IF([test "x$with_perl" != "xmaybe"],
+			[AC_MSG_ERROR([You specified --with-perl, but I was unable to find libperl])])
+		])
+	])
+
 withval=''
 
 dnl ----------------------------------------------------------

Diff finished.  Thu Jun 30 22:15:26 2011