From ba52d084d62a11804759fb5dfebeb67fe534df99 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 28 Oct 2002 00:12:42 +0000 Subject: [PATCH] Try to fix perl compilation for people whose perl has been compiled with non-GCC but are trying to compile irssi with GCC. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2976 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- configure.in | 10 ++++++++++ src/perl/Makefile.am | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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