www/apache22 compilation error

Hi,

I get this error when I try to compile www/apache22 from ports:

Code:
Making all in prefork
/usr/local/share/apr/build-1/libtool --silent --mode=compile cc -O2 -pipe -I/usr/include -fno-strict-aliasing -g -I/usr/local/include  -O2 -pipe -I/usr/include -fno-strict-aliasing      -I. -I/usr/por
ts/www/apache22/work/httpd-2.2.22/os/unix -I/usr/ports/www/apache22/work/httpd-2.2.22/server/mpm/prefork -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/http -I/usr/ports/www/apache22/work/httpd-2
.2.22/modules/filters -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/proxy -I/usr/ports/www/apache22/work/httpd-2.2.22/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/generators -I/us
r/ports/www/apache22/work/httpd-2.2.22/modules/mappers -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/database -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/local/include/db42 -I/usr/por
ts/www/apache22/work/httpd-2.2.22/modules/proxy/../generators -I/usr/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/ssl -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/dav/main -prefe
r-non-pic -static -c prefork.c && touch prefork.lo
prefork.c: In function 'child_main':
prefork.c:506: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c:506: error: (Each undeclared identifier is reported only once
prefork.c:506: error: for each function it appears in.)
prefork.c:510: error: 'ap_accept_lock_mech' undeclared (first use in this function)
prefork.c: In function 'ap_mpm_run':
prefork.c:943: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c:948: error: 'ap_accept_lock_mech' undeclared (first use in this function)
prefork.c:1039: error: too few arguments to function 'ap_wait_or_timeout'
prefork.c:1125: error: too few arguments to function 'ap_reclaim_child_processes'
prefork.c:1168: error: too few arguments to function 'ap_relieve_child_processes'
prefork.c:1196: error: too few arguments to function 'ap_relieve_child_processes'
prefork.c:1264: error: too few arguments to function 'ap_reclaim_child_processes'
prefork.c: In function 'prefork_pre_config':
prefork.c:1341: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c: At top level:
prefork.c:1483: error: 'UNIX_DAEMON_COMMANDS' undeclared here (not in a function)
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/www/apache22.
*** Error code 1

Stop in /usr/ports/www/apache22.

I have no idea what the problem might be. Does anyone have a clue?
 
Try
Code:
# cd /usr/ports/www/apache22
# make clean rmconfig-recursive
# make install clean
Let me know what happens...
 
Do you have any CFLAGS in /etc/make.conf? If so, remove them.
 
No I don't have any CFLAGS in /etc/make.conf

It's strange, I was trying to disable a couple of modules to see if that was the problem so I disabled every module and after that I got the error below. But I don't know if it was when disabled every module or if it was after I updated the ports tree. I've deleted the ports tree 2-3 times and re-downloaded it but I still get the same error.

Code:
[root@mail /usr/ports/www/apache22]# make config
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTH_BASIC})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTH_DIGEST})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_FILE})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_DBD})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_DBM})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_ANON})
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_DEFAULT})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHN_ALIAS})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_HOST})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_GROUPFILE})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_USER})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_DBM})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_OWNER})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MAUTHZ_DEFAULT})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MCACHE})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MDISK_CACHE})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MFILE_CACHE})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MMEM_CACHE})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MDAV})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MDAV_FS})
"/usr/ports/Mk/bsd.apache.mk", line 475: if-less else
"/usr/ports/Mk/bsd.apache.mk", line 477: if-less endif
"/usr/ports/Mk/bsd.apache.mk", line 468: Malformed conditional (${APACHE_MODULES:MBUCKETEER})
..........cut of a couple of thousand lines..........
"/usr/ports/Mk/bsd.port.mk", line 2049: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 6452: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 6455: if-less endif
make: fatal errors encountered -- cannot continue

I'm going crazy here..
 
I'm running 9.0-RELEASE 64-bit. Yeah I thought something might have been corrupted in the Make-files so I did this just to be sure I got a fresh tree:

[CMD="rm"]/var/db/portsnap/tag
rm -rf /var/db/portsnap/files
rm -rf /usr/ports
portsnap fetch extract
[/CMD]

I've updated the ports tree like a hundred times too but I still get the same error.

