SGI: Development

Compiling SquidGuard

Hi, I'm trying to compile squidGuard:

http://www.squidguard.org/index.html

with all dependencies (i.e. bison,flex, Berkeley db) from nekoware.

I use the following args:

./configure --libexecdir=/usr/nekoware/libexec --with-db=/usr/nekoware/bin/ --with-db-lib=/usr/nekoware/lib

and get the following:

checking for vsprintf... yes
checking for sigaction... yes
checking for signal... yes

** The Berkley DB library version 2.6.4 or newer
is required. Get it from http://www.sleepycat.com
use --with-db=DIR or --with-db-inc=DIR,
--with-db-lib=DIR to specify its location


Seems like it can't find it or doesn't recognise it.

Any suggestions?
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
Update...

Setting CC=cc rather than using the dreaded gcc completes the ./configure script without error, however, make now falls over with the following:


making all in squidGuard-1.2.0
making all in src
cc -I.. -I. -I. -I/usr/nekoware/bin/include -DHAVE_CONFIG_H -g -I/usr/nekoware/bin/include -c main.c
cc-1020 cc: ERROR File = sg.h, Line = 192
The identifier "DBC" is undefined.

DBC *dbcp;
^

cc-1020 cc: ERROR File = sg.h, Line = 193
The identifier "DB_ENV" is undefined.

DB_ENV *dbenv;
^

cc-1020 cc: ERROR File = sg.h, Line = 380
The identifier "DB_ENV" is undefined.

int db_init __P((char *, DB_ENV **));
^

cc-1178 cc: WARNING File = main.c, Line = 111
Argument is incompatible with the corresponding format string conversion.

fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version(NULL,NULL,NULL));
^

3 errors detected in the compilation of "main.c".
*** Error code 2 (bu21)
*** Error code 1 (bu21)
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
Hhmmm.

configure insists on using /usr/nekoware/bin/include.

I tried using :

#./configure --with-db=/usr/nekoware/bin --with-db-lib=/usr/nekoware/lib --includedir=/usr/nekoware/include


and even

#./configure --with-db=/usr/nekoware/bin --with-db-lib=/usr/nekoware/lib --includedir=/usr/nekoware/../include

still no go.

Checking configure itself, I see:
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
EOF


Notice the /bin in this line:

\`$ac_default_prefix/bin',

It has me stumped.
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
You have autoconf and automake installed and configured properly..?
$ac stuff in gnomeish or GNUish config stuff is sometimes autoconf related.
/usr/nekoware/share/aclocal on my system.

PM sent.

Regan
:Onyx2R: :Onyx2R: :0300: :0300: :0300: :O200: :Octane: :Octane: :O2: :O2: :Indigo2IMP: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x SUN, 2 x Mac, 3 x Alpha, 2 x RS/6000
Not to state the obvious but did you try using Gnu Make? [aka gmake] some stuff will not build with any other version of make.

-Mike
regan_russell wrote: You have autoconf and automake installed and configured properly..?


I have autoconf, but not automake.

I installed it and tried using gcc to configure, same error, can't find db.
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
mgtremaine wrote: Not to state the obvious but did you try using Gnu Make? [aka gmake] some stuff will not build with any other version of make.

-Mike


No, I haven't tried GNU Make.

Can't find it in nekoware, is it part of a larger package?
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
You have built and installed Berkley DB, right?
If not, follow the sleepycat link on your first post, unpack it and...

Code: Select all

cd build_unix ; ../dist/configure ; make

You might also want to look at using the _SGI_MP_SOURCE flag.

Can't find it in nekoware, is it part of a larger package?

neko_make-3.81.tardist

Hope this helps.

Regan
Yes I have built all dependencies;

autoconf, libtool, M4, perl db, bison, flex, etc.

They're all there, and they're all from nekoware.

I might have to set an environment variable somewhere???
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
mgtremaine wrote: Not to state the obvious but did you try using Gnu Make? [aka gmake] some stuff will not build with any other version of make.

-Mike


Thanks to regan_russell, I found and installed gmake. Unfortunately, it gives the same error:

#gmake
making all in squidGuard-1.2.0
gmake[1]: Entering directory `/pk_tmp/squidGuard-1.2.0/src'
making all in src
cc -I.. -I. -I. -I/usr/nekoware/bin/include -DHAVE_CONFIG_H -g -I/usr/nekoware/bin/include -c main.c
cc-1020 cc: ERROR File = sg.h, Line = 192
The identifier "DBC" is undefined.

