From: Ben Kaduk Date: Wed, 6 Mar 2013 18:51:15 +0000 (-0500) Subject: Only have one build rule for budb_errs.c X-Git-Tag: upstream/1.6.3^2~137 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=07b2f0e218f2a2fca4eaef19f364e74c16a48e92;p=packages%2Fo%2Fopenafs.git Only have one build rule for budb_errs.c This commit squashes two cherry-picks from master together, as the first one broke the build with pthreaded ubik enabled. The first commit: Author: Simon Wilkinson Date: Mon Feb 21 00:29:33 2011 +0000 budb: Only have one build rule for budb_errs.c budb had two build rules that could produce budb_errs.c, but only one of them also produced budb_client.h. This led to problems with parallel makes, as depending on which rule fired first, budb_client.h might, or might not, exist. Rework all of this so that it's cleaner. Instead of producing two copies of the error table, just make budb_client.h a static file, and include the dynamically generated budb_errs.h from it. This reduces code duplication, and means that we have to run compile_et one less time. Reviewed-on: http://gerrit.openafs.org/4027 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear (cherry picked from commit 0d0b5048a5b68d4079b13609775f9234183d1947) The second commit: Author: Andrew Deason Date: Mon Feb 21 13:49:59 2011 -0600 Fix budb build rules for tbudb and WINNT Commit 0d0b5048a5b68d4079b13609775f9234183d1947 only fixed the budb Makefile.in. Make the analagous changes to tbudb/Makefile.in and NTMakefile. Reviewed-on: http://gerrit.openafs.org/4029 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 61453d8f33f6508f8464ffba0657aefb6c7eae3b) Change-Id: I7d35c7557bcd82ba50742f2594bd4bb78cf0e5a5 Reviewed-on: http://gerrit.openafs.org/9405 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Andrew Deason Reviewed-by: Paul Smeddle Reviewed-by: Stephan Wiesand --- diff --git a/src/budb/.gitignore b/src/budb/.gitignore index 142751586..d81287028 100644 --- a/src/budb/.gitignore +++ b/src/budb/.gitignore @@ -3,7 +3,6 @@ # to check that you haven't inadvertently ignored any tracked files. /budb.h -/budb_client.h /budb_errs.c /budb_errs.h /budb_server diff --git a/src/budb/Makefile.in b/src/budb/Makefile.in index 29ce529e7..992159b7b 100644 --- a/src/budb/Makefile.in +++ b/src/budb/Makefile.in @@ -25,6 +25,8 @@ INCLS=\ ${TOP_INCDIR}/afs/cellconfig.h \ ${TOP_INCDIR}/afs/com_err.h \ ${TOP_INCDIR}/afs/bubasics.h \ + ${TOP_INCDIR}/afs/budb_client.h \ + ${TOP_INCDIR}/afs/budb_errs.h \ budb.h budb_client.h database.h # library ordering defined by top level makefile @@ -52,7 +54,7 @@ SERVER_OBJS = ${COMMON_OBJS} budb.ss.o budb.xdr.o dbs_dump.o db_lock.o db_text.o all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_errs.h ${TOP_INCDIR}/afs/budb_prototypes.h budb_server generated: \ - budb_errs.c budb_errs.h budb_client.h \ + budb_errs.c budb_errs.h \ budb.cs.c budb.ss.c budb.xdr.c budb.h ${TOP_LIBDIR}/libbudb.a: libbudb.a @@ -62,7 +64,7 @@ ${TOP_INCDIR}/afs/budb.h: budb.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/afs/budb_errs.h: budb_errs.h - ${INSTALL_DATA} $? $@ + ${INSTALL_DATA} budb_errs.h $@ ${TOP_INCDIR}/afs/budb_client.h: budb_client.h ${INSTALL_DATA} $? $@ @@ -70,18 +72,10 @@ ${TOP_INCDIR}/afs/budb_client.h: budb_client.h ${TOP_INCDIR}/afs/budb_prototypes.h: budb_prototypes.h ${INSTALL_DATA} $? $@ -# -# budb_errs.o actually depends on neither budb_client.h nor budb_errs.h -# but generating either of them will rebuild budb_errs.c -# -budb_errs.o: budb_errs.c budb_client.h budb_errs.h - -budb_client.h: budb_errs.c - -budb_errs.c: budb_errs.et budb_client.p.h - $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir} budb_errs -h budb_client +budb_errs.h: budb_errs.c -budb_errs.h: budb_errs.et +budb_errs.c: budb_errs.et + $(RM) -f budb_errs.c ${COMPILE_ET} -p ${srcdir} budb_errs database.o: database.c budb_errs.h globals.h ${INCLS} @@ -92,7 +86,7 @@ db_text.o: db_text.c budb_errs.h ${INCLS} db_hash.o: db_hash.c budb_errs.h ${INCLS} ol_verify.o: ol_verify.c budb_errs.h ${INCLS} procs.o: procs.c budb_errs.h globals.h ${INCLS} -struct_ops.o: budb_errs.h ${TOP_INCDIR}/afs/budb_client.h +struct_ops.o: budb_errs.h ${INCLS} server.o: server.c budb_errs.h ${INCLS} AFS_component_version_number.c budb_server: $(SERVER_OBJS) ${LIBS} ${TOP_INCDIR}/afs/budb_client.h @@ -146,7 +140,7 @@ dest: libbudb.a budb.h budb_errs.h budb_client.h budb_server # Misc targets # clean: - $(RM) -f *.o *~ budb_errs.[ch] budb.h budb_client.h *.a *.xdr.c \ + $(RM) -f *.o *~ budb_errs.[ch] budb.h *.a *.xdr.c \ *.ss.c *.cs.c core budb_server AFS_component_version_number.c include ../config/Makefile.version diff --git a/src/budb/NTMakefile b/src/budb/NTMakefile index ad994bba1..1d7819414 100644 --- a/src/budb/NTMakefile +++ b/src/budb/NTMakefile @@ -113,14 +113,13 @@ $(INCFILEDIR)\budb.h: budb.h ############################################################################ # compile_et on budb_errs.et -$(INCFILEDIR)\budb_errs.h : budb_errs.et - $(COMPILE_ET) budb_errs -h budb_errs + +$(INCFILEDIR)\budb_errs.h: budb_errs.c $(COPY) budb_errs.h $(INCFILEDIR)\budb_errs.h -budb_errs.c $(INCFILEDIR)\budb_client.h: budb_errs.et budb_client.p.h - $(DEL) budb_client.h budb_errs.c - $(COMPILE_ET) budb_errs -h budb_client - $(COPY) budb_client.h $(INCFILEDIR)\budb_client.h +budb_errs.c: budb_errs.et + $(DEL) budb_errs.c + $(COMPILE_ET) budb_errs ############################################################################ # install @@ -133,7 +132,7 @@ install: $(INCFILES) $(LIBFILE) $(EXEFILE) clean:: $(DEL) $(INCFILES) - $(DEL) budb_errs.c budb_errs.h budb.h budb_client.h + $(DEL) budb_errs.c budb_errs.h budb.h $(DEL) budb.cs.c budb.ss.c budb.xdr.c mkdir: diff --git a/src/budb/budb_client.h b/src/budb/budb_client.h new file mode 100644 index 000000000..ce5e2340d --- /dev/null +++ b/src/budb/budb_client.h @@ -0,0 +1,55 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef __BUDB_CLIENT__ +#define __BUDB_CLIENT__ + +#include +#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ +#include +#include +#include +#endif + +#include + +/* for ubik_Call_SingleServer */ + +#define UF_SINGLESERVER 1 /* begin single server operation */ +#define UF_END_SINGLESERVER 2 /* terminate single server operation */ + + +/* handle for the ubik database connection */ + +struct udbHandleS { + afs_int32 uh_scIndex; /* what type of sec. object */ + struct rx_securityClass *uh_secobj; /* security object */ + struct rx_connection *uh_serverConn[MAXSERVERS]; /* server connections */ + struct ubik_client *uh_client; /* ubik client handle */ + afs_uint32 uh_instanceId; /* instance of client */ +}; + +typedef struct udbHandleS udbHandleT; +typedef udbHandleT *udbHandleP; + +/* suggested text block management structure */ + +struct udbClientTextS { + char *textName; /* for info. only */ + afs_int32 textType; /* used as key for access */ + afs_uint32 textVersion; /* version # for cache mgmt */ + afs_uint32 lockHandle; /* for atomicity */ + afs_int32 textSize; /* no. of bytes */ + FILE *textStream; /* file stream or NULL */ +}; + +typedef struct udbClientTextS udbClientTextT; +typedef udbClientTextT *udbClientTextP; + +#endif diff --git a/src/budb/budb_client.p.h b/src/budb/budb_client.p.h deleted file mode 100644 index 9088fec78..000000000 --- a/src/budb/budb_client.p.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -#ifndef __BUDB_CLIENT__ -#define __BUDB_CLIENT__ - -#include -#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ -#include -#include -#include -#endif - - -/* for ubik_Call_SingleServer */ - -#define UF_SINGLESERVER 1 /* begin single server operation */ -#define UF_END_SINGLESERVER 2 /* terminate single server operation */ - - -/* handle for the ubik database connection */ - -struct udbHandleS { - afs_int32 uh_scIndex; /* what type of sec. object */ - struct rx_securityClass *uh_secobj; /* security object */ - struct rx_connection *uh_serverConn[MAXSERVERS]; /* server connections */ - struct ubik_client *uh_client; /* ubik client handle */ - afs_uint32 uh_instanceId; /* instance of client */ -}; - -typedef struct udbHandleS udbHandleT; -typedef udbHandleT *udbHandleP; - -/* suggested text block management structure */ - -struct udbClientTextS { - char *textName; /* for info. only */ - afs_int32 textType; /* used as key for access */ - afs_uint32 textVersion; /* version # for cache mgmt */ - afs_uint32 lockHandle; /* for atomicity */ - afs_int32 textSize; /* no. of bytes */ - FILE *textStream; /* file stream or NULL */ -}; - -typedef struct udbClientTextS udbClientTextT; -typedef udbClientTextT *udbClientTextP; - -#endif diff --git a/src/tbudb/.gitignore b/src/tbudb/.gitignore index 142751586..d81287028 100644 --- a/src/tbudb/.gitignore +++ b/src/tbudb/.gitignore @@ -3,7 +3,6 @@ # to check that you haven't inadvertently ignored any tracked files. /budb.h -/budb_client.h /budb_errs.c /budb_errs.h /budb_server diff --git a/src/tbudb/Makefile.in b/src/tbudb/Makefile.in index 039494128..087732cda 100644 --- a/src/tbudb/Makefile.in +++ b/src/tbudb/Makefile.in @@ -38,7 +38,9 @@ INCLS=\ ${TOP_INCDIR}/afs/cellconfig.h \ ${TOP_INCDIR}/afs/com_err.h \ ${TOP_INCDIR}/afs/bubasics.h \ - budb.h budb_client.h + ${TOP_INCDIR}/afs/budb_client.h \ + ${TOP_INCDIR}/afs/budb_errs.h \ + budb.h $(BUDB)/budb_client.h # library ordering defined by top level makefile LIBS=${RXOBJS} ${UTILOBJS} \ @@ -56,16 +58,10 @@ SERVER_OBJS = ${COMMON_OBJS} budb.ss.o budb.xdr.o dbs_dump.o db_lock.o db_text.o all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_errs.h ${TOP_INCDIR}/afs/budb_client.h budb_server ${INCLS} -# -# budb_errs.o actually depends on neither budb_client.h nor budb_errs.h -# but generating either of them will rebuild budb_errs.c -# -budb_errs.o: budb_errs.c budb_client.h budb_errs.h - -budb_errs.c budb_client.h: ${BUDB}/budb_errs.et ${BUDB}/budb_client.p.h - $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir}/${BUDB} budb_errs -h budb_client +budb_errs.h: budb_errs.c -budb_errs.h: ${BUDB}/budb_errs.et +budb_errs.c: ${BUDB}/budb_errs.et + $(RM) -f budb_errs.c ${COMPILE_ET} -p ${srcdir}/${BUDB} budb_errs # @@ -147,7 +143,7 @@ ol_verify.o: ${BUDB}/ol_verify.c budb_errs.h ${INCLS} procs.o: ${BUDB}/procs.c budb_errs.h ${INCLS} ${CCRULE} ${srcdir}/${BUDB}/procs.c -struct_ops.o: ${BUDB}/struct_ops.c budb_errs.h ${TOP_INCDIR}/afs/budb_client.h +struct_ops.o: ${BUDB}/struct_ops.c budb_errs.h ${INCLS} ${CCRULE} ${srcdir}/${BUDB}/struct_ops.c server.o: ${BUDB}/server.c budb_errs.h ${INCLS} @@ -191,7 +187,7 @@ ${DEST}/root.server/usr/afs/bin/buserver: budb_server # Misc targets # clean: - $(RM) -f *.o *~ budb_errs.[ch] budb.h budb_client.h *.a *.xdr.c \ + $(RM) -f *.o *~ budb_errs.[ch] budb.h *.a *.xdr.c \ *.ss.c *.cs.c core budb_server AFS_component_version_number.c include ../config/Makefile.version