changeset 7200:2ddd145c9420

[gaim-migrate @ 7769] Added additional checks and fixes for the perl build process. ExtUtils::MakeMaker is now required to build perl. If they don't have it, perl just won't attempt to build, which is better than failing during compile. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 09 Oct 2003 00:16:45 +0000
parents aeaa751d32f7
children 35f92559a4a1
files ChangeLog configure.ac
diffstat 2 files changed, 72 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 09 00:03:18 2003 +0000
+++ b/ChangeLog	Thu Oct 09 00:16:45 2003 +0000
@@ -23,6 +23,7 @@
 	  (Robert McQueen)
 	* Implemented another new Yahoo! authentication method
 	* Fixed a bug displaying Chinese MSN messages (Ambrose C. LI).
+	* Additional fixes and checks for the perl build process (Sean Burke).
 	* Massive core/UI splitting.
 	* Re-write of Jabber protocol plugin
 	* Conversation API changes.
--- a/configure.ac	Thu Oct 09 00:03:18 2003 +0000
+++ b/configure.ac	Thu Oct 09 00:16:45 2003 +0000
@@ -283,79 +283,89 @@
 fi
 
 if test "$enable_perl" = yes ; then
-	AC_SUBST(PERL_CFLAGS)
-	AC_SUBST(PERL_LIBS)
-	AM_CONDITIONAL(USE_PERL, test "x$enable_perl" = "xyes")
+	AC_PROG_PERL_MODULES(ExtUtils::MakeMaker, , have_makemaker=no)
 
-	dnl This is almost definitely wrong, but in case there's
-	dnl something I'm missing, I'll leave it in.
-	AC_CHECK_FUNCS(Perl_eval_pv)
-
-	AC_MSG_CHECKING(for old perl)
-	PERL_OLD=`$perlpath -e 'if($]<5.006){printf"yes\n";}else{printf"no\n";}'`
+	if test "x$have_makemaker" = "xno"; then
+		enable_perl=no
+		PERL_CFLAGS=
+		PERL_LIBS=
+		AM_CONDITIONAL(USE_PERL, false)
+		AC_MSG_WARN(Compiling perl requires ExtUtils::MakeMaker)
+	else
+		AC_SUBST(PERL_CFLAGS)
+		AC_SUBST(PERL_LIBS)
+		AM_CONDITIONAL(USE_PERL, test "x$enable_perl" = "xyes")
 
-	if test "$PERL_OLD" = "yes"; then
-		AC_DEFINE(OLD_PERL, 1, [Define if old perl is installed.])
-		AC_MSG_RESULT(yes)
-	else
-		AC_MSG_RESULT(no)
-	fi
+		dnl This is almost definitely wrong, but in case there's
+		dnl something I'm missing, I'll leave it in.
+		AC_CHECK_FUNCS(Perl_eval_pv)
+
+		AC_MSG_CHECKING(for old perl)
+		PERL_OLD=`$perlpath -e 'if($]<5.006){printf"yes\n";}else{printf"no\n";}'`
 
-	if test "x$prefix" != "xNONE"; then
-		prefix=`eval echo $prefix`
-		PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$prefix"
-	fi
+		if test "x$PERL_OLD" = "xyes"; then
+			AC_DEFINE(OLD_PERL, 1, [Define if old perl is installed.])
+			AC_MSG_RESULT(yes)
+		else
+			AC_MSG_RESULT(no)
+		fi
 
-	AC_ARG_WITH(perl-lib,
-	[  --with-perl-lib=[site|vendor|DIR]  Specify where to install the
-	                           Perl libraries for gaim. Default is site.],
-	[
-		if test "x$withval" = xsite; then
-			PERL_MM_PARAMS=""
-		elif test "x$withval" = xvendor; then
-			if test -z "`$perlpath -v | grep '5\.0'`"; then
-				PERL_MM_PARAMS="INSTALLDIRS=vendor"
-			else
-				PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
-			fi
-		else
-			PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$withval"
+		if test "x$prefix" != "xNONE"; then
+			prefix=`eval echo $prefix`
+			PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$prefix"
 		fi
-	])
 
-	AC_SUBST(PERL_MM_PARAMS)
-
-	AC_MSG_CHECKING(for DynaLoader.a)
-	DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
+		AC_ARG_WITH(perl-lib,
+		[  --with-perl-lib=[site|vendor|DIR]  Specify where to install the
+								   Perl libraries for gaim. Default is site.],
+		[
+			if test "x$withval" = xsite; then
+				PERL_MM_PARAMS=""
+			elif test "x$withval" = xvendor; then
+				if test -z "`$perlpath -v | grep '5\.0'`"; then
+					PERL_MM_PARAMS="INSTALLDIRS=vendor"
+				else
+					PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
+				fi
+			else
+				PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$withval"
+			fi
+		])
 
-	dnl Don't check libperl.a if dynaloader.a wasn't found.
-	if test -n "$DYNALOADER_A"; then
-		AC_MSG_RESULT(yes)
+		AC_SUBST(PERL_MM_PARAMS)
 
-		dnl Find either libperl.a or libperl.so
-		AC_MSG_CHECKING(for libperl.a or libperl.so)
-		LIBPERL_A=`echo "$PERL_LDFLAGS -L/usr/lib"|$perlpath -e 'foreach (split(/ /, <STDIN>)) { if (/^-L(.*)/) { my $dir=$1; if (\`ls $dir/libperl.so* 2>/dev/null\`) { print "-lperl"; last; }; if (-e "$dir/libperl.a") { print "$dir/libperl.a"; last } } };'`
-		if test -z "$LIBPERL_A"; then
-			AC_MSG_RESULT(no)
-			DYNALOADER_A=
-		else
+		AC_MSG_CHECKING(for DynaLoader.a)
+		DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
+
+		dnl Don't check libperl.a if dynaloader.a wasn't found.
+		if test -n "$DYNALOADER_A"; then
 			AC_MSG_RESULT(yes)
 
-			if test "$LIBPERL_A" = "-lperl"; then
-				LIBPERL_A=
-			fi
-		fi
-
-		PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
+			dnl Find either libperl.a or libperl.so
+			AC_MSG_CHECKING(for libperl.a or libperl.so)
+			LIBPERL_A=`echo "$PERL_LDFLAGS -L/usr/lib"|$perlpath -e 'foreach (split(/ /, <STDIN>)) { if (/^-L(.*)/) { my $dir=$1; if (\`ls $dir/libperl.so* 2>/dev/null\`) { print "-lperl"; last; }; if (-e "$dir/libperl.a") { print "$dir/libperl.a"; last } } };'`
+			if test -z "$LIBPERL_A"; then
+				AC_MSG_RESULT(no)
+				DYNALOADER_A=
+			else
+				AC_MSG_RESULT(yes)
 
-		if test -n "$LIBPERL_A"; then
-			PERL_LIBS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
-		fi
+				if test "$LIBPERL_A" = "-lperl"; then
+					LIBPERL_A=
+				fi
+			fi
+
+			PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
 
-		AC_SUBST(DYNALOADER_A)
-		AC_SUBST(LIBPERL_A)
-	else
-		AC_MSG_RESULT(no)
+			if test -n "$LIBPERL_A"; then
+				PERL_LIBS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
+			fi
+
+			AC_SUBST(DYNALOADER_A)
+			AC_SUBST(LIBPERL_A)
+		else
+			AC_MSG_RESULT(no)
+		fi
 	fi
 else
 	PERL_CFLAGS=