Issue 7790 - config.h filename clash. include path broken.
Summary: config.h filename clash. include path broken.
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.35
Hardware: All All
: --- normal
Target Milestone: 2.5.2
Assignee: Quanah Gibson-Mount
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-23 14:09 UTC by mark@ibiblio.org
Modified: 2021-02-26 23:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mark@ibiblio.org 2014-01-23 14:09:17 UTC
Full_Name: Mark
Version: 2.4.35
OS: Solaris 11
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (203.63.89.15)


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
-o ldif.o
"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
slapd_config.h


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, it
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'
[...]
1> conftest.c
+ /bin/ggrep -E __db_version
+ eval '$CPP $CPPFLAGS conftest.c'
+ cc -E conftest.c
+ set X __db_version 5 none none
+ ol_cv_bdb_major=5

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
build:

    ./configure --prefix=/usr/local \
        --with-cyrus-sasl \
        --enable-bdb=yes \
        --enable-spasswd=yes \
        --enable-modules \
        --enable-wrappers \
        --enable-shared \
        --with-tls=openssl \
        ol_cv_berkeley_db_version=4.8.30
    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 servers/slapd/*/*.c
    gmake depend
    gmake
Comment 1 Quanah Gibson-Mount 2021-01-28 18:00:02 UTC
Rename to slap-config.h
Comment 2 Quanah Gibson-Mount 2021-02-03 16:03:56 UTC
Commits: 
  • 6c469f07 
by Quanah Gibson-Mount at 2021-02-02T21:26:39+00:00 
ITS#7790 - Rename config.h

Rename slapd/config.h to slap-config.h and update accordingly
Rename lloadd/config.h to lload-config.h and update accordingly
Comment 3 Quanah Gibson-Mount 2021-02-08 19:54:30 UTC
Further fixes for contrib modules:

https://git.openldap.org/openldap/openldap/-/merge_requests/222
Comment 4 Quanah Gibson-Mount 2021-02-09 18:28:35 UTC
Commits: 
  • 11e5ba23 
by Quanah Gibson-Mount at 2021-02-09T17:39:37+00:00 
ITS#7790 - Fix contrib modules for new header name