nfs-utils build fixes
Subsystems (2)
cover nfs-utils build fixes
The following series fixes some of the snafus I encountered when trying to build nfs-utils for OpenELEC (meaning: lots of static libraries, cross compile, separate source and build dirs).
Only the first patch is a real patch, the other two are more a basis for discussion since I'm not sure about the best approach...
---
David Härdeman (3):
nfs-utils: fix gssd build flags
[RFC] nfs-utils: change internal rpcgen to support separate builddir [RFC] nfs-utils: include headers from srcdir
configure.ac | 3 +++ tools/rpcgen/rpc_main.c | 7 ++++--- utils/gssd/Makefile.am | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-)
--
David Härdeman
PATCH 1/3 nfs-utils: fix gssd build flags
The tirpc variable is another library to add, not additional flags. I'm guessing the reason this hasn't caused problems is that it only shows up with static libraries.
--- utils/gssd/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
utils/gssd/Makefile.am +2 -2
@@ -46,8 +46,8 @@ gssd_SOURCES = \ write_bytes.h gssd_LDADD = ../../support/nfs/libnfs.a \ - $(RPCSECGSS_LIBS) $(KRBLIBS) $(GSSAPI_LIBS) -gssd_LDFLAGS = $(KRBLDFLAGS) $(LIBTIRPC) + $(RPCSECGSS_LIBS) $(KRBLIBS) $(GSSAPI_LIBS) $(LIBTIRPC) +gssd_LDFLAGS = $(KRBLDFLAGS) gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) $(GSSAPI_CFLAGS)
Re: [PATCH 1/3] nfs-utils: fix gssd build flags
Quoted 5 lines · David Härdeman
The tirpc variable is another library to add, not additional flags. I'm guessing the reason this hasn't caused problems is that it only shows up with static libraries.
Signed-off-by David Härdeman <[email protected]>
Committed...
steved.
Quoted 25 lines
--- utils/gssd/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)utils/gssd/Makefile.am +2
-3@@ -46,8 +46,8 @@ gssd_SOURCES = \ write_bytes.h gssd_LDADD = ../../support/nfs/libnfs.a \ - $(RPCSECGSS_LIBS) $(KRBLIBS) $(GSSAPI_LIBS) -gssd_LDFLAGS = $(KRBLDFLAGS) $(LIBTIRPC) + $(RPCSECGSS_LIBS) $(KRBLIBS) $(GSSAPI_LIBS) $(LIBTIRPC) +gssd_LDFLAGS = $(KRBLDFLAGS) gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) $(GSSAPI_CFLAGS) --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC PATCH 2/3 nfs-utils: change internal rpcgen to support separate builddir
In reply to David Härdemanrpcgen uses absolute paths (based on the input) when generating the output files, thus breaking builds using a separate build directory. I'm not sure this is the best (or even an acceptable) approach, but it works for me...consider it an RFC :)
--- tools/rpcgen/rpc_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tools/rpcgen/rpc_main.c +4 -3
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";#include <unistd.h> #include <ctype.h> #include <errno.h> +#include <libgen.h> #include "rpc_parse.h" #include "rpc_util.h" #include "rpc_scan.h"
@@ -389,7 +390,7 @@ c_output(char *infile, char *define, int extend, char *outfile)open_output (infile, outfilename);add_warning ();if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include);/* .h file already contains rpc/rpc.h */ }else
@@ -523,7 +524,7 @@ s_output(int argc, char **argv, char *infile, char *define, int extend,open_output (infile, outfilename);add_warning ();if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include); }else f_print (fout,"#include <rpc/rpc.h>\n" );
@@ -630,7 +631,7 @@ l_output(char *infile, char *define, int extend, char *outfile)if (Cflag)f_print (fout,"#include <memory.h> /* for memset */\n" );if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include); }else f_print (fout,"#include <rpc/rpc.h>\n" );
Re: [PATCH 2/3] [RFC] nfs-utils: change internal rpcgen to support separate builddir
Quoted 4 lines · David Härdeman
rpcgen uses absolute paths (based on the input) when generating the output files, thus breaking builds using a separate build directory. I'm not sure this is the best (or even an acceptable) approach, but it works for me...consider it an RFC :)
I went ahead committed this as well... I didn't realized the internal rpcgen was being used... So if makes life easier for you... so be it! :-)
steved.
Quoted 49 lines
--- tools/rpcgen/rpc_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/rpcgen/rpc_main.c +4
-4@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";#include <unistd.h> #include <ctype.h> #include <errno.h> +#include <libgen.h> #include "rpc_parse.h" #include "rpc_util.h" #include "rpc_scan.h" @@ -389,7 +390,7 @@ c_output(char *infile, char *define, int extend, char *outfile)open_output (infile, outfilename);add_warning ();if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include);/* .h file already contains rpc/rpc.h */ }else @@ -523,7 +524,7 @@ s_output(int argc, char **argv, char *infile, char *define, int extend,open_output (infile, outfilename);add_warning ();if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include); }else f_print (fout,"#include <rpc/rpc.h>\n" );@@ -630,7 +631,7 @@ l_output(char *infile, char *define, int extend, char *outfile)if (Cflag)f_print (fout,"#include <memory.h> /* for memset */\n" );if (infile && (include =extendfile (infile,".h" ))) { -f_print (fout,"#include \"%s\"\n" , include); +f_print (fout,"#include \"%s\"\n" ,basename (include));free (include); }else f_print (fout,"#include <rpc/rpc.h>\n" ); --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC PATCH 3/3 nfs-utils: include headers from srcdir
In reply to David HärdemanSome of the headers in ./support/include get generated as part of the build process (and end up in the build dir hierarchy) and some are not (so they stay in the srcdir hierarchy).
That means the build breaks when using a separate build dir. I'm not sure what the best way to make sure that -I$(top_srcdir)/support/include is defined everywhere is. Consider this a basis for discussion rather than a real patch. Someone with more autoconf-fu can surely come up with a better solution.
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)
configure.ac +3 -0
@@ -479,6 +479,9 @@ my_am_cflags="-Wall -Wextra -Wstrict-prototypes $ARCHFLAGS -pipe" AC_SUBST([AM_CFLAGS], ["$my_am_cflags"]) +AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/support/include" +AC_SUBST([AM_CPPFLAGS]) + # Make sure that $ACLOCAL_FLAGS are used during a rebuild AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
Re: [PATCH 3/3] [RFC] nfs-utils: include headers from srcdir
Quoted 9 lines · David Härdeman
Some of the headers in ./support/include get generated as part of the build process (and end up in the build dir hierarchy) and some are not (so they stay in the srcdir hierarchy).
That means the build breaks when using a separate build dir. I'm not sure what the best way to make sure that -I$(top_srcdir)/support/include is defined everywhere is. Consider this a basis for discussion rather than a real patch. Someone with more autoconf-fu can surely come up with a better solution.
This one I didn't commit because it caused -I../../support/include to defined twice. That path gets define ing Makefile.in file in the DEFAULT_INCLUDES macro.
steved.
Quoted 24 lines
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)configure.ac +3
-1@@ -479,6 +479,9 @@ my_am_cflags="-Wall -Wextra -Wstrict-prototypes $ARCHFLAGS -pipe" AC_SUBST([AM_CFLAGS], ["$my_am_cflags"]) +AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/support/include" +AC_SUBST([AM_CPPFLAGS]) + # Make sure that $ACLOCAL_FLAGS are used during a rebuild AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] [RFC] nfs-utils: include headers from srcdir
Quoted 11 lines · Steve Dickson
Quoted 9 lines · David Härdeman
Some of the headers in ./support/include get generated as part of the build process (and end up in the build dir hierarchy) and some are not (so they stay in the srcdir hierarchy).
That means the build breaks when using a separate build dir. I'm not sure what the best way to make sure that -I$(top_srcdir)/support/include is defined everywhere is. Consider this a basis for discussion rather than a real patch. Someone with more autoconf-fu can surely come up with a better solution.
Quoted 3 lines
This one I didn't commit because it caused -I../../support/include to defined twice. That path gets define ing Makefile.in file in the
DEFAULT_INCLUDESmacro.
But only if $(top_srcdir) == $(top_builddir)
So, for example, if you do:
cd nfs-utils
mkdir tmp
cd tmp
../configure
make
Then you'd have -I../../support/include and -I../../../support/include?
I think this is in line with:
http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
See the section on AM_CPPFLAGS...
An example from Gutenprint2:AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(LOCAL_CPPFLAGS) $(GNUCFLAGS)
Though a more "complete" fix might be to either have a common include file, or a non-recursive make :)
Signature · 1 line
David Härdeman