New BIND releases ... 9.16.4: build, 'fatal error: lmdb.h: No such file or directory'

PGNet Dev pgnet.dev at gmail.com
Thu Jun 18 17:25:59 UTC 2020


this

	configure.ac
		AC_MSG_CHECKING(for lmdb library)
		AC_ARG_WITH(lmdb,
		        AS_HELP_STRING([--with-lmdb[=PATH]],
		               [build with LMDB library [yes|no|path]]),
		    use_lmdb="$withval", use_lmdb="auto")

		have_lmdb=""
		case "$use_lmdb" in
		    no)
		        LMDB_LIBS=""
		        ;;
		    auto|yes)
		        for d in /usr /usr/local /opt/local
		        do
		            if test -f "${d}/include/lmdb.h"
		            then
		                if test ${d} != /usr
		                then
		                    LMDB_CFLAGS="-I ${d}/include"
!!		                    LMDB_LIBS="-L${d}/lib"
		                fi
		                have_lmdb="yes"
		            fi
		        done
		        ;;
		    *)
		        if test -f "${use_lmdb}/include/lmdb.h"
		        then
		            LMDB_CFLAGS="-I${use_lmdb}/include"
!!		            LMDB_LIBS="-L${use_lmdb}/lib"
		            have_lmdb="yes"
		        else
		            AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
		        fi
		        ;;
		esac


is naive. it ignores commonplace multiarch support.



with =path enabled on config, generated Makefile is just wrong

	egrep "^LMDB" Makefile
		LMDB_CFLAGS = -I/usr/local/lmdb/include
		LMDB_LIBS = -L/usr/local/lmdb/lib none required



bind advertises

	./configure --help | grep -i LMDB
		--with-lmdb=PATH        build with LMDB library [yes|no|path]

it simply fails to work as advertised.

> you can use and adjust the .pc file from any Linux distribution package

of course you can.

it's here

	pkg-config --libs --cflags lmdb
		-I/usr/local/lmdb/include -L/usr/local/lmdb/lib64 -llmdb

> LMDB support in BIND 9 comes with pkg-config support too

there's NO such option advertised by bind configure, as

	LMDB_CFLAGS
	          C compiler flags for LMDB, overriding pkg-config
	LMDB_LIBS
	          linker flags for LMDB, overriding pkg-config

it's simply not used by this bind build

	grep PKG_CHECK `grep -rln PKG_CHECK .` | grep -i lmdb
		(empty)

& no mention at all of it in source

	grep -i lmdb `grep -rlni lmdb .` | grep -i pkg
		(empty)

this

	--with-openssl=/usr/local/openssl

works.
this,

	--with-lmdb=/usr/local/lmdb

does not.

That has _nothing_ to do with 'LMDB upstream'


>  Did you came to get help or to argue?

neither.

> It’s really not our fault the LMDB upstream decided to make it hard to use the library.

::facepalm::


this

	tree /usr/local/lmdb
		/usr/local/lmdb
		...
		├── include
		│   └── lmdb.h
		...
		├── lib64
		│   ├── liblmdb.a
		│   └── liblmdb.so
		...

is about as simple as it gets.

fix it, remove it, or leave it as is -- your product, your choice.

good luck.


More information about the bind-users mailing list