diff options
author | Kaleb S KEITHLEY <kkeithle@redhat.com> | 2016-04-26 17:04:04 -0400 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-09-18 09:34:37 -0700 |
commit | e38dff5b4e0f0a25db664810fc3617eac44673ce (patch) | |
tree | 5f8f8d62051c145c271bf76c55bac41f116c0a9c /xlators/experimental | |
parent | 09ce988ad6d8e0576f1fc23abf71b43ac4b7514e (diff) |
build: out-of-tree builds generates files in the wrong directory
And minor cleanup of a few of the Makefile.am files while we're
at it.
Rewrite the make rules to do what xdrgen does. Now we can get rid
of xdrgen.
Note 1. netbsd6's sed doesn't do -i. Why are we still running
smoke tests on netbsd6 and not netbsd7? We barely support netbsd7
as it is.
Note 2. Why is/was libgfxdr.so (.../rpc/xdr/src/...) linked with
libglusterfs? A cut-and-paste mistake? It has no references to
symbols in libglusterfs.
Note3. "/#ifndef\|#define\|#endif/" (note the '\'s) is a _basic_
regex that matches the same lines as the _extended_ regex
"/#(ifndef|define|endif)/". To match the extended regex sed needs to
be run with -r on Linux; with -E on *BSD. However NetBSD's and
FreeBSD's sed helpfully also provide -r for compatibility. Using a
basic regex avoids having to use a kludge in order to run sed with
the correct option on OS X.
Note 4. Not copying the bit of xdrgen that inserts copyright/license
boilerplate. AFAIK it's silly to pretend that machine generated
files like these can be copyrighted or need license boilerplate.
The XDR source files have their own copyright and license; and
their copyrights are bound to be more up to date than old
boilerplate inserted by a script. From what I've seen of other
Open Source projects -- e.g. gcc and its C parser files generated
by yacc and lex -- IIRC they don't bother to add copyright/license
boilerplate to their generated files.
It appears that it's a long-standing feature of make (SysV, BSD,
gnu) for out-of-tree builds to helpfully pretend that the source
files it can find in the VPATH "exist" as if they are in the $cwd.
rpcgen doesn't work well in this situation and generates files
with "bad" #include directives.
E.g. if you `rpcgen ../../../../$srcdir/rpc/xdr/src/glusterfs3-xdr.x`,
you get an #include directive in the generated .c file like this:
...
#include "../../../../$srcdir/rpc/xdr/src/glusterfs3-xdr.h"
...
which (obviously) results in compile errors on out-of-tree build
because the (generated) header file doesn't exist at that location.
Compared to `rpcgen ./glusterfs3-xdr.x` where you get:
...
#include "glusterfs3-xdr.h"
...
Which is what we need. We have to resort to some Stupid Make Tricks
like the addition of various .PHONY targets to work around the VPATH
"help".
Warning: When doing an in-tree build, -I$(top_builddir)/rpc/xdr/...
looks exactly like -I$(top_srcdir)/rpc/xdr/... Don't be fooled though.
And don't delete the -I$(top_builddir)/rpc/xdr/... bits
Change-Id: Iba6ab96b2d0a17c5a7e9f92233993b318858b62e
BUG: 1330604
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/14085
Tested-by: Niels de Vos <ndevos@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/experimental')
-rw-r--r-- | xlators/experimental/dht2/dht2-client/src/Makefile.am | 2 | ||||
-rw-r--r-- | xlators/experimental/dht2/dht2-server/src/Makefile.am | 2 | ||||
-rw-r--r-- | xlators/experimental/fdl/src/Makefile.am | 11 | ||||
-rw-r--r-- | xlators/experimental/jbr-client/src/Makefile.am | 12 | ||||
-rw-r--r-- | xlators/experimental/jbr-server/src/Makefile.am | 12 | ||||
-rw-r--r-- | xlators/experimental/posix2/common/src/Makefile.am | 5 | ||||
-rw-r--r-- | xlators/experimental/posix2/ds/src/Makefile.am | 4 | ||||
-rw-r--r-- | xlators/experimental/posix2/mds/src/Makefile.am | 4 |
8 files changed, 32 insertions, 20 deletions
diff --git a/xlators/experimental/dht2/dht2-client/src/Makefile.am b/xlators/experimental/dht2/dht2-client/src/Makefile.am index 39132994d08..a16b9df2f76 100644 --- a/xlators/experimental/dht2/dht2-client/src/Makefile.am +++ b/xlators/experimental/dht2/dht2-client/src/Makefile.am @@ -14,6 +14,8 @@ AM_CFLAGS = -Wall $(GF_CFLAGS) AM_CPPFLAGS = $(GF_CPPFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/xlators/experimental/dht2/dht2-common/src/ AM_CPPFLAGS += -I$(top_srcdir)/libglusterfs/src +AM_CPPFLAGS += -I$(top_srcdir)/rpc/xdr/src +AM_CPPFLAGS += -I$(top_builddir)/rpc/xdr/src AM_CPPFLAGS += -I$(top_srcdir)/xlators/lib/src CLEANFILES = diff --git a/xlators/experimental/dht2/dht2-server/src/Makefile.am b/xlators/experimental/dht2/dht2-server/src/Makefile.am index 4f721551020..808c724ec9e 100644 --- a/xlators/experimental/dht2/dht2-server/src/Makefile.am +++ b/xlators/experimental/dht2/dht2-server/src/Makefile.am @@ -14,6 +14,8 @@ AM_CFLAGS = -Wall $(GF_CFLAGS) AM_CPPFLAGS = $(GF_CPPFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/xlators/experimental/dht2/dht2-common/src/ AM_CPPFLAGS += -I$(top_srcdir)/libglusterfs/src +AM_CPPFLAGS += -I$(top_srcdir)/rpc/xdr/src +AM_CPPFLAGS += -I$(top_builddir)/rpc/xdr/src AM_CPPFLAGS += -I$(top_srcdir)/xlators/lib/src CLEANFILES = diff --git a/xlators/experimental/fdl/src/Makefile.am b/xlators/experimental/fdl/src/Makefile.am index aed0204284f..9ec9d4f06ff 100644 --- a/xlators/experimental/fdl/src/Makefile.am +++ b/xlators/experimental/fdl/src/Makefile.am @@ -11,19 +11,20 @@ sbin_PROGRAMS = gf_logdump gf_recon gf_logdump_SOURCES = logdump.c nodist_gf_logdump_SOURCES = libfdl.c gf_logdump_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la\ - $(top_builddir)/api/src/libgfapi.la + $(top_builddir)/api/src/libgfapi.la # Eventually recon(ciliation) code will move elsewhere, but for now it's # easier to have it next to the similar logdump code. gf_recon_SOURCES = recon.c nodist_gf_recon_SOURCES = librecon.c gf_recon_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la\ - $(top_builddir)/api/src/libgfapi.la + $(top_builddir)/api/src/libgfapi.la AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \ - -I$(top_srcdir)/api/src -fPIC \ - -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS) \ - -DDATADIR=\"$(localstatedir)\" + -I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \ + -I$(top_srcdir)/api/src -fPIC \ + -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS) \ + -DDATADIR=\"$(localstatedir)\" AM_CFLAGS = -Wall $(GF_CFLAGS) diff --git a/xlators/experimental/jbr-client/src/Makefile.am b/xlators/experimental/jbr-client/src/Makefile.am index 58f399f0607..a20c9944b92 100644 --- a/xlators/experimental/jbr-client/src/Makefile.am +++ b/xlators/experimental/jbr-client/src/Makefile.am @@ -7,13 +7,13 @@ CLEANFILES = $(nodist_jbrc_la_SOURCES) jbrc_la_LDFLAGS = -module -avoid-version jbrc_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -noinst_HEADERS = \ - $(top_srcdir)/xlators/lib/src/libxlator.h \ - $(top_srcdir)/glusterfsd/src/glusterfsd.h \ - jbrc.h jbr-messages.h +noinst_HEADERS = $(top_srcdir)/xlators/lib/src/libxlator.h \ + $(top_srcdir)/glusterfsd/src/glusterfsd.h \ + jbrc.h jbr-messages.h -AM_CPPFLAGS = $(GF_CPPFLAGS) \ - -I$(top_srcdir)/libglusterfs/src -I$(top_srcdir)/xlators/lib/src \ +AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \ + -I$(top_srcdir)/xlators/lib/src \ + -I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \ -I$(top_srcdir)/rpc/rpc-lib/src AM_CFLAGS = -Wall $(GF_CFLAGS) diff --git a/xlators/experimental/jbr-server/src/Makefile.am b/xlators/experimental/jbr-server/src/Makefile.am index 66f73ba8c96..5d6209d709a 100644 --- a/xlators/experimental/jbr-server/src/Makefile.am +++ b/xlators/experimental/jbr-server/src/Makefile.am @@ -12,12 +12,12 @@ noinst_HEADERS = jbr-internal.h \ $(top_srcdir)/xlators/lib/src/libxlator.h \ $(top_srcdir)/glusterfsd/src/glusterfsd.h -AM_CPPFLAGS = $(GF_CPPFLAGS) \ - -I$(top_srcdir)/libglusterfs/src \ - -I$(top_srcdir)/xlators/lib/src \ - -I$(top_srcdir)/rpc/rpc-lib/src -DSBIN_DIR=\"$(sbindir)\" \ - -I$(top_srcdir)/api/src -DJBR_SCRIPT_PREFIX=\"$(jbrdir)\" \ - -I$(top_srcdir)/xlators/experimental/jbr-client/src/ +AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \ + -I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \ + -I$(top_srcdir)/xlators/lib/src -I$(top_srcdir)/rpc/rpc-lib/src \ + -DSBIN_DIR=\"$(sbindir)\" -I$(top_srcdir)/api/src \ + -DJBR_SCRIPT_PREFIX=\"$(jbrdir)\" \ + -I$(top_srcdir)/xlators/experimental/jbr-client/src/ AM_CFLAGS = -Wall $(GF_CFLAGS) diff --git a/xlators/experimental/posix2/common/src/Makefile.am b/xlators/experimental/posix2/common/src/Makefile.am index 465f2f2ba32..07533d2bf37 100644 --- a/xlators/experimental/posix2/common/src/Makefile.am +++ b/xlators/experimental/posix2/common/src/Makefile.am @@ -9,5 +9,8 @@ libposix2common_la_CFLAGS = -Wall $(GF_CFLAGS) libposix2common_la_CPPFLAGS = $(GF_CPPFLAGS) libposix2common_la_CPPFLAGS += -I$(top_srcdir)/libglusterfs/src +libposix2common_la_CPPFLAGS += -I$(top_srcdir)/rpc/xdr/src +libposix2common_la_CPPFLAGS += -I$(top_builddir)/rpc/xdr/src -CLEANFILES =
\ No newline at end of file + +CLEANFILES = diff --git a/xlators/experimental/posix2/ds/src/Makefile.am b/xlators/experimental/posix2/ds/src/Makefile.am index d29c5e135a2..7b9e2739fc8 100644 --- a/xlators/experimental/posix2/ds/src/Makefile.am +++ b/xlators/experimental/posix2/ds/src/Makefile.am @@ -14,5 +14,7 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/xlators/storage/posix2/common/src AM_CPPFLAGS += -I$(top_srcdir)/libglusterfs/src AM_CPPFLAGS += -I$(top_srcdir)/xlators/lib/src +AM_CPPFLAGS += -I$(top_srcdir)/rpc/xdr/src +AM_CPPFLAGS += -I$(top_builddir)/rpc/xdr/src -CLEANFILES =
\ No newline at end of file +CLEANFILES = diff --git a/xlators/experimental/posix2/mds/src/Makefile.am b/xlators/experimental/posix2/mds/src/Makefile.am index ddd49ef0012..fce1871b01a 100644 --- a/xlators/experimental/posix2/mds/src/Makefile.am +++ b/xlators/experimental/posix2/mds/src/Makefile.am @@ -14,5 +14,7 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/xlators/storage/posix2/common/src AM_CPPFLAGS += -I$(top_srcdir)/libglusterfs/src AM_CPPFLAGS += -I$(top_srcdir)/xlators/lib/src +AM_CPPFLAGS += -I$(top_srcdir)/rpc/xdr/src +AM_CPPFLAGS += -I$(top_builddir)/rpc/xdr/src -CLEANFILES =
\ No newline at end of file +CLEANFILES = |