[Exim] Wrong perl version used when creating build-.../Makef…

Pàgina inicial
Delete this message
Reply to this message
Autor: Matthias Waffenschmidt
Data:  
A: exim-users
Assumpte: [Exim] Wrong perl version used when creating build-.../Makefile
--
Hi,

I've encountered a strange behaviour when building Exim with Perl
support that I would call a bug:

When you define PERL_COMMAND in e.g. Local/Makefile, but the shell
finds a different perl binary in $PATH, Exim uses the perl found in
$PATH to calculate the default values for PERL_CC, PERL_CCOPTS and
PERL_LIBS.

If the three perl related variables are not set in Local/Makefile (or
another Makefile), these probable wrong default values are used to
build exim.

One could argue, that it is easy to set the PATH environment variable
accordingdly. But I think, the make process should handle the
situation, when an explicit perl binary was defined via PERL_COMMAND.

I added a patch against scripts/Configure-Makefile (version 4.14) in
this mail that should fix the problem. Maybe it does not catch all
legal definitions of PERL_COMMAND in Local/Makefile (or one of the
other Makefiles), but the idea should be clear.

--
Gruss / Best regards   |  LF.net GmbH        |  fon +49 711 90074-411
Matthias Waffenschmidt |  Ruppmannstr. 27    |  fax +49 711 90074-33
mw@???              |  D-70565 Stuttgart  |  http://www.lf.net
--
--- scripts/Configure-Makefile    Tue Mar 11 13:20:18 2003
+++ new-scripts/Configure-Makefile    Wed May 14 00:09:08 2003
@@ -114,18 +114,22 @@
 # what we have so far and then copy it afterwards.


EXIM_PERL=`grep EXIM_PERL $mft`
+PERL_COMMAND=`grep PERL_COMMAND $mft | sed -e '$!d;s/^[$st]*PERL_COMMAND[$st]*=[$st]*//'`
+if [ "${PERL_COMMAND}" = "" ] ; then
+ PERL_COMMAND='perl'
+fi

 if [ "${EXIM_PERL}" != "" ] ; then
-  testperl=`perl --version`
+  testperl=`$PERL_COMMAND --version`
   if [ "$testperl" = "" ] ; then
     echo '*** EXIM_PERL is set, but "perl --version" failed'
     exit 1
   fi


mv $mft $mftt
- echo "PERL_CC=`perl -MConfig -e 'print $Config{cc}'`" >>$mft
- echo "PERL_CCOPTS=`perl -MExtUtils::Embed -e ccopts`" >>$mft
- echo "PERL_LIBS=`perl -MExtUtils::Embed -e ldopts`" >>$mft
+ echo "PERL_CC=`$PERL_COMMAND -MConfig -e 'print $Config{cc}'`" >>$mft
+ echo "PERL_CCOPTS=`$PERL_COMMAND -MExtUtils::Embed -e ccopts`" >>$mft
+ echo "PERL_LIBS=`$PERL_COMMAND -MExtUtils::Embed -e ldopts`" >>$mft
echo "" >>$mft
cat $mftt >> $mft
rm -f $mftt
--