diff --git a/configure.in b/configure.in index 1b64edd6..cf0b412d 100644 --- a/configure.in +++ b/configure.in @@ -547,6 +547,16 @@ if test "$want_perl" != "no"; then PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null` fi + if test "x$ac_cv_prog_gcc" = "xyes" -a ! `echo $host_os|grep -q 'bsd\|linux'`; then + dnl * several systems have Perl compiled with native compiler + dnl * but irssi is being compiled with GCC. Here we try to + dnl * fix those command line options a bit so GCC won't + dnl * complain about them. Normally there's only few options + dnl * that we want to keep: + dnl * -Ddefine -Uundef -I/path -fopt -mopt + PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-[^DUIfm][^ ]+/\1/g'` + fi + if test -z "$PERL_CFLAGS"; then if test -n "$perl_check_error"; then perl_check_error="Error getting perl CFLAGS" diff --git a/src/perl/Makefile.am b/src/perl/Makefile.am index 293bd80c..16dc55da 100644 --- a/src/perl/Makefile.am +++ b/src/perl/Makefile.am @@ -141,7 +141,7 @@ all-local: if [ ! -f Makefile ]; then \ $(perlpath) Makefile.PL $(PERL_MM_PARAMS); \ fi && \ - ($(MAKE) || $(MAKE)) && \ + ($(MAKE) CC=$(CC) || $(MAKE) CC=$(CC)) && \ cd ..; \ done