OS: Solaris 11
Submission from: (NULL) (188.8.131.52)
openldap-2.4.35/servers/slapd/back-ldif root# cc -I/usr/local/include
-I../../../include -I../../../include -I.. -I./.. -I/usr/local/include -c ldif.c
"ldif.c", line 166: warning: no explicit type given
"ldif.c", line 166: syntax error before or at: ldifcfg
This happens because there is a /usr/local/include/config.h from libstdc++ which
is included before openldap-2.4.35/servers/slapd/config.h, according to the -I
include path order. The Makefile sets CFLAGS to "AC_CFLAGS DEFS". DEFS includes
XINCPATH which should precede AC_CFLAGS, not succeed it.
Either the order needs to be fixed, or more usefully config.h renamed to
To have configure work correctly, CPPFLAGS needs to be set to
"-I/usr/local/include" otherwise /usr/local/include isn't searched for db.h,
picks up /usr/include/db.h which is not the one it needs to link against.
+ print -r -- 'configure:20296: checking for Berkeley DB major version in db.h'
+ /bin/ggrep -E __db_version
+ eval '$CPP $CPPFLAGS conftest.c'
+ cc -E conftest.c
+ set X __db_version 5 none none
You can see it's only using CPP and CPPFLAGS in the eval command. Not CFLAGS
which has the path for the correct db.h to use. To fix that, CPPFLAGS also needs
to point to /usr/local/include.
I'm using these fixes to move past both problems and get a properly working
./configure --prefix=/usr/local \
mv servers/slapd/config.h servers/slapd/slapd_config.h
perl -pe 's#config.h#slapd_config.h#' -i servers/slapd/*.c
perl -pe 's#"config.h"#"slapd_config.h"#' -i