patch: fix dependencies for libstorage.a

Heath Kehoe heath.kehoe at intermec.com
Mon Jun 19 04:37:00 UTC 2000


This patch adds proper dependencies for libstorage.a; such that if
one of the method source files (e.g., cnfs.c) is modified, it will
actually re-link libstorage.a.  The method.config files now have
another parameter that lists the .o files for that method; and the
buildconfig script will collect that info and put it into
Make.methods which is then available to the Makefile.  Same with
the ovmethod stuff.

This should only go into the CURRENT tree, because it could use more
testing (I havn't tried using libtool or shared libs).

-heath


Index: storage/Make.methods
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Make.methods,v
retrieving revision 1.3
diff -u -r1.3 Make.methods
--- storage/Make.methods	1999/10/09 17:05:18	1.3
+++ storage/Make.methods	2000/06/19 04:14:49
@@ -1,3 +1,5 @@
 # This file is automatically generated by buildconfig
 
 SUBDIR = tradspool timecaf trash cnfs timehash 
+SM_OBJECTS =  ./cnfs/cnfs.o ./timecaf/caf.o ./timecaf/timecaf.o ./timehash/timehash.o ./tradspool/tradspool.o ./trash/trash.o
+LSM_OBJECTS =  ./cnfs/cnfs.lo ./timecaf/caf.lo ./timecaf/timecaf.lo ./timehash/timehash.lo ./tradspool/tradspool.lo ./trash/trash.lo
Index: storage/Make.ovmethods
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Make.ovmethods,v
retrieving revision 1.3
diff -u -r1.3 Make.ovmethods
--- storage/Make.ovmethods	2000/04/03 00:50:31	1.3
+++ storage/Make.ovmethods	2000/06/19 04:15:00
@@ -1,3 +1,5 @@
 # This file is automatically generated by ovbuildconfig
 
OVSUBDIR = ovdb buffindexed ov3 
+OV_OBJECTS =  ./buffindexed/buffindexed.o ./ov3/ov3.o ./ovdb/ovdb.o
+LOV_OBJECTS =  ./buffindexed/buffindexed.lo ./ov3/ov3.lo ./ovdb/ovdb.lo
Index: storage/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Makefile,v
retrieving revision 1.44
diff -u -r1.44 Makefile
--- storage/Makefile	2000/04/08 04:30:08	1.44
+++ storage/Makefile	2000/06/19 04:02:55
@@ -2,7 +2,6 @@
 
 include ../Makefile.global
 
-CP	= $(LIBTOOL) cp
 CFLAGS	= $(GCFLAGS) -I.
 
 all:			autoconfig
@@ -17,7 +16,6 @@
 LOBJECTS = interface.lo methods.lo ovmethods.lo ov.lo
 
 methods: 
-	@[ -d objs ] || mkdir objs
 	@for D in $(SUBDIR) $(OVSUBDIR); do \
 	cd $$D; $(MAKE) $(FLAGS) DESTDIR=$(DESTDIR) || exit 1; cd ..; \
 	done
@@ -26,7 +24,7 @@
 
 clobber clean:
 	rm -f *.o *.lo libstorage.la libstorage.a
-	rm -rf objs .libs
+	rm -rf .libs
 	rm -f methods.c methods.h
 	rm -f ovmethods.c ovmethods.h
 	rm -f profiled libstorage_p.a
@@ -38,12 +36,12 @@
 tags ctags:	$(SOURCES)
 	$(CTAGS) $(SOURCES) ../include/*.h
 
-libstorage.la:	$(P) $(OBJECTS) $(LOBJECTS)
-	$(LIBCC) $(LDFLAGS) -o libstorage.la $(LOBJECTS) objs/*.lo \
+libstorage.la:	$(P) $(OBJECTS) $(LOBJECTS) $(LSM_OBJECTS) $(LOV_OBJECTS)
+	$(LIBCC) $(LDFLAGS) -o libstorage.la $(LOBJECTS) $(LSM_OBJECTS) $(LOV_OBJECTS) \
 		-rpath $(PATHLIB) -version-info 2:0:0
 
-libstorage.a:         $(P) $(OBJECTS)
-	ar r $@ $(OBJECTS) objs/*
+libstorage.a:         $(P) $(OBJECTS) $(SM_OBJECTS) $(OV_OBJECTS)
+	ar r $@ $(OBJECTS) $(SM_OBJECTS) $(OV_OBJECTS)
 	$(RANLIB) libstorage.a
 
 .c.o:
Index: storage/buildconfig.in
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/buildconfig.in,v
retrieving revision 1.7
diff -u -r1.7 buildconfig.in
--- storage/buildconfig.in	1999/11/15 06:35:20	1.7
+++ storage/buildconfig.in	2000/06/19 04:02:55
@@ -1,14 +1,17 @@
 #! /usr/bin/perl
 
 require 5.003;
+use File::Basename;
 
 if (scalar(@ARGV) <= 0) {
     printf STDERR "No storage methods are available\n";
     exit(1);
 }
 
+$objects = "";
 foreach $file (@ARGV) {
     open(CFG, $file) || die "$!";
+    $dir = dirname $file;
     while (<CFG>) {
 	chomp;
 
@@ -33,6 +36,12 @@
 	    $methodnum{$file} = $number;
 	    next;
 	}
+	if (/^modules\s*=\s*(.*)/) {
+	    (@objs) = split /\s+/,$1;
+	    foreach $i (@objs) {
+		$objects .= " $dir/$i";
+	    }
+	}
     }
     close(CFG);
 }
@@ -100,6 +109,9 @@
     print LIST "$path ";
 }
 print LIST "\n";
+print LIST "SM_OBJECTS = $objects\n";
+$objects =~ s/\.o\b/.lo/g;
+print LIST "LSM_OBJECTS = $objects\n";
 close(LIST);
 `cmp -s Make.methods Make.methods.new`;
 if ($? == 0) { unlink("Make.methods.new"); }
Index: storage/ovbuildconfig.in
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ovbuildconfig.in,v
retrieving revision 1.4
diff -u -r1.4 ovbuildconfig.in
--- storage/ovbuildconfig.in	1999/11/15 06:35:20	1.4
+++ storage/ovbuildconfig.in	2000/06/19 04:02:55
@@ -1,14 +1,17 @@
 #! /usr/bin/perl
 
 require 5.003;
+use File::Basename;
 
 if (scalar(@ARGV) <= 0) {
     printf STDERR "No overview methods are available\n";
     exit(1);
 }
 
+$objects = "";
 foreach $file (@ARGV) {
     open(CFG, $file) || die "$!";
+    $dir = dirname $file;
     while (<CFG>) {
 	chomp;
 
@@ -33,6 +36,12 @@
 	    $methodnum{$file} = $number;
 	    next;
 	}
+	if (/^modules\s*=\s*(.*)/) {
+	    (@objs) = split /\s+/,$1;
+	    foreach $i (@objs) {
+		$objects .= " $dir/$i";
+	    }
+	}
     }
     close(CFG);
 }
@@ -98,6 +107,9 @@
     print LIST "$path ";
 }
 print LIST "\n";
+print LIST "OV_OBJECTS = $objects\n";
+$objects =~ s/\.o\b/.lo/g;
+print LIST "LOV_OBJECTS = $objects\n";
 close(LIST);
 `cmp -s Make.ovmethods Make.ovmethods.new`;
 if ($? == 0) { unlink("Make.ovmethods.new"); }
Index: storage/buffindexed/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/buffindexed/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- storage/buffindexed/Makefile	2000/04/08 04:33:23	1.8
+++ storage/buffindexed/Makefile	2000/06/19 04:02:55
@@ -2,20 +2,16 @@
 
 include ../../Makefile.global
 
-CP      = $(UPLIBTOOL) cp
 CFLAGS  = $(GCFLAGS) -I../../include -I..
 
 SOURCES = buffindexed.c
 OBJECTS = buffindexed.o
 ROBJECTS= buffindexed.$(EXTOBJ)
 
-all: $(OBJECTS) moveobjs
+all: $(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 debug:	buffindexed
 
Index: storage/buffindexed/ovmethod.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/buffindexed/ovmethod.config,v
retrieving revision 1.1
diff -u -r1.1 ovmethod.config
--- storage/buffindexed/ovmethod.config	1999/08/02 07:01:40	1.1
+++ storage/buffindexed/ovmethod.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = buffindexed
 number  = 3
+modules = buffindexed.o
Index: storage/cnfs/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/cnfs/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- storage/cnfs/Makefile	2000/04/08 04:33:25	1.16
+++ storage/cnfs/Makefile	2000/06/19 04:02:55
@@ -2,8 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
-
 CFLAGS	 = $(GCFLAGS) -I../../include -I.. 
 
 SOURCES  = cnfs.c
@@ -11,13 +9,10 @@
 LOBJECTS = cnfs.lo
 ROBJECTS = cnfs.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o
Index: storage/cnfs/method.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/cnfs/method.config,v
retrieving revision 1.1
diff -u -r1.1 method.config
--- storage/cnfs/method.config	1998/02/27 10:22:13	1.1
+++ storage/cnfs/method.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = cnfs
 number  = 3
+modules = cnfs.o
Index: storage/ov3/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ov3/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- storage/ov3/Makefile	2000/04/08 04:33:25	1.5
+++ storage/ov3/Makefile	2000/06/19 04:02:55
@@ -2,8 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
-
 CFLAGS	= $(GCFLAGS) -I../../include -I..
 
 SOURCES = ov3.c
@@ -11,13 +9,10 @@
 LOBJECTS = ov3.lo
 ROBJECTS = ov3.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o
Index: storage/ov3/ovmethod.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ov3/ovmethod.config,v
retrieving revision 1.1
diff -u -r1.1 ovmethod.config
--- storage/ov3/ovmethod.config	1999/07/04 02:00:20	1.1
+++ storage/ov3/ovmethod.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = tradindexed
 number  = 2
+modules = ov3.o
Index: storage/ovdb/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ovdb/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- storage/ovdb/Makefile	2000/04/12 03:31:49	1.4
+++ storage/ovdb/Makefile	2000/06/19 04:02:55
@@ -2,8 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
-
 CFLAGS	= $(GCFLAGS) -I../../include -I.. $(BERKELEY_DB_CFLAGS)
 
 SOURCES = ovdb.c
@@ -11,19 +9,16 @@
 LOBJECTS = ovdb.lo
 ROBJECTS = ovdb.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
 
 ovdb:	ovdb.c
-	rm -f ovdb.o ../objs/*.o
+	rm -f ovdb.o
 	$(CC) $(CFLAGS) -DTEST_BDB -c ovdb.c
 	$(CC) $(LDFLAGS) -o $@ ../*/*.o ../interface.o ../ov.o ../methods.o ../ovmethods.o ../../lib/libinn.$(EXTLIB) $(EXTSTORAGELIBS) $(LIBS)
 	rm -f ovdb.o
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o *~
Index: storage/ovdb/ovmethod.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ovdb/ovmethod.config,v
retrieving revision 1.1
diff -u -r1.1 ovmethod.config
--- storage/ovdb/ovmethod.config	2000/01/14 03:45:34	1.1
+++ storage/ovdb/ovmethod.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = ovdb
 number  = 4
+modules = ovdb.o
Index: storage/timecaf/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timecaf/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- storage/timecaf/Makefile	2000/04/08 04:33:26	1.7
+++ storage/timecaf/Makefile	2000/06/19 04:02:55
@@ -2,7 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
 CFLAGS  = $(GCFLAGS) -I../../include -I..
 
 SOURCES = caf.c timecaf.c
@@ -10,14 +9,10 @@
 LOBJECTS = caf.lo timecaf.lo
 ROBJECTS = caf.$(EXTOBJ) timecaf.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p caf.$(EXTOBJ) ../objs
-	$(CP) -p timecaf.$(EXTOBJ) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o *~ profiled
Index: storage/timecaf/method.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timecaf/method.config,v
retrieving revision 1.1
diff -u -r1.1 method.config
--- storage/timecaf/method.config	1998/11/07 03:43:36	1.1
+++ storage/timecaf/method.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = timecaf
 number  = 4
+modules = caf.o timecaf.o
Index: storage/timehash/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timehash/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- storage/timehash/Makefile	2000/04/08 04:33:27	1.21
+++ storage/timehash/Makefile	2000/06/19 04:02:55
@@ -2,7 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
 CFLAGS	= $(GCFLAGS) -I../../include -I..
 
 SOURCES = timehash.c
@@ -10,13 +9,10 @@
 LOBJECTS = timehash.lo
 ROBJECTS = timehash.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o profiled
Index: storage/timehash/method.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timehash/method.config,v
retrieving revision 1.1
diff -u -r1.1 method.config
--- storage/timehash/method.config	1997/11/10 21:30:53	1.1
+++ storage/timehash/method.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = timehash
 number  = 2
+modules = timehash.o
Index: storage/tradspool/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/tradspool/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- storage/tradspool/Makefile	2000/04/08 04:33:28	1.6
+++ storage/tradspool/Makefile	2000/06/19 04:02:55
@@ -2,7 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
 CFLAGS  = $(GCFLAGS) -I../../include -I..
 
 SOURCES = tradspool.c
@@ -10,13 +9,10 @@
 LOBJECTS = tradspool.lo
 ROBJECTS = tradspool.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o *~
Index: storage/tradspool/method.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/tradspool/method.config,v
retrieving revision 1.1
diff -u -r1.1 method.config
--- storage/tradspool/method.config	1998/11/07 03:44:25	1.1
+++ storage/tradspool/method.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = tradspool
 number  = 5
+modules = tradspool.o
Index: storage/trash/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/trash/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- storage/trash/Makefile	2000/04/08 04:33:28	1.8
+++ storage/trash/Makefile	2000/06/19 04:02:55
@@ -2,7 +2,6 @@
 
 include ../../Makefile.global
 
-CP	= $(UPLIBTOOL) cp
 CFLAGS	= $(GCFLAGS) -I../../include -I..
 
 SOURCES = trash.c
@@ -10,13 +9,10 @@
 LOBJECTS = trash.lo
 ROBJECTS = trash.$(EXTOBJ)
 
-all:			$(OBJECTS) moveobjs
+all:			$(OBJECTS)
 
 .c.o:
 	$(UPLIBCC) $(CFLAGS) -c $*.c -o $@
-
-moveobjs: $(OBJECTS)
-	$(CP) -p $(ROBJECTS) ../objs
 
 clobber clean:
 	rm -f *.o *.lo obj/*.o profiled
Index: storage/trash/method.config
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/trash/method.config,v
retrieving revision 1.1
diff -u -r1.1 method.config
--- storage/trash/method.config	1998/03/13 16:43:46	1.1
+++ storage/trash/method.config	2000/06/19 04:02:55
@@ -1,2 +1,3 @@
 name = trash
 number  = 0
+modules = trash.o




More information about the inn-patches mailing list