diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/tdb/Makefile.in | 31 | ||||
-rw-r--r-- | source4/lib/tdb/configure.ac | 4 |
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) |