[CMD="portsnap"]fetch update[/CMD]
 
Wow, I found DutchDaemon's portupdater script. I ran it and now errors about the Make-files disappeared. However I still get the same error when trying to compile www/apache22:

Code:
===>  Building for apache-2.2.22_6
Making all in srclib
Making all in os
Making all in unix
/usr/local/share/apr/build-1/libtool --silent --mode=compile cc -O2 -pipe -I/usr/include -fno-strict-aliasing -g -I/usr/local/include  -O2 -pipe -I/usr/include -fno-strict-aliasing      -I. -I/usr/ports/www/apache22/work/httpd-2.2.22/os/unix -I/usr/ports/www/apache22/work/httpd-2.2.22/server/mpm/prefork -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/http -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/filters -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/proxy -I/usr/ports/www/apache22/work/httpd-2.2.22/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/generators -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/mappers -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/database -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/local/include/db42 -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/proxy/../generators -I/usr/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/ssl -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/dav/main -prefer-non-pic -static -c unixd.c && touch unixd.lo
/usr/local/share/apr/build-1/libtool --silent --mode=link cc -O2 -pipe -I/usr/include -fno-strict-aliasing -g -I/usr/local/include  -O2 -pipe -I/usr/include -fno-strict-aliasing   -pthread -rpath=/usr/lib:/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/local/lib/db42  -pthread -rpath=/usr/lib:/usr/local/lib -L/usr/lib -o libos.la -static  unixd.lo  
Making all in server
Making all in mpm
Making all in prefork
/usr/local/share/apr/build-1/libtool --silent --mode=compile cc -O2 -pipe -I/usr/include -fno-strict-aliasing -g -I/usr/local/include  -O2 -pipe -I/usr/include -fno-strict-aliasing      -I. -I/usr/ports/www/apache22/work/httpd-2.2.22/os/unix -I/usr/ports/www/apache22/work/httpd-2.2.22/server/mpm/prefork -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/http -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/filters -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/proxy -I/usr/ports/www/apache22/work/httpd-2.2.22/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/generators -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/mappers -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/database -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/local/include/db42 -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/proxy/../generators -I/usr/include -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/ssl -I/usr/ports/www/apache22/work/httpd-2.2.22/modules/dav/main -prefer-non-pic -static -c prefork.c && touch prefork.lo
prefork.c: In function 'child_main':
prefork.c:506: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c:506: error: (Each undeclared identifier is reported only once
prefork.c:506: error: for each function it appears in.)
prefork.c:510: error: 'ap_accept_lock_mech' undeclared (first use in this function)
prefork.c: In function 'ap_mpm_run':
prefork.c:943: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c:948: error: 'ap_accept_lock_mech' undeclared (first use in this function)
prefork.c:1039: error: too few arguments to function 'ap_wait_or_timeout'
prefork.c:1125: error: too few arguments to function 'ap_reclaim_child_processes'
prefork.c:1168: error: too few arguments to function 'ap_relieve_child_processes'
prefork.c:1196: error: too few arguments to function 'ap_relieve_child_processes'
prefork.c:1264: error: too few arguments to function 'ap_reclaim_child_processes'
prefork.c: In function 'prefork_pre_config':
prefork.c:1341: error: 'ap_lock_fname' undeclared (first use in this function)
prefork.c: At top level:
prefork.c:1483: error: 'UNIX_DAEMON_COMMANDS' undeclared here (not in a function)
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/www/apache22.
*** Error code 1

Stop in /usr/ports/www/apache22.
 
Is there anything else in /etc/make.conf that might interfere?
 
This is what I have in my /etc/make.conf:

Code:
CLAMAVUSER=vscan
CLAMAVGROUP=vscan
DEFAULT_MYSQL_VER=55
# added by use.perl 2012-08-20 14:49:22
PERL_VERSION=5.12.4

Starting to think I might use some other http server instead.
 
Code:
===> The following configuration options are available for apr-ipv6-devrandom-gdbm-db42-1.4.5.1.3.12_1:
     THREADS=on: Threading support
     IPV6=on: IPv6 support
     DEVRANDOM=on: Use /dev/random or compatible
     BDB=on: Berkeley DB support
     GDBM=on: GNU dbm support
     LDAP=off: LDAP support
     MYSQL=off: MySQL backend
     NDBM=off: NDBM support
     PGSQL=off: PostgreSQL backend
     SQLITE=off: SQLite backend
