Bug 1191098

Summary: cannot build openldap package: Unknown Berkeley DB major version in db.h
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: openldapAssignee: Jan Synacek <jsynacek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jsynacek, jv+fedora, phracek, praiskup, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openldap-2.4.40-9.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 11:35:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1190645    

Description Jan Synacek 2015-02-10 12:54:05 UTC
Description of problem:
The configure script returns "Unknown Berkeley DB major version in db.h" for some reason.

Nothing in this regard has changed in libdb recently, db.h from F21 and from rawhide are identical. Also, nothing has changed in openldap's configure since the last build (Jan 27, 2015: http://koji.fedoraproject.org/koji/buildinfo?buildID=606939). I suspect this to be some weirdness in the autoconf machinery, but I need to investigate this a bit more.


Steps to Reproduce:
1. Try mockbuild (or regular build) of openldap for Fedora Rawhide


Actual results:
checking for db.h... yes
checking for Berkeley DB major version in db.h... none
configure: error: Unknown Berkeley DB major version in db.h


Expected results:
checking for db.h... yes
checking for Berkeley DB major version in db.h... 5
checking for Berkeley DB minor version in db.h... 3

Comment 1 Jan Synacek 2015-02-10 12:55:45 UTC
Pavel, does this look familiar? Have there been any changes recently in the autotools chain? I'm not even sure how to debug this...

Comment 2 Pavel Raiskup 2015-02-10 16:49:14 UTC
Sorry for the delay, my IMAP reader was KO.
Grepping says it is OL_BDB_HEADER_VERSION macro.  Isn't this related to gcc
update to 5.0.0?  The check is done via 'cc -E conftest.c', conftest.c
contains (something like):

  #include <db.h>
  #ifndef DB_VERSION_MAJOR
  #       define DB_VERSION_MAJOR 1
  #endif
  __db_version DB_VERSION_MAJOR

Using cpp conftest.c with slightly modified lines:

  #include <db.h>
  __db_version (DB_VERSION_MAJOR)

shows that new you can not simply grep for __db_version now, output:
                                           )
  # 2 "conftest.c"
  __db_version (
  # 2 "conftest.c" 3 4
               5
  # 2 "conftest.c"
                               )

Pavel

Comment 3 Jan Synacek 2015-02-11 09:27:55 UTC
Hmm, I didn't find anything related to this among the GCC 5 changes. Running cpp with the -P option seems to fix things, thanks!

Comment 4 Pavel Raiskup 2015-02-11 11:14:34 UTC
Yep, and making it extra portable, probably checking for '-P' option presence
should precede actual 'cc -E' call.