summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-06 18:58:19 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:38 +0100
commit831d7383741baebe90312833a4319c06831fc01f (patch)
treea538eac7a72ce3f20b961c20bbb623c7d63dbcb1 /source4
parent2ca86c77699a50f7861095ad8c1c94cba8f20e01 (diff)
downloadsamba-831d7383741baebe90312833a4319c06831fc01f.tar.gz
samba-831d7383741baebe90312833a4319c06831fc01f.tar.bz2
samba-831d7383741baebe90312833a4319c06831fc01f.zip
r25881: Add ability to build .so of tdb.
(This used to be commit 03bc4896e6c83d4d01b366cd5ce9e49547ee206c)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdb/Makefile.in31
-rw-r--r--source4/lib/tdb/configure.ac4
2 files changed, 28 insertions, 7 deletions
diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in
index ba98564506..fea76cfaef 100644
--- a/source4/lib/tdb/Makefile.in
+++ b/source4/lib/tdb/Makefile.in
@@ -16,6 +16,11 @@ CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude
CFLAGS = $(CPPFLAGS) @CFLAGS@
LDFLAGS = @LDFLAGS@
EXEEXT = @EXEEXT@
+SHLD_FLAGS = @SHLD_FLAGS@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PICFLAG = @PICFLAG@
+SONAMEFLAG = @SONAMEFLAG@
+SHLIBEXT = @SHLIBEXT@
.PHONY: test
@@ -27,7 +32,10 @@ TDB_OBJ = @TDB_OBJ@ @LIBREPLACEOBJ@
DIRS = bin common tools
-all: showflags dirs $(PROGS)
+SONAME = libtdb.$(SHLIBEXT).1
+SOLIB = libtdb.$(SHLIBEXT).$(PACKAGE_VERSION)
+
+all: showflags dirs $(PROGS) $(SOLIB) libtdb.a
showflags:
@echo 'tdb will be compiled with flags:'
@@ -36,10 +44,12 @@ showflags:
@echo ' LDFLAGS = $(LDFLAGS)'
@echo ' LIBS = $(LIBS)'
+.SUFFIXES: .c .o
+
.c.o:
@echo Compiling $*.c
@mkdir -p `dirname $@`
- @$(CC) $(CFLAGS) -c $< -o $@
+ @$(CC) $(PICFLAG) $(CFLAGS) -c $< -o $@
dirs:
@mkdir -p $(DIRS)
@@ -52,23 +62,30 @@ install: all
cp $(PROGS) $(DESTDIR)$(bindir)
cp $(srcdir)/include/tdb.h $(DESTDIR)$(includedir)
cp tdb.pc $(DESTDIR)$(libdir)/pkgconfig
+ cp libtdb.a $(SOLIB) $(DESTDIR)$(libdir)
libtdb.a: $(TDB_OBJ)
ar -rv libtdb.a $(TDB_OBJ)
-bin/tdbtest$(EXEEXT): tools/tdbtest.o libtdb.a
+libtdb.(SHLIBEXT): $(SOLIB)
+ ln -s $< $@
+
+$(SOLIB): $(TDB_OBJ)
+ $(CC) $(SONAMEFLAG)$(SONAME) $(SHLD_FLAGS) -o $@ $^
+
+bin/tdbtest$(EXEEXT): tools/tdbtest.o libtdb.$(SHLIBEXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
-bin/tdbtool$(EXEEXT): tools/tdbtool.o libtdb.a
+bin/tdbtool$(EXEEXT): tools/tdbtool.o libtdb.$(SHLIBEXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
-bin/tdbtorture$(EXEEXT): tools/tdbtorture.o libtdb.a
+bin/tdbtorture$(EXEEXT): tools/tdbtorture.o libtdb.$(SHLIBEXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
-bin/tdbdump$(EXEEXT): tools/tdbdump.o libtdb.a
+bin/tdbdump$(EXEEXT): tools/tdbdump.o libtdb.$(SHLIBEXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
-bin/tdbbackup$(EXEEXT): tools/tdbbackup.o libtdb.a
+bin/tdbbackup$(EXEEXT): tools/tdbbackup.o libtdb.$(SHLIBEXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
test: bin/tdbtorture$(EXEEXT)
diff --git a/source4/lib/tdb/configure.ac b/source4/lib/tdb/configure.ac
index 8bfff589cc..de8fc9c2b5 100644
--- a/source4/lib/tdb/configure.ac
+++ b/source4/lib/tdb/configure.ac
@@ -6,5 +6,9 @@ AC_INIT(tdb, 1.1.0)
AC_CONFIG_SRCDIR([common/tdb.c])
AC_CONFIG_HEADER(include/config.h)
AC_LIBREPLACE_ALL_CHECKS
+AC_LD_SONAMEFLAG
+AC_LD_PICFLAG
+AC_LD_SHLDFLAGS
+AC_LD_SHLIBEXT
m4_include(libtdb.m4)
AC_OUTPUT(Makefile tdb.pc)