# Compile net-www/apache-1.3.33-r2 fails on mod_rewrite

## hassler

I'm getting the following errors on mod_rewrite when trying to compile apache-1.3.33-r2:

```

mod_rewrite.c: In function `lookup_map_dbmfile':

mod_rewrite.c:3037: error: `DBM' undeclared (first use in this function)

mod_rewrite.c:3037: error: (Each undeclared identifier is reported only once

mod_rewrite.c:3037: error: for each function it appears in.)

mod_rewrite.c:3037: error: `dbmfp' undeclared (first use in this function)

mod_rewrite.c:3038: error: `datum' undeclared (first use in this function)

mod_rewrite.c:3038: error: syntax error before "dbmkey"

mod_rewrite.c:3046: error: `dbmkey' undeclared (first use in this function)

mod_rewrite.c:3049: error: `dbmval' undeclared (first use in this function)

gcc -shared  -o mod_auth_anon.so mod_auth_anon.lo -L/usr/lib -lm -lcrypt -ldb-4.1 -lmm -lexpat -lgdbm -lgdbm_compat -lpthread

make[4]: *** [mod_rewrite.so] Error 1

make[4]: *** Waiting for unfinished jobs....

make[3]: *** [all] Error 1

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/var/tmp/portage/apache-1.3.33-r2/work/apache_1.3.33/src'

make[1]: *** [build-std] Error 2

make[1]: Leaving directory `/var/tmp/portage/apache-1.3.33-r2/work/apache_1.3.33'

make: *** [build] Error 2

!!! ERROR: net-www/apache-1.3.33-r2 failed.

!!! Function src_compile, Line 123, Exitcode 2

!!! problem compiling apache

!!! If you need support, post the topmost build error, NOT this status message.

```

What am I missing?

----------

## fctk

have you checked: https://bugs.gentoo.org/ ?

----------

## lythander

I'm seeing the same error, both with r2, and now with r4.  Anyone have any thoughts?

----------

## neerolyte

I'm getting this with net-www/apache-1.3.33-r4 as well.

----------

## neerolyte

An error we all seemed to have missed:

```
In file included from mod_rewrite.c:50:

mod_rewrite.h:90:18: ndbm.h: No such file or directory
```

Perhaps this helps?

----------

## xavan

Same problem for me on AMD64 platform.

----------

## trooper_ryan

I'm getting the same with apache-1.3.33-r10.

```
gcc -c  -I../../os/unix -I../../include  -O2 -march=pentium4 -fomit-frame-pointer -DHARD_SERVER_LIMIT=512               -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX=22 -DTARGET=\"apache\" -DHAVE_SET_DUMPABLE -I/usr/include/db4.2 -DDEV_RANDOM=/dev/random -DUSE_HSREGEX -DEAPI -DEAPI_MM `../../apaci` -fpic -DSHARED_MODULE mod_auth_dbm.c && mv mod_auth_dbm.o mod_auth_dbm.lo

mod_rewrite.c: In function `lookup_map_dbmfile':

mod_rewrite.c:3037: error: `DBM' undeclared (first use in this function)

mod_rewrite.c:3037: error: (Each undeclared identifier is reported only once

mod_rewrite.c:3037: error: for each function it appears in.)

mod_rewrite.c:3037: error: `dbmfp' undeclared (first use in this function)

mod_rewrite.c:3038: error: `datum' undeclared (first use in this function)

mod_rewrite.c:3038: error: syntax error before "dbmkey"

mod_rewrite.c:3046: error: `dbmkey' undeclared (first use in this function)

mod_rewrite.c:3049: error: `dbmval' undeclared (first use in this function)

make[4]: *** [mod_rewrite.so] Error 1

make[4]: *** Waiting for unfinished jobs....

gcc -shared  -o mod_auth_dbm.so mod_auth_dbm.lo -L/usr/lib -lm -lcrypt -ldb-4.2 -lmm -lexpat -lgdbm -lgdbm_compat -lpthread

make[4]: *** Waiting for unfinished jobs....

make[3]: *** [all] Error 1

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/var/tmp/portage/apache-1.3.33-r10/work/apache_1.3.33/src'

make[1]: *** [build-std] Error 2

make[1]: Leaving directory `/var/tmp/portage/apache-1.3.33-r10/work/apache_1.3.33'

make: *** [build] Error 2

!!! ERROR: net-www/apache-1.3.33-r10 failed.

!!! Function src_compile, Line 124, Exitcode 2

!!! problem compiling apache

!!! If you need support, post the topmost build error, NOT this status message.
```

----------

## Jens Gutzeit

You need to install sys-libs/db-1.85

The 4.x Version has a different API.

----------

## yarick

Running 2005.1 with this emerge line

ACCEPT_KEYWORDS="~x86" emerge apache openssh mod_ssl mysql mod_php mod_perl libxml2 tiff lame bison cvs

HAS ANYONE BEEN ABLE TO RESOLVE THIS PROBLEM ?

In file included from mod_rewrite.c:50:

mod_rewrite.h:90:18: ndbm.h: No such file or directory

mod_rewrite.c: In function `lookup_map_dbmfile':

mod_rewrite.c:3037: error: `DBM' undeclared (first use in this function)

mod_rewrite.c:3037: error: (Each undeclared identifier is reported only once

mod_rewrite.c:3037: error: for each function it appears in.)

mod_rewrite.c:3037: error: `dbmfp' undeclared (first use in this function)

mod_rewrite.c:3038: error: `datum' undeclared (first use in this function)

mod_rewrite.c:3038: error: syntax error before "dbmkey"

mod_rewrite.c:3046: error: `dbmkey' undeclared (first use in this function)

mod_rewrite.c:3049: error: `dbmval' undeclared (first use in this function)

make[4]: *** [mod_rewrite.so] Error 1

make[3]: *** [all] Error 1

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/var/tmp/portage/apache-1.3.33-r10/work/apache_1.3.33/src'

make[1]: *** [build-std] Error 2

make[1]: Leaving directory `/var/tmp/portage/apache-1.3.33-r10/work/apache_1.3.33'

make: *** [build] Error 2

!!! ERROR: net-www/apache-1.3.33-r10 failed.

!!! Function src_compile, Line 124, Exitcode 2

!!! problem compiling apache

!!! If you need support, post the topmost build error, NOT this status message.

----------

## adam_aus

 *Jens Gutzeit wrote:*   

> You need to install sys-libs/db-1.85
> 
> The 4.x Version has a different API.

 

I can confirm this worked for me. I have db-4.2.52_p2 installed, and added 1.85-r2 in a new slot, and Apache has now compiled without problems.

----------

## didi666

I just stumbled upon the same problem. This bug is already assigned under

https://bugs.gentoo.org/show_bug.cgi?id=95140

(there is also 2 workarounds described in this link).

----------

