[EXIM] 2.053 report

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Vadim Vygonets
Fecha:  
A: exim-users
Cc: Ephraim Silverberg, P.Hazel
Asunto: [EXIM] 2.053 report
I compiled exim on various platforms with perl support, and here
is the description of what I've done to achieve it. I used
native make(1) (which differs wildly: GNU make (gmake), BSD
(sprite-based) make, or proprietary make) and gcc (version
2.7.2.x or 2.8.x) on all platforms. I also have perl 5.004_04
installed everywhere.

Here I describe my experience with BSDI (two versions), SunOS,
Solaris (two architectures), and Linux.

== Solaris ==

Under solaris 2.6 on sparc, the configuration was straightforward.
I used gcc 2.8.0 and /usr/ccs/bin/make to compile exim. I used
the following definitions for perl-related variables:

PERL_COMMAND=/usr/local/bin/perl5
EXIM_PERL=perl.o
PERL_CC        = `${PERL_COMMAND} -MConfig -e 'print $$Config{cc}'`
PERL_CCOPTS    = `${PERL_COMMAND} -MExtUtils::Embed -e ccopts`
PERL_LIBS    = `${PERL_COMMAND} -MExtUtils::Embed -e ldopts`


I couldn't use "$(shell command)", because it works with gmake
only. The resulting exim binary was perfectly well linked with
libperl and other libraries. Here is the output of ldd:

sol2:/vol/src/Mail/exim/exim-2.053$ ldd build-SunOS5-5.6-sparc/exim
    libsocket.so.1 =>     /usr/lib/libsocket.so.1
    libnsl.so.1 =>     /usr/lib/libnsl.so.1
    libkstat.so.1 =>     /usr/lib/libkstat.so.1
    libresolv.so.2 =>     /usr/lib/libresolv.so.2
    libperl.so =>     /usr/local/lib/perl5/sun4-solaris/5.00404/CORE/libperl.so
    libdl.so.1 =>     /usr/lib/libdl.so.1
    libm.so.1 =>     /usr/lib/libm.so.1
    libc.so.1 =>     /usr/lib/libc.so.1
    libmp.so.2 =>     /usr/lib/libmp.so.2


I used exactly the same configuration under Solaris 2.6 on i386
(or i86pc, as they call it), and got almost the same results from
ldd(1).

== BSDI ==

We have both BSDI 3.1 and BSDI 4.0 here. Under BSDI 4.0, I had a
problem with libperl.so, resulting from the way in which GNU
ld(1) handles shared libraries when linking ELF binaries. When
linking against various libraries, ld uses the -L flag to
determine in which directories the shared libraries reside, but
it needs to be given the -rpath flag to insert the given library
to the runtime library path. So here is the configuration I used
for BSDI:

PERL_COMMAND=/usr/local/bin/perl5

EXIM_PERL=perl.o

PERL_CC        != ${PERL_COMMAND} -MConfig -e 'print $$Config{cc}'
PERL_CCOPTS    != ${PERL_COMMAND} -MExtUtils::Embed -e ccopts
PERL_LIBS_TMP    != ${PERL_COMMAND} -MExtUtils::Embed -e ldopts
PERL_LIBS    =


bsdosver    != uname -r
.if ${bsdosver} >= 4.0
PERL_LIBS    = ${PERL_LIBS_TMP:M-L*:S/^-L/-Wl,-rpath,/g}
.endif
PERL_LIBS    += ${PERL_LIBS_TMP}


Notes:

1. The "!=" in BSD make means that the variables must be expanded
and the command must be run, the output of which will be placed
in the variable.

2. As I said before, only BSDI 4.0 has ELF. On BSDI 3.1, I used
gcc (as opposed to shlicc or shlicc2) to compile exim, so I
got statically-linked binary.

3. On the other hand, on BSDI 3.1, the PERL_CC becomes "shlicc2".
So perl.o gets compiled with this compiler. But it doesn't
really matter. On BSD 4.0, PERL_CC is "gcc".

4. This line looks cryptic:
    PERL_LIBS    = ${PERL_LIBS_TMP:M-L*:S/^-L/-Wl,-rpath,/g}
   It depends heavily on BSD make.  It means the following:
    a. Take ${PERL_LIBS_TMP}.
    b. Select every word which starts with -L (the "M-L*"
       bit).  Other words are just thrown off (so we don't
       have "-lperl" two times in the command line).
    c. Then, in every word, substitute -L in the beginning of
       the word with "-Wl,-rpath," (which means that I'm
       getting something like "-Wl,-rpath,/some/dir", so gcc
       passes the arguments "-rpath /some/dir" to ld).


5. The first "PERL_LIBS =" line was just to empty PERL_LIBS, just
in case it's set (which shouldn't happen, but there are too
many cases in history when /* CAN'T HAPPEN */ blocks were
actually executed).

== SunOS ==

Now, SunOS 4.1.4 make(1) doesn't understand the "!=" construct.
It doesn't understand $(shell ...), either. Seems like only the
4.4BSD (and, maybe, 4.3BSD) make knows about "!=". So I was
forced to use backquotes. But the configuration was pretty easy.

I needed to change one thing, though: to add to the file
OS/os.h-SunOS4 the following line (Philip, note):

#define EX_CONFIG 78

== Linux ==

On Linux (RedHat 5.1 (Sorry guys, it wasn't me who installed
DeadRat!)), we have no shared version of libperl, only libperl.a.
So the configuration was pretty much straightforward. I used
$(shell ...) construct for the PERL_* variables.

== End ==

A suggestion: maybe it would be nice to use ${PERL_COMMAND} when
defining the three PERL_* variables in Local/Makefile (a.k.a.
src/EDITME) instead of perl or perl5? On some platforms here, for
example, perl os perl4, and perl5 is known only under the name
perl5. On others, perl5 is known under both names. On yet
others, there's perl only, which is version 5 (no perl5 binary).
So just changing ${PERL_COMMAND} on different platforms seems
logical. Well, backquotes, $(shell ...) and !=, too...

Vadik.

-- 
It was state of the art, he said.
The art in this case was probably pottery.
    -- Terry Pratchett and Neil Gaiman, "Good Omens"


--
*** Exim information can be found at http://www.exim.org/ ***