lmdb/lmdb-make.patch

77 lines
2.7 KiB
Diff
Raw Normal View History

2017-01-04 11:27:20 +00:00
diff -up lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile.orig lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile
--- lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile.orig 2017-01-04 12:14:24.303344915 +0100
+++ lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile 2017-01-04 12:19:20.190295319 +0100
2016-02-10 10:33:18 +00:00
@@ -26,6 +26,7 @@ OPT = -O2 -g
2014-05-27 13:40:26 +00:00
CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
LDLIBS =
SOLIBS =
2016-02-10 10:33:18 +00:00
+SOVERSION = 0.0.0
2017-01-04 11:27:20 +00:00
SOEXT = .so
2014-05-27 13:40:26 +00:00
prefix = /usr/local
2016-02-10 10:33:18 +00:00
exec_prefix = $(prefix)
2017-01-04 11:27:20 +00:00
@@ -38,7 +39,7 @@ mandir = $(datarootdir)/man
2014-05-27 13:40:26 +00:00
########################################################################
IHDRS = lmdb.h
2017-01-04 11:27:20 +00:00
-ILIBS = liblmdb.a liblmdb$(SOEXT)
+ILIBS = liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVERSION)
2014-12-11 09:16:53 +00:00
IPROGS = mdb_stat mdb_copy mdb_dump mdb_load
IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1
2014-05-27 13:40:26 +00:00
PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
2017-01-04 11:27:20 +00:00
@@ -49,13 +50,13 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
2016-02-10 10:33:18 +00:00
mkdir -p $(DESTDIR)$(libdir)
mkdir -p $(DESTDIR)$(includedir)
mkdir -p $(DESTDIR)$(mandir)/man1
- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
2015-12-03 08:32:22 +00:00
- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
2016-02-10 10:33:18 +00:00
+ for f in $(IPROGS); do cp -a $$f $(DESTDIR)$(bindir); done
+ for f in $(ILIBS); do cp -a $$f $(DESTDIR)$(libdir); done
+ for f in $(IHDRS); do cp -a $$f $(DESTDIR)$(includedir); done
+ for f in $(IDOCS); do cp -a $$f $(DESTDIR)$(mandir)/man1; done
2014-05-27 13:40:26 +00:00
clean:
2015-08-14 09:55:38 +00:00
- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
+ rm -rf $(PROGS) *.[ao] *.[ls]o* *~ testdb
2014-05-27 13:40:26 +00:00
test: all
2015-08-14 09:55:38 +00:00
rm -rf testdb && mkdir testdb
2017-01-04 11:27:20 +00:00
@@ -64,20 +65,24 @@ test: all
2014-05-27 13:40:26 +00:00
liblmdb.a: mdb.o midl.o
2015-12-03 08:32:22 +00:00
$(AR) rs $@ mdb.o midl.o
2014-05-27 13:40:26 +00:00
2017-01-04 11:27:20 +00:00
-liblmdb$(SOEXT): mdb.lo midl.lo
+liblmdb$(SOEXT): liblmdb$(SOEXT).$(SOVERSION)
2014-05-27 13:40:26 +00:00
+ rm -f $@
+ ln -s $< $@
+
2017-01-04 11:27:20 +00:00
+liblmdb$(SOEXT).$(SOVERSION): mdb.lo midl.lo
2014-05-27 13:40:26 +00:00
# $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
2015-08-14 09:55:38 +00:00
- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS)
+ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,$@ -o $@ mdb.lo midl.lo $(SOLIBS)
2014-05-27 13:40:26 +00:00
-mdb_stat: mdb_stat.o liblmdb.a
-mdb_copy: mdb_copy.o liblmdb.a
2014-12-11 09:16:53 +00:00
-mdb_dump: mdb_dump.o liblmdb.a
-mdb_load: mdb_load.o liblmdb.a
2014-05-27 13:40:26 +00:00
-mtest: mtest.o liblmdb.a
-mtest2: mtest2.o liblmdb.a
-mtest3: mtest3.o liblmdb.a
-mtest4: mtest4.o liblmdb.a
-mtest5: mtest5.o liblmdb.a
-mtest6: mtest6.o liblmdb.a
+mdb_stat: mdb_stat.o liblmdb.so
+mdb_copy: mdb_copy.o liblmdb.so
2014-12-11 09:16:53 +00:00
+mdb_dump: mdb_dump.o liblmdb.so
+mdb_load: mdb_load.o liblmdb.so
2014-05-27 13:40:26 +00:00
+mtest: mtest.o liblmdb.so
+mtest2: mtest2.o liblmdb.so
+mtest3: mtest3.o liblmdb.so
+mtest4: mtest4.o liblmdb.so
+mtest5: mtest5.o liblmdb.so
+mtest6: mtest6.o liblmdb.so
mdb.o: mdb.c lmdb.h midl.h
2015-08-14 09:55:38 +00:00
$(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c