changeset 553:8cff36d54643

[gaim-migrate @ 563] beginnings of perl support. remember, ./gen committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 31 Jul 2000 17:58:39 +0000
parents 1a2e9bffa434
children faceeabc6d61
files acconfig.h configure.in
diffstat 2 files changed, 35 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/acconfig.h	Mon Jul 31 17:48:35 2000 +0000
+++ b/acconfig.h	Mon Jul 31 17:58:39 2000 +0000
@@ -7,6 +7,7 @@
 #undef USE_APPLET
 #undef DEBUG
 #undef GAIM_PLUGINS
+#undef USE_PERL
 #undef NAS_SOUND
 #undef ESD_SOUND
 #undef _REENTRANT
--- a/configure.in	Mon Jul 31 17:48:35 2000 +0000
+++ b/configure.in	Mon Jul 31 17:58:39 2000 +0000
@@ -34,12 +34,13 @@
 
 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
-AC_ARG_ENABLE(debug, [  --enable-debug          compile with debugging support],,enable_debug=no)
-AC_ARG_ENABLE(gnome, [  --enable-gnome          compile as a GNOME applet],,enable_gnome=$enable_distrib)
+AC_ARG_ENABLE(debug,   [  --enable-debug          compile with debugging support],,enable_debug=no)
+AC_ARG_ENABLE(gnome,   [  --enable-gnome          compile as a GNOME applet],,enable_gnome=$enable_distrib)
 AM_CONDITIONAL(GNOMEAPPLET, test "x$enable_gnome" = "xyes")
-AC_ARG_ENABLE(esd,   [  --disable-esd           Turn off ESD (default=auto)],enable_esd=no,enable_esd=yes)
-AC_ARG_ENABLE(nas,   [  --enable-nas            Enable NAS (Network Audio System) support],,enable_nas=no)
+AC_ARG_ENABLE(esd,     [  --disable-esd           Turn off ESD (default=auto)],enable_esd=no,enable_esd=yes)
+AC_ARG_ENABLE(nas,     [  --enable-nas            Enable NAS (Network Audio System) support],,enable_nas=no)
 AC_ARG_ENABLE(plugins, [  --disable-plugins       compile with out plugin support],enable_plugins=no,enable_plugins=yes)
+AC_ARG_ENABLE(perl,    [  --disable-perl          compile without perl scripting],enable_perl=no,enable_perl=yes)
 AM_CONDITIONAL(PLUGINS, test x$enable_plugins = xyes)
 AC_ARG_ENABLE(,,,)
 
@@ -70,6 +71,35 @@
 	AC_DEFINE(GAIM_PLUGINS)
 fi
 
+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.
+if test "$enable_perl" = yes ; then
+	AC_PATH_PROG(sedpath, sed)
+	AC_PATH_PROG(perlpath, perl)
+	AC_MSG_CHECKING(for Perl compile flags)
+	PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
+	if test "_$PERL_CFLAGS" = _ ; then
+		AC_MSG_RESULT([not found, building without perl.])
+		enable_perl = no
+	else
+		PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
+		PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
+		PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
+		if test "$system" = "Linux"; then
+			PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
+			PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
+		fi
+		PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
+		AC_MSG_RESULT(ok)
+		CFLAGS="$CFLAGS $PERL_CFLAGS"
+		LIBS="$LIBS $PERL_LDFLAGS"
+		AC_DEFINE(USE_PERL)
+		AC_CHECK_FUNCS(Perl_eval_pv)
+	fi
+fi
+
 if test "$enable_nas" = yes ; then
 	AC_DEFINE(NAS_SOUND)
         LIBS="$LIBS -laudio"