]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Only have one build rule for budb_errs.c
authorBen Kaduk <kaduk@mit.edu>
Wed, 6 Mar 2013 18:51:15 +0000 (13:51 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 21 Mar 2013 18:08:49 +0000 (11:08 -0700)
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 <sxw@your-file-system.com>
    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 <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
    (cherry picked from commit 0d0b5048a5b68d4079b13609775f9234183d1947)

The second commit:
    Author: Andrew Deason <adeason@sinenomine.net>
    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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
    (cherry picked from commit 61453d8f33f6508f8464ffba0657aefb6c7eae3b)

Change-Id: I7d35c7557bcd82ba50742f2594bd4bb78cf0e5a5
Reviewed-on: http://gerrit.openafs.org/9405
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/budb/.gitignore
src/budb/Makefile.in
src/budb/NTMakefile
src/budb/budb_client.h [new file with mode: 0644]
src/budb/budb_client.p.h [deleted file]
src/tbudb/.gitignore
src/tbudb/Makefile.in

index 1427515862b08ed3b0125d7360446a0f201793b7..d8128702833d8d13d7c6963eaa0bfbc553eafec5 100644 (file)
@@ -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
index 29ce529e7d1ce673abaaea39f07cfde9b9971ae2..992159b7beb722a9cd0ae33d46cf7f6955504c3a 100644 (file)
@@ -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
index ad994bba1e44267aa611945e380f1d62e9bc1766..1d7819414db5f7a08b8dd23b4bda10fe9e9faef3 100644 (file)
@@ -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 (file)
index 0000000..ce5e234
--- /dev/null
@@ -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 <ubik.h>
+#ifndef BUDB_MAJORVERSION      /* get the installed RPC stuff */
+#include <sys/types.h>
+#include <rx/xdr.h>
+#include <afs/budb.h>
+#endif
+
+#include <afs/budb_errs.h>
+
+/* 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 (file)
index 9088fec..0000000
+++ /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 <ubik.h>
-#ifndef BUDB_MAJORVERSION      /* get the installed RPC stuff */
-#include <sys/types.h>
-#include <rx/xdr.h>
-#include <afs/budb.h>
-#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
index 1427515862b08ed3b0125d7360446a0f201793b7..d8128702833d8d13d7c6963eaa0bfbc553eafec5 100644 (file)
@@ -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
index 039494128f7be1947c5789de51c592f210c6e76a..087732cdadf5bc360e6ebce3864b9c16542efb49 100644 (file)
@@ -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