Thread: Configure can't find com_err on OpenBSD for --with-krb5

Configure can't find com_err on OpenBSD for --with-krb5

From
Jim Rosenberg
Date:
I am trying to build PostgreSQL 8.2.3 on OpenBSD 4.0. When I give the
command

./configure -v --with-openssl --with-krb5
--with-includes=/usr/include/kerberosV

I get:

checking for library containing com_err... no
configure: error: could not find function 'com_err' required for Kerberos 5

This is puzzling, because com_err.o is clearly listed in libkrb5.a. Any
thoughts on how to get this to build would be appreciated.

-Thanks, Jim

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Tom Lane
Date:
Jim Rosenberg <jr@amanue.com> writes:
> I am trying to build PostgreSQL 8.2.3 on OpenBSD 4.0. When I give the
> command

> ./configure -v --with-openssl --with-krb5
> --with-includes=/usr/include/kerberosV

> I get:

> checking for library containing com_err... no
> configure: error: could not find function 'com_err' required for Kerberos 5

Perhaps you need a --with-libs switch too?  Usually, if the package
didn't put its include files right in /usr/include, it likely didn't
put the libraries right in /usr/lib either.

            regards, tom lane

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Jim Rosenberg
Date:
--On Saturday, March 3, 2007 11:24 PM -0500 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

>> I am trying to build PostgreSQL 8.2.3 on OpenBSD 4.0. When I give the
>> command
>
>> ./configure -v --with-openssl --with-krb5
>> --with-includes=/usr/include/kerberosV
>
>> I get:
>
>> checking for library containing com_err... no
>> configure: error: could not find function 'com_err' required for
>> Kerberos 5
>
> Perhaps you need a --with-libs switch too?  Usually, if the package
> didn't put its include files right in /usr/include, it likely didn't
> put the libraries right in /usr/lib either.

Hmm. libkrb5 is in /usr/lib -- with all the rest of the libs -- not
somewhere special.

I also have /usr/lib/libcom_err.a too, and it seems to have com_err.o also.
Putting in an explicit

./configure --with-openssl --with-krb5
--with-includes=/usr/include/kerberosV
--with-libs=/usr/lib

(sorry for the word wrap) doesn't help.

The "standard" PostgreSQL port that OpenBSD wants to make is (alas) 8.1.8.

-Thanks, Jim

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Tom Lane
Date:
Jim Rosenberg <jr@amanue.com> writes:
> --On Saturday, March 3, 2007 11:24 PM -0500 Tom Lane <tgl@sss.pgh.pa.us>
> wrote:
>> Perhaps you need a --with-libs switch too?

> Hmm. libkrb5 is in /usr/lib -- with all the rest of the libs -- not
> somewhere special.

OK, then the next likely answer is that there's something odd about the
library dependencies for libkrb5.  You need to look at the config.log
output to see exactly what configure tried to do and what error it got.
The "can't find" message really means that it couldn't link a program
that tries to call com_err, and there are any number of possible reasons
for that.

            regards, tom lane

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Stefan Kaltenbrunner
Date:
Jim Rosenberg wrote:
> --On Saturday, March 3, 2007 11:24 PM -0500 Tom Lane <tgl@sss.pgh.pa.us>
> wrote:
>
>>> I am trying to build PostgreSQL 8.2.3 on OpenBSD 4.0. When I give the
>>> command
>>
>>> ./configure -v --with-openssl --with-krb5
>>> --with-includes=/usr/include/kerberosV
>>
>>> I get:
>>
>>> checking for library containing com_err... no
>>> configure: error: could not find function 'com_err' required for
>>> Kerberos 5
>>
>> Perhaps you need a --with-libs switch too?  Usually, if the package
>> didn't put its include files right in /usr/include, it likely didn't
>> put the libraries right in /usr/lib either.
>
> Hmm. libkrb5 is in /usr/lib -- with all the rest of the libs -- not
> somewhere special.
>
> I also have /usr/lib/libcom_err.a too, and it seems to have com_err.o
> also. Putting in an explicit
>
> ./configure --with-openssl --with-krb5
> --with-includes=/usr/include/kerberosV
> --with-libs=/usr/lib


FWIW - we have a buildfarm box running OpenBSD 4.0/AMD64 - and it is
using the following configuration:

http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=zebra&dt=2007-03-02%2013:18:04

I vaguely remember I had some kerberos-related issues too when I set up
that box but the above configuration is working :-)

Stefan

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Jim Rosenberg
Date:
--On Sunday, March 4, 2007 12:40 AM -0500 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

> You need to look at the config.log output to see exactly what configure
> tried to do and what error it got.

Thanks, Tom, this was helpful!!

Here's the problem: when configure tries to compile the code snippet to
check for com_err, it needs to do this with -lcrypto added, but it's not
using that. What's the "right" way to fix this? I could probably get it to
work by brutally hacking configure, but there's got to be a better way.

-Thanks, Jim

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Tom Lane
Date:
Jim Rosenberg <jr@amanue.com> writes:
> Here's the problem: when configure tries to compile the code snippet to
> check for com_err, it needs to do this with -lcrypto added, but it's not
> using that. What's the "right" way to fix this? I could probably get it to
> work by brutally hacking configure, but there's got to be a better way.

I think the "right" fix is probably to add -lcrypto to these lines in
configure.in, which are already accounting for random other possible
dependencies of libkrb5:

     AC_SEARCH_LIBS(com_err, [krb5 'krb5 -ldes -lasn1 -lroken' com_err], [],
                    [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
     AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -ldes -lasn1 -lroken'], [],
                    [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])

but I'm not sure why no one else would've complained before, if that
were necessary...

            regards, tom lane

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Bruce Momjian
Date:
Tom Lane wrote:
> Jim Rosenberg <jr@amanue.com> writes:
> > Here's the problem: when configure tries to compile the code snippet to
> > check for com_err, it needs to do this with -lcrypto added, but it's not
> > using that. What's the "right" way to fix this? I could probably get it to
> > work by brutally hacking configure, but there's got to be a better way.
>
> I think the "right" fix is probably to add -lcrypto to these lines in
> configure.in, which are already accounting for random other possible
> dependencies of libkrb5:
>
>      AC_SEARCH_LIBS(com_err, [krb5 'krb5 -ldes -lasn1 -lroken' com_err], [],
>                     [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
>      AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -ldes -lasn1 -lroken'], [],
>                     [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
>
> but I'm not sure why no one else would've complained before, if that
> were necessary...

Where are we on this?

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: Configure can't find com_err on OpenBSD for --with-krb5

From
Jim Rosenberg
Date:
>>      AC_SEARCH_LIBS(com_err, [krb5 'krb5 -ldes -lasn1 -lroken' com_err],
>>      [], [AC_MSG_ERROR([could not find function 'com_err' required for
>>                     Kerberos 5])]) AC_SEARCH_LIBS(krb5_sendauth, [krb5
>>      'krb5 -ldes -lasn1 -lroken'], [], [AC_MSG_ERROR([could not find
>>                     function 'krb5_sendauth' required for Kerberos 5])])
>>
>> but I'm not sure why no one else would've complained before, if that
>> were necessary...
>
> Where are we on this?

A thousand apologies, I never posted back my results. I got it to build by
hacking configure as per the attached patch. Notice I don't have "roken" --
don't know what that is. -lroken should probably be patched a second place;
I only did it on the first one and it worked.

Alas, I haven't actually had a chance to see if Kereberos authentication
works, I only know this builds.

-Thanks, Jim

Attachment