dependencies for 2.3 libstorage

Heath Kehoe heath.kehoe at intermec.com
Thu Aug 24 16:01:13 UTC 2000



This patch has already been added to the CURRENT tree.  I'm submitting
it now to be added to the 2.3 tree.

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.


Index: Make.methods
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Make.methods,v
retrieving revision 1.3
diff -u -r1.3 Make.methods
--- Make.methods	1999/10/09 17:05:18	1.3
+++ Make.methods	2000/08/24 15:49:16
@@ -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: Make.ovmethods
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Make.ovmethods,v
retrieving revision 1.3
diff -u -r1.3 Make.ovmethods
--- Make.ovmethods	2000/04/03 00:50:31	1.3
+++ Make.ovmethods	2000/08/24 15:49:16
@@ -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: Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/Makefile,v
retrieving revision 1.44
diff -u -r1.44 Makefile
--- Makefile	2000/04/08 04:30:08	1.44
+++ Makefile	2000/08/24 15:53:10
@@ -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: buildconfig.in
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/buildconfig.in,v
retrieving revision 1.7
diff -u -r1.7 buildconfig.in
--- buildconfig.in	1999/11/15 06:35:20	1.7
+++ buildconfig.in	2000/08/24 15:49:16
@@ -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: ovbuildconfig.in
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ovbuildconfig.in,v
retrieving revision 1.4
diff -u -r1.4 ovbuildconfig.in
--- ovbuildconfig.in	1999/11/15 06:35:20	1.4
+++ ovbuildconfig.in	2000/08/24 15:49:16
@@ -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: buffindexed/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/buffindexed/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- buffindexed/Makefile	2000/04/08 04:33:23	1.8
+++ buffindexed/Makefile	2000/08/24 15:53:29
@@ -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: 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
--- buffindexed/ovmethod.config	1999/08/02 07:01:40	1.1
+++ buffindexed/ovmethod.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = buffindexed
 number  = 3
+modules = buffindexed.o
Index: cnfs/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/cnfs/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- cnfs/Makefile	2000/04/08 04:33:25	1.16
+++ cnfs/Makefile	2000/08/24 15:53:48
@@ -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: 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
--- cnfs/method.config	1998/02/27 10:22:13	1.1
+++ cnfs/method.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = cnfs
 number  = 3
+modules = cnfs.o
Index: ov3/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ov3/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- ov3/Makefile	2000/04/08 04:33:25	1.5
+++ ov3/Makefile	2000/08/24 15:54:02
@@ -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: 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
--- ov3/ovmethod.config	1999/07/04 02:00:20	1.1
+++ ov3/ovmethod.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = tradindexed
 number  = 2
+modules = ov3.o
Index: ovdb/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/ovdb/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- ovdb/Makefile	2000/04/12 03:31:49	1.4
+++ ovdb/Makefile	2000/08/24 15:54:21
@@ -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: 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
--- ovdb/ovmethod.config	2000/01/14 03:45:34	1.1
+++ ovdb/ovmethod.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = ovdb
 number  = 4
+modules = ovdb.o
Index: timecaf/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timecaf/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- timecaf/Makefile	2000/04/08 04:33:26	1.7
+++ timecaf/Makefile	2000/08/24 15:54:41
@@ -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: 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
--- timecaf/method.config	1998/11/07 03:43:36	1.1
+++ timecaf/method.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = timecaf
 number  = 4
+modules = caf.o timecaf.o
Index: timehash/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/timehash/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- timehash/Makefile	2000/04/08 04:33:27	1.21
+++ timehash/Makefile	2000/08/24 15:54:56
@@ -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: 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
--- timehash/method.config	1997/11/10 21:30:53	1.1
+++ timehash/method.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = timehash
 number  = 2
+modules = timehash.o
Index: tradspool/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/tradspool/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- tradspool/Makefile	2000/04/08 04:33:28	1.6
+++ tradspool/Makefile	2000/08/24 15:55:10
@@ -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: 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
--- tradspool/method.config	1998/11/07 03:44:25	1.1
+++ tradspool/method.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = tradspool
 number  = 5
+modules = tradspool.o
Index: trash/Makefile
===================================================================
RCS file: /home/heath/inn/repository/inn/storage/trash/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- trash/Makefile	2000/04/08 04:33:28	1.8
+++ trash/Makefile	2000/08/24 15:55:20
@@ -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: 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
--- trash/method.config	1998/03/13 16:43:46	1.1
+++ trash/method.config	2000/08/24 15:49:16
@@ -1,2 +1,3 @@
 name = trash
 number  = 0
+modules = trash.o




More information about the inn-patches mailing list