DBC *dbcp;
^

cc-1020 cc: ERROR File = sg.h, Line = 193
The identifier "DB_ENV" is undefined.

DB_ENV *dbenv;
^

cc-1020 cc: ERROR File = sg.h, Line = 380
The identifier "DB_ENV" is undefined.

int db_init __P((char *, DB_ENV **));
^

cc-1178 cc: WARNING File = main.c, Line = 111
Argument is incompatible with the corresponding format string conversion.

fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version(NULL,NULL,NULL));
^

3 errors detected in the compilation of "main.c".
gmake[1]: *** [main.o] Error 2
gmake[1]: Leaving directory `/pk_tmp/squidGuard-1.2.0/src'
gmake: *** [all] Error 1
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
The software compiles with mipspro c99 with recent nekoware packages on my machine. Use the standard environment variables. What not worked out of the box is "gmake install" because it looks like the programm would installed under the uid "squid" which not exists by default.

Code: Select all

./configure --with-db=/usr/nekoware --prefix=/usr/nekoware-build
checking for db_version in -ldb... yes
....

[o2k]:/usr2/MIPS/squidGuard-1.2.0p3/src $ ldd squidGuard
libdb-4.4.so  =>         /usr/nekoware/lib/libdb-4.4.so
libc.so.1  =>    /usr/lib32/libc.so.1
libpthread.so  =>        /usr/lib32/libpthread.so


regards
Joerg
So how do you get past the "make" errors?

You must be doing something differently??
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
Spidy wrote: So how do you get past the "make" errors?

You must be doing something differently??


There are no make errors. I bet you get errors because the precompiler picks up wrong (old) db-x.h header.

Code: Select all

1. Setup your Environment
2. Check if all the needed Tools, Programms, Libs are installed
3. Run the ./configure
4. Run gmake
5. Install the stuff
5. Create a nekoware tardist.


regards
Joerg
Update.

I've managed to get the gcc compiler to run configure without error.

gmake still falls over with:

#gmake
making all in squidGuard-1.2.0
gmake[1]: Entering directory `/pk_tmp/squidGuard-1.2.0/src'
making all in src
gcc -I.. -I. -I. -I/usr/nekoware/include -DHAVE_CONFIG_H -g -O2 -I/usr/nekoware/include -c main.c
gcc -I.. -I. -I. -I/usr/nekoware/include -DHAVE_CONFIG_H -g -O2 -I/usr/nekoware/include -c sgLog.c
gcc -I.. -I. -I. -I/usr/nekoware/include -DHAVE_CONFIG_H -g -O2 -I/usr/nekoware/include -c sgDb.c
sgDb.c: In function `sgDbInit':
sgDb.c:101: warning: passing arg 2 of pointer to function from incompatible pointer type
sgDb.c:101: warning: passing arg 4 of pointer to function makes pointer from integer without a cast
sgDb.c:101: error: too few arguments to function
sgDb.c:107: warning: passing arg 2 of pointer to function from incompatible pointer type
sgDb.c:107: warning: passing arg 4 of pointer to function makes pointer from integer without a cast
sgDb.c:107: error: too few arguments to function
gmake[1]: *** [sgDb.o] Error 1
gmake[1]: Leaving directory `/pk_tmp/squidGuard-1.2.0/src'
gmake: *** [all] Error 1


Not really sure where to go from here.
Man is the only animal smart enough to build the Empire State Building, and the only one stupid enough to jump off it.
submit a bug report.
r-a-c.de