[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#7656) Build: Installing LMDB on OS X

Full_Name: John Hewson
Version: 2.4.35
OS: OS X 10.8.4
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

I can't install liblmdb on OS X because its Makefile assumes that cp can
handle multiple source files, rather than the basic POSIX cp, which can't.
This leads to the situation on OS X where:

    cp source1 source2 dest
throws an error.

The breaks the LMDB Makefile, because its install attempts to do:

    ILIBS	= liblmdb.a liblmdb.so
    cp $(IPROGS) $(DESTDIR)$(prefix)/bin

Most makefiles I've encountered use a for loop for copying multiple files,
so the fix for the Makefile is to change `install` to:

    install: $(ILIBS) $(IPROGS) $(IHDRS)
        for f in $(IPROGS); do cp $$f $(DESTDIR)$(prefix)/bin; done
        for f in $(ILIBS); do cp $$f $(DESTDIR)$(prefix)/lib; done
        for f in $(IHDRS); do cp $$f $(DESTDIR)$(prefix)/include; done
        for f in $(IDOCS); do cp $$f $(DESTDIR)$(prefix)/man/man1; done
Then LMDB builds and installs successfully on OS X.