summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-09-07 21:55:58 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-09-07 21:55:58 +0000
commit17bb7faf2f21869ea6a3336a1ac38587ea675e8f (patch)
treeed39913f0fca96beddf3ac866d0c581cc8c51b86 /configure.in
parentab2accdb41e20ef891f25a678b5436416cefa2f3 (diff)
downloadirssi-17bb7faf2f21869ea6a3336a1ac38587ea675e8f.zip
Perl works now only as a runtime loadable module
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@656 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in61
1 files changed, 41 insertions, 20 deletions
diff --git a/configure.in b/configure.in
index b66c4fcd..354cfb4b 100644
--- a/configure.in
+++ b/configure.in
@@ -223,34 +223,49 @@ else
fi
AC_PATH_PROG(sedpath, sed)
-if test "$want_perl" = yes; then
+if test "$want_perl" = "yes"; then
AC_PATH_PROG(perlpath, perl)
AC_MSG_CHECKING(for Perl compile flags)
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
if test "x$PERL_CFLAGS" = "x"; then
- AC_MSG_RESULT([not found, building without perl.])
+ AC_MSG_RESULT([not found, building without Perl.])
want_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 //'`
+ PERL_LDFLAGS="`$perlpath -MExtUtils::Embed -e ldopts` "
+
+ dnl * dynaloader.a -> libperl_dynaloader.la
+ dynaloader=`echo $PERL_LDFLAGS | $sedpath 's/.* \([[^ ]]*\.a\).*/\1/'`
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/ [[^ ]]*\.a/ libperl_dynaloader.la/'`
+
+ dnl * remove all database stuffs
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-ldb //'`
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-ldbm //'`
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lndbm //'`
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lgdbm //'`
+ dnl * nsl is already in ldflags
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lnsl //'`
+
+ dnl * linux specific ..
+ if echo $host_os | grep -q linux; then
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lposix //'`
fi
- PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
- AC_MSG_RESULT(ok)
- AC_SUBST(PERL_CFLAGS)
- AC_SUBST(PERL_LDFLAGS)
- AC_SUBST(PERL_LIB_DIR)
- AC_DEFINE(HAVE_PERL)
- fi
+ dnl * libc is of course in list already
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lc //'`
+ dnl * must not be in LIBADD line
+ PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-rdynamic //'`
+
+ if test "x$dynaloader" = "x"; then
+ AC_MSG_RESULT([error parsing ldopts, building without Perl.])
+ want_perl=no
+ else
+ AC_MSG_RESULT(ok)
- dnl ** building from objdir..
- if test ! -d plugins/perl/xs; then
- mkdir -p plugins/perl/xs
+ AC_SUBST(PERL_CFLAGS)
+ AC_SUBST(PERL_LDFLAGS)
+ AC_SUBST(PERL_LIB_DIR)
+ fi
fi
fi
@@ -312,7 +327,7 @@ for c in $CHAT_MODULES; do
echo "void ${c}_core_init(void); void ${c}_core_deinit(void);" >> $file
if test "x$module_inits" != "x"; then
echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
- echo "$module_deinits" | $sedpath -e 's/[ ]*$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
+ echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
fi
echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
@@ -322,7 +337,7 @@ for c in $CHAT_MODULES; do
echo "/* this file is automatically generated by configure - don't change */" > $file
if test "x$fe_module_inits" != "x"; then
echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
- echo "$fe_module_deinits" | $sedpath -e 's/[ ]*$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
+ echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
fi
echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
@@ -408,6 +423,12 @@ if test "x$want_perl" = "xyes"; then
ln -sf $file `echo $file|sed "s?$whole_dir/??"`
done
fi
+ if test ! -d src/perl/.libs; then
+ mkdir -p src/perl/.libs
+ fi
+ if test ! -L src/perl/.libs/DynaLoader.a; then
+ ln -s $dynaloader src/perl/.libs/DynaLoader.a
+ fi
fi
echo