Re: [exim] cannot compile with DomainKeys

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: Chump Chumpster
CC: exim-users, Justin G.
Subject: Re: [exim] cannot compile with DomainKeys
On Thu, Apr 16, 2009 at 6:02 AM, Chump Chumpster <codechump@???> wrote:
> Thanks for your response. Yes I do have openssl & openssl-dev installed, as
> mentioned. I wonder if they're being picked up by the compiler. They were
> installed by yum, so they're were you would expect them for CentOS.
>
> Does anyone know how to explicitly express their locations in config? Thanks


This is what I did to make it work:

[tlyons@ivwww01 ~/src]$ diff -ruN libdomainkeys-0.69.orig/Makefile
libdomainkeys-0.69/Makefile
--- libdomainkeys-0.69.orig/Makefile    2006-01-17 16:28:58.000000000 -0800
+++ libdomainkeys-0.69/Makefile    2008-11-26 13:49:10.273984000 -0800
@@ -2,8 +2,9 @@
 CFLAGS=-DBIND_8_COMPAT -O2
 #CFLAGS += -DDK_DEBUG -DDK_HASH_BUFF -Wall
 #CFLAGS += -DUNIXWARE
-INCS=-I.
-LIBS=-L. -ldomainkeys -lcrypto
+CFLAGS += -fPIC
+INCS=-I. -I/usr/include
+LIBS=-L. -ldomainkeys -lcrypto -lresolv
 MAKE=make


 dktest: dktest.o libdomainkeys.a dns.lib socket.lib
@@ -47,6 +48,10 @@
     ar cr libdomainkeys.a domainkeys.o dns_txt.o dktrace.o
     ranlib libdomainkeys.a


+libdomainkeys.so: domainkeys.o dns_txt.o dktrace.o
+    rm -f libdomainkeys.so
+    ld -shared domainkeys.o dns_txt.o dktrace.o -lcrypto `cat dns.lib`
-o libdomainkeys.so
+
 python: domainkeys_wrap.o _domainkeys.so


 domainkeys_wrap.o: domainkeys.h domainkeys.i domainkeys_wrap.c
@@ -57,7 +62,7 @@
     ld -shared domainkeys.o dns_txt.o dktrace.o domainkeys_wrap.o
-lcrypto `cat dns.lib` -o _domainkeys.so


 clean:
-    rm -f *.o *.so libdomainkeys.a dns.lib dnstest socktest makeheader
dktest testtrace domainkeys.h
+    rm -f *.o *.so libdomainkeys.a libdomainkeys.so dns.lib dnstest
socktest makeheader dktest testtrace domainkeys.h


#
distributionfile:


To build it, I put the libdomainkey.so to be in someplace that the
linker could find it, and told exim about it:
echo "LDFLAGS += -ldomainkeys" >> Local/Makefile

Then I built it.

After installing exim, I copied the libdomainkeys.so to $LIB/exim and
can verify that it's seen by the exim binary:
CentOS52[root@ivwm51 ~]# ldd /usr/sbin/exim | egrep 'domainkeys|dkim'
    libdomainkeys.so => /usr/lib64/exim/libdomainkeys.so (0x00002ae197a6f000)
    libdkim.so => /usr/lib64/exim/libdkim.so (0x00002ae197c75000)


Truth be told, I modified an exim spec file for 4.69-7 from fc10 to
build a CentOS 5.2 rpm with dk/dkim support using the shared library
method I described above.
-- 
Regards...      Todd