From 37d74c4941f5f3da39cc275afbf28edd896b1413 Mon Sep 17 00:00:00 2001 From: Emmanuel Bouthenot Date: Tue, 24 May 2005 15:14:54 +0000 Subject: [PATCH] Fix perl headers and library detection on various systems --- configure.in | 22 +++++++++++++++++----- weechat/configure.in | 22 +++++++++++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index d6f289cf7..5e83d2017 100644 --- a/configure.in +++ b/configure.in @@ -148,11 +148,24 @@ Please check that perl is in path, or install it with your software package manager.]) fi - AC_MSG_CHECKING(for Perl library) + AC_MSG_CHECKING(for Perl headers files) - PERL_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` + PERL_HEADER_TEST=`PT=perltest.c ; echo "#include " > $PT; echo "#include " >> $PT; echo "#include " >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` - if test "x$PERL_TEST" = "x0" ; then + if test "x$PERL_HEADER_TEST" = "x0" ; then + PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts` + else + AC_MSG_ERROR([ +*** Perl headers couldn't be found in your system. +*** Try to install it with your software package manager.]) + fi + AC_MSG_RESULT(found) + + AC_MSG_CHECKING(for Perl library) + + PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` + + if test "x$PERL_LIB_TEST" = "x0" ; then PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`" else AC_MSG_ERROR([ @@ -160,8 +173,7 @@ it with your software package manager.]) *** Try to install it with your software package manager.]) fi AC_MSG_RESULT(found) - - PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts` + AC_SUBST(PERL_CFLAGS) AC_DEFINE(PLUGIN_PERL) fi diff --git a/weechat/configure.in b/weechat/configure.in index d6f289cf7..5e83d2017 100644 --- a/weechat/configure.in +++ b/weechat/configure.in @@ -148,11 +148,24 @@ Please check that perl is in path, or install it with your software package manager.]) fi - AC_MSG_CHECKING(for Perl library) + AC_MSG_CHECKING(for Perl headers files) - PERL_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` + PERL_HEADER_TEST=`PT=perltest.c ; echo "#include " > $PT; echo "#include " >> $PT; echo "#include " >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` - if test "x$PERL_TEST" = "x0" ; then + if test "x$PERL_HEADER_TEST" = "x0" ; then + PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts` + else + AC_MSG_ERROR([ +*** Perl headers couldn't be found in your system. +*** Try to install it with your software package manager.]) + fi + AC_MSG_RESULT(found) + + AC_MSG_CHECKING(for Perl library) + + PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` + + if test "x$PERL_LIB_TEST" = "x0" ; then PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`" else AC_MSG_ERROR([ @@ -160,8 +173,7 @@ it with your software package manager.]) *** Try to install it with your software package manager.]) fi AC_MSG_RESULT(found) - - PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts` + AC_SUBST(PERL_CFLAGS) AC_DEFINE(PLUGIN_PERL) fi