Thank you
It compiled and works brilliantly
Thanks and Regards
Godfrey
----- Original Message -----
From: "Phil Pennock" <exim-users@???>
To: "Godfrey" <eximlist@???>
Cc: <exim-users@???>
Sent: Monday, March 09, 2015 12:20 PM
Subject: Re: [exim] Building exim manually on Freebsd 10.1 AMD 64 ld: cannot
find -llber
> On 2015-03-09 at 11:56 +0200, Godfrey wrote:
>> I have had no problem building exim-4.85 manually. Before we get going I
>> can install exim-mysql from the ports, no issues and from pkg install -y
>> exim-mysql no issue
>
>> How ever on the freebsd 10.1 amd 64 version the following happens
>
> I use this platform.
>
>> after running make clean ; make makefile; make
>
>> gcc -o exim
>> /usr/local/bin/ld: cannot find -llber
>
> The `lber` library is part of OpenLDAP. The relevant part of the
> FreeBSD Port Makefile is:
> ----------------------------8< cut here >8------------------------------
> .if ${PORT_OPTIONS:MOPENLDAP}
> LDAP_LIB_TYPE= OPENLDAP2
> SEDLIST+= -e
> 's,XX_LDAP_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -llber -lldap,' \
> -e 's,XX_LDAP_INCLUDE_XX,-I${LOCALBASE:S/,/\\,/g}/include,'
> \
> -e 's,XX_LDAP_TYPE_XX,${LDAP_LIB_TYPE:S/,/\\,/g},' \
> -e 's,^\# (LOOKUP_LDAP=),\1,'
> .else
> SEDLIST+= -e 's,XX_LDAP_[^ ]*_XX,,' \
> -e 's,^(LDAP_LIB_TYPE=),\# \1,'
> .endif
> ----------------------------8< cut here >8------------------------------
>
> Those XX values come from applying files/patch-src__EDITME to Exim's
> source. The relevant lines are:
>
> +LDAP_LIB_TYPE=XX_LDAP_TYPE_XX
> +LOOKUP_INCLUDE=XX_MYSQL_INCLUDE_XX XX_PGSQL_INCLUDE_XX XX_LDAP_INCLUDE_XX
> +LOOKUP_LIBS=XX_MYSQL_LIBS_XX XX_PGSQL_LIBS_XX XX_LDAP_LIBS_XX
>
> So, when building manually, you need to put these in Local/Makefile:
>
> LDAP_LIB_TYPE=OPENLDAP2
> LOOKUP_INCLUDE=-I/usr/local/include
> LOOKUP_LIBS=-L/usr/local/lib -llber -lldap
>
> In particular, because OpenLDAP is not part of the base system, the
> libraries are not in the default ld(1) search path for linking the
> object files into the final binary. They're installed by Ports into
> /usr/local, so you need to use -I and -L to tell the compiler where they
> are.
>
>> Scratching around on google others have had the same problem and I tried
>> the following before coming asking for help.
>>
>> root@204.149 / # /usr/bin/ld -lsasl2
>> /usr/bin/ld: warning: cannot find entry symbol _start; not setting start
>> address
>> //lib/libc.so.7: undefined reference to `__progname'
>> //lib/libc.so.7: undefined reference to `environ'
>
> The `ld` program is the linker; it takes object files (from compilation)
> and libraries, figures out how to glue all the parts together and makes
> the executable program which you can then run. It needs a program to
> provide a main() function; if you only give it libraries, there is no
> main program and it can't figure out where execution should start. So
> the command-line which you tried is asking for something peculiar and
> the tool failed when it tried to do exactly what you asked for.
>
> The Exim build process will invoke ld for you, using various ${FOO}_LIBS
> or EXTRALIBS values as appropriate. In this case, LOOKUP_LIBS would be
> used.
>
>> I have also done the following
>> ln -s /usr/local/lib/libsasl2.so /usr/lib/libsasl2.so
>> ln -s /usr/local/bin/gcc48 /usr/local/bin/gcc
>
> Undo both of these.
>
> -Phil
>