path: root/build-aux
diff options
authorNiels de Vos <>2016-04-18 21:47:18 +0200
committerJeff Darcy <>2016-04-28 13:51:12 -0700
commit2f945b86d30eca3a32f5e8e42fbe692ddf4b55be (patch)
tree61765dd2febe2fa5416fdf6e37625e4d66d3f094 /build-aux
parent40e96c17647b281264783520f8fbdd9056332b4c (diff)
rpc: split FOPs enum from glusterfs.h
Moving the enumeration of FOPs and some of the other parts that are defining the network protocol to the rpc/xdr/ section. These structures need some care when modifications are made, moving them out of the common glusterfs.h header helps with that. The protocol definition structures are generated in a new glusterfs-fops header. This file is present in rpc/xdr/src/ and libglusterfs/src/, it is a little ugly, but prevents the need to update all files with the additional -I option for finding the new header file. The generation of the .c and .h files from the .x descriptions needed small modifications to accommodate these changes. The build/xdrgen script was improved slightly for this. The .c and .h files are incorrectly in the $(top_srcdir), instead of $(top_builddir). This is an existing issue, and bug 1330604 has been filed to get that addressed. Change-Id: I98fc8cf7e4b631082c7b203b5a0a77111bec1fb9 BUG: 1328502 Signed-off-by: Niels de Vos <> Reviewed-on: Smoke: Gluster Build System <> CentOS-regression: Gluster Build System <> NetBSD-regression: NetBSD Build System <> Reviewed-by: Jeff Darcy <>
Diffstat (limited to 'build-aux')
1 files changed, 5 insertions, 4 deletions
diff --git a/build-aux/xdrgen b/build-aux/xdrgen
index 0cefc9b4890..010df656377 100755
--- a/build-aux/xdrgen
+++ b/build-aux/xdrgen
@@ -1,5 +1,8 @@
+# error out if an error occurs
+set -e
append_licence_header ()
local src_file=$1;
@@ -7,7 +10,7 @@ append_licence_header ()
cat >$dst_file <<EOF
- Copyright (c) 2007-2014 Red Hat, Inc. <>
+ Copyright (c) 2007-2016 Red Hat, Inc. <>
This file is part of GlusterFS.
This file is licensed to you under your choice of the GNU Lesser
@@ -17,8 +20,6 @@ append_licence_header ()
#include "compat.h"
-#include "xdr-common.h"
-#include "xdr-nfs3.h"
#if defined(__GNUC__)
#if __GNUC__ >= 4
@@ -74,7 +75,7 @@ gen_headers ()
rm -f $hfile;
rpcgen -h -o $hfile $xfile;
# the '#ifdef' part of file should be fixed
- sed -e 's/-/_/g' $hfile > ${hfile}.new && mv ${hfile}.new $hfile;
+ sed -r -e '/#(ifdef|ifndef|define)/s/-/_/g' $hfile > ${hfile}.new && mv ${hfile}.new $hfile;
# Gen header to temp file and append generated file
append_licence_header $hfile $tmp_hfile;
# now move the destination file to actual original file