diff configure.ac @ 6508:cbd24b37350d

[gaim-migrate @ 7025] Okay, ready for some breakage again? I rewrote the perl loader plugin. All old scripts are broken, but the new API will be much better. Currently, you can access accounts and do debug output, and that's it, but adding support for new things is much easier. Please don't come after me with pitchforks. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 19 Aug 2003 21:47:36 +0000
parents 9a7fb2135e5e
children 1c7ceac520e5
line wrap: on
line diff
--- a/configure.ac	Tue Aug 19 21:09:56 2003 +0000
+++ b/configure.ac	Tue Aug 19 21:47:36 2003 +0000
@@ -222,11 +222,9 @@
 GC_TM_GMTOFF
 
 
-
-dnl This was taken straight from X-Chat.
-dnl X-Chat is the greatest application ever, not only
-dnl because it's a rocking IRC client but also because
-dnl it's very easy to learn from.
+dnl
+dnl Perl stuff. Yeah.
+dnl
 if test "$enable_perl" = yes ; then
 	AC_PATH_PROG(perlpath, perl)
 	AC_MSG_CHECKING(for Perl compile flags)
@@ -271,6 +269,56 @@
 	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=perl PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
+			fi
+		else
+			PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval"
+		fi
+	])
+
+	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)
+
+		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 "$LIBPERL_A" = "-lperl"; then
+				LIBPERL_A=
+			fi
+		fi
+
+		PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
+
+		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
 else
 	PERL_CFLAGS=
 	PERL_LIBS=
@@ -409,8 +457,9 @@
 	   plugins/gaim-remote/Makefile
 	   plugins/gestures/Makefile
 	   plugins/perl/Makefile
+	   plugins/perl/common/Makefile.PL
 	   plugins/ticker/Makefile
-	   po/Makefile.in 
+	   po/Makefile.in
            sounds/Makefile
 	   src/Makefile
 	   src/protocols/Makefile