Subject: Re: Using pkgsrc's OpenSSL to compile squid
To: Sam Carleton <sam@linux-info.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 12/06/2002 10:17:37
On Fri, 6 Dec 2002, Sam Carleton wrote:

> I am trying to compile squid from the source.  I am NOT using the pkgsrc tool
> for this package.  I did use the pkgsrc tool for OpenSSL, though.  Now I am
> trying to figure out how to compile squid with ssl enabled.
>
> I used this to configure squid:
>
> ./configure --enable-ssl --with-openssl=/usr/pkg

If I read the configure script right, this just sets CPPFLAGS to
/usr/pkg/include (not to /usr/pkg/include/openssl/

> Then I am using this little script to run make:
>
> CPPFLAGS="-I/usr/local/include -I/usr/pkg/include -I/usr/pkg/include/openssl"
> LDFLAGS="-L/usr/local/lib -L/usr/pkg/lib"
> export CPPFLAGS
> export LDFLAGS
>
> make

The lib/Makefile appears to recreate those two variables.

Set those in the environment before you do the ./configure instead.

> The error I am getting is:
>
> source='rfc2617.c' object='rfc2617.o' libtool=no  depfile='.deps/rfc2617.Po' tmpdepfile='.deps/rfc2617.TPo'  depmode=gcc /bin/sh ../cfgaux/depcomp  gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I../include   -I/usr/pkg/include  -g -O2 -Wall -c `test -f rfc2617.c || echo './'`rfc2617.c
> In file included from rfc2617.c:52:
> ../include/md5.h:18: #error Cannot find OpenSSL headers
>
> Being a C/C++ windows programmer, I looked into the rfc2617.c file and
> found simply:
>
> #include "md5.h"

You could look in ../include/md5.h instead. But I guess that is
unimportant.

> It appeared that my -I/usr/pkg/include/openssl was not getting picked up
> from the command line.  I hacked the Makefile in the lib/ directory, but
> that didn't do any good either.
>
> Can someone enlighten me as to how to use the OpenSSL that I installed via
> the pkgsrc?

Did it really get installed to /usr/pkg/ ...?

Try setting your CPPFLAGS and LDFLAGS before you do the ./configure.

(Or build squid via pkgsrc.)

Good luck,

   Jeremy C. Reed
   http://bsd.reedmedia.net/