diff options
author | Emmanuel Bouthenot <kolter@openics.org> | 2005-05-24 15:14:54 +0000 |
---|---|---|
committer | Emmanuel Bouthenot <kolter@openics.org> | 2005-05-24 15:14:54 +0000 |
commit | 37d74c4941f5f3da39cc275afbf28edd896b1413 (patch) | |
tree | 8efe912d60107d9f295b35913fc65d7b6eb1ce23 | |
parent | 01186c6c8bd553a7ee72ac23acbefe7b598f2f7d (diff) | |
download | weechat-37d74c4941f5f3da39cc275afbf28edd896b1413.zip |
Fix perl headers and library detection on various systems
-rw-r--r-- | configure.in | 22 | ||||
-rw-r--r-- | 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 <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $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 <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $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 |