===> Use 'make config' to modify these settings
 
The only difference from mine is IPv6, which should not be a problem. Are you cleaning the directory before trying to rebuild?
# make clean
# make
 
Yes, I always clean if I know there's been a problem with the compilation. I don't get why it starting behaving like this all of the sudden. I was just upgrading like this:

# portsnap fetch update
# portmaster -a

Like I always do and then I got that error.
 
Is there some easy way to get all the "configure" flags that are being used? I tried to download and compile from source manually, without any configure-flags, and it worked just fine. So I was thinking I'd try to compile with the exact same flags that are used when compiling from ports.
 
I've narrowed it down to devel/pcre being the problem. As soon as I configure with --with-pcre I get the exact same error message. I'm going to look around a little bit more and see if I can find a solution, but if you know something I can try feel free to post.
 
wblock@ said:
% less -p20120214 /usr/ports/UPDATING

Yeah I was Just reading that when I found out that pcre was the problem.. But what should I do now? I've already upgraded without the:# portmaster -w devel/pcre
I have also recompiled it a couple of times and deinstalled it. Right now I have the latest from ports pcre-8.31.

Is there a way to install the version before the change and then update properly? Or should I do something else?
 
Install sysutils/bsdadminscripts and run pkg_libchk. It will detect missing libraries, and anything missing a library should be rebuilt. Preferably, use portmaster to rebuild all of them at the same time so it goes in the correct order.

Another method is to force-rebuild everything that depends on pcre:
# portmaster -r pcre
 
Ok, so just to be clear when I couldn't get Apache compiling I installed it with:
# pkg_add -r apache22
it works fine and I got my webserver running, although I need some other modules that are not compiled in that package. I ran pkg_libchk and got this output:

Code:
apache-2.2.21: /usr/local/sbin/ab misses libpcre.so.0                     
apache-2.2.21: /usr/local/sbin/checkgid misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/htcacheclean misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/htdbm misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/htdigest misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/htpasswd misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/httpd misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/httxt2dbm misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/logresolve misses libpcre.so.0
apache-2.2.21: /usr/local/sbin/rotatelogs misses libpcre.so.0

That's the only thing I got, and there's only libpcre.so.1 and a symlink to libpcre.so

I ran # portmaster -r pcre just to be on the safe side but still gets the same error. Also when I try to compile www/apache22 I see this:

Code:
apache-2.2.22_6 depends on shared library: pcre - found
But it still acts like it can't find it when compiling?.. Can I maybe specify a flag specifying where pcre is when I run make? I'm just guessing here but that might help?

I also tried to make a symlink to libpcre.so.0 but it didn't help the compilation, but that might not be the right way to do it?
 
It's not a problem with Apache, but something it needs. Remove any symlinks you've created, and use pkg_info(1) to find out the packages on which Apache depends:
Code:
% pkg_info -r apache-2.2.22_6 
Information for apache-2.2.22_6:

Depends on:
Dependency: expat-2.0.1_2
Dependency: perl-5.12.4_4
Dependency: pcre-8.31
Dependency: gdbm-1.9.1
Dependency: db42-4.2.52_5
Dependency: libiconv-1.14
Dependency: apr-devrandom-gdbm-db42-1.4.5.1.3.12_1

Then rebuild all of those by giving them as a list to portmaster.
 
I got the same dependencies as you did so I ran:
# portmaster devel/pcre devel/apr1 textproc/expat2 lang/perl5.12 databases/gdbm databases/db42 converters/libiconv
I've already re-built pretty much every port I have installed by now and nothing makes a difference. I still get the same annoying error message.. And pkg_libchk still says that libpcre.so.0 is missing. Is it devel/pcre that are messing things up? I've re-installed it a couple of times and I haven't made any weird symlinks or anything, I just tried the one I said in the previous post and removed it right after.

I don't know if this might have anything to do with this but I've noticed when I've re-installed a couple of ports that some ports wants lang/perl5.12 and some lang/perl5.14, I have 5.12 installed.
 
Back
Top