Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | Upstream-Status: Backport |
| 2 | |
| 3 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 4 | --- |
| 5 | From f30e1ada8326463cc0af048afa058bc2f1dc9370 Mon Sep 17 00:00:00 2001 |
| 6 | From: Theodore Ts'o <tytso@mit.edu> |
| 7 | Date: Tue, 29 Mar 2016 20:48:04 -0400 |
| 8 | Subject: [PATCH] Allow building on systems that do not have rpc header files |
| 9 | |
| 10 | Android's bionic C library doesn't have Sun RPC support. |
| 11 | |
| 12 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> |
| 13 | Signed-off-by: Jan Kara <jack@suse.cz> |
| 14 | --- |
| 15 | Makefile.am | 30 ++++++++++++++++-------------- |
| 16 | quotaops.c | 2 ++ |
| 17 | setquota.c | 2 ++ |
| 18 | 3 files changed, 20 insertions(+), 14 deletions(-) |
| 19 | |
| 20 | diff --git a/Makefile.am b/Makefile.am |
| 21 | index 6d7ea0e..82db99f 100644 |
| 22 | --- a/Makefile.am |
| 23 | +++ b/Makefile.am |
| 24 | @@ -1,7 +1,5 @@ |
| 25 | ACLOCAL_AMFLAGS = -I m4 |
| 26 | |
| 27 | -BUILT_SOURCES = rquota.h rquota.c rquota_clnt.c |
| 28 | - |
| 29 | docdir = $(datadir)/doc/@PACKAGE@ |
| 30 | doc_DATA = \ |
| 31 | README.mailserver \ |
| 32 | @@ -12,11 +10,6 @@ doc_DATA = \ |
| 33 | doc/quotas.preformated \ |
| 34 | doc/quotas-1.eps |
| 35 | |
| 36 | -rpcsvcdir = $(includedir)/rpcsvc |
| 37 | -rpcsvc_DATA = \ |
| 38 | - rquota.h \ |
| 39 | - rquota.x |
| 40 | - |
| 41 | sysconf_DATA = \ |
| 42 | warnquota.conf \ |
| 43 | quotatab \ |
| 44 | @@ -35,15 +28,12 @@ man_MANS = \ |
| 45 | quota.1 \ |
| 46 | quot.8 \ |
| 47 | repquota.8 \ |
| 48 | - rpc.rquotad.8 \ |
| 49 | rquota.3 \ |
| 50 | setquota.8 \ |
| 51 | warnquota.conf.5 \ |
| 52 | warnquota.8 \ |
| 53 | xqmstats.8 |
| 54 | |
| 55 | -CLEANFILES = rquota.c rquota.h rquota_clnt.c |
| 56 | - |
| 57 | SUBDIRS = po |
| 58 | |
| 59 | EXTRA_DIST = \ |
| 60 | @@ -55,9 +45,15 @@ EXTRA_DIST = \ |
| 61 | Changelog \ |
| 62 | ldap-scripts |
| 63 | |
| 64 | -noinst_LIBRARIES = \ |
| 65 | - libquota.a \ |
| 66 | - librpcclient.a |
| 67 | +noinst_LIBRARIES = libquota.a |
| 68 | + |
| 69 | +if WITH_RPC |
| 70 | +rpcsvcdir = $(includedir)/rpcsvc |
| 71 | +rpcsvc_DATA = \ |
| 72 | + rquota.h \ |
| 73 | + rquota.x |
| 74 | + |
| 75 | +noinst_LIBRARIES += librpcclient.a |
| 76 | |
| 77 | librpcclient_a_SOURCES = \ |
| 78 | rquota.c \ |
| 79 | @@ -67,8 +63,10 @@ librpcclient_a_SOURCES = \ |
| 80 | rquota_clnt.c |
| 81 | librpcclient_a_CFLAGS = -Wno-unused |
| 82 | |
| 83 | -if WITH_RPC |
| 84 | RPCLIBS = librpcclient.a |
| 85 | +BUILT_SOURCES = rquota.h rquota.c rquota_clnt.c |
| 86 | +CLEANFILES = rquota.c rquota.h rquota_clnt.c |
| 87 | +man_MANS += rpc.rquotad.8 |
| 88 | endif |
| 89 | |
| 90 | libquota_a_SOURCES = \ |
| 91 | @@ -217,6 +215,7 @@ convertquota_LDADD = \ |
| 92 | libquota.a \ |
| 93 | $(RPCLIBS) |
| 94 | |
| 95 | +if WITH_RPC |
| 96 | rpc_rquotad_SOURCES = \ |
| 97 | rquota_server.c \ |
| 98 | rquota_svc.c \ |
| 99 | @@ -225,6 +224,7 @@ rpc_rquotad_LDADD = \ |
| 100 | libquota.a \ |
| 101 | $(WRAP_LIBS) \ |
| 102 | $(RPCLIBS) |
| 103 | +endif |
| 104 | |
| 105 | quota_nld_SOURCES = quota_nld.c |
| 106 | quota_nld_CFLAGS = \ |
| 107 | @@ -236,6 +236,7 @@ quota_nld_LDADD = \ |
| 108 | $(DBUS_LIBS) \ |
| 109 | $(LIBNL3_LIBS) |
| 110 | |
| 111 | +if WITH_RPC |
| 112 | # ------------------ |
| 113 | # Rpcgen conversions |
| 114 | # ------------------ |
| 115 | @@ -250,6 +251,7 @@ quota_nld_LDADD = \ |
| 116 | rquota_clnt.c: rquota.x |
| 117 | @rm -f $@ |
| 118 | @$(RPCGEN) -l -o $@ $< |
| 119 | +endif |
| 120 | |
| 121 | # -------- |
| 122 | # Quotaoff |
| 123 | diff --git a/quotaops.c b/quotaops.c |
| 124 | index 47ef9a7..136aec3 100644 |
| 125 | --- a/quotaops.c |
| 126 | +++ b/quotaops.c |
| 127 | @@ -34,7 +34,9 @@ |
| 128 | |
| 129 | #include "config.h" |
| 130 | |
| 131 | +#if defined(RPC) |
| 132 | #include <rpc/rpc.h> |
| 133 | +#endif |
| 134 | #include <sys/types.h> |
| 135 | #include <sys/stat.h> |
| 136 | #include <sys/file.h> |
| 137 | diff --git a/setquota.c b/setquota.c |
| 138 | index 51d7b3c..8ecd9c3 100644 |
| 139 | --- a/setquota.c |
| 140 | +++ b/setquota.c |
| 141 | @@ -7,7 +7,9 @@ |
| 142 | |
| 143 | #include "config.h" |
| 144 | |
| 145 | +#if defined(RPC) |
| 146 | #include <rpc/rpc.h> |
| 147 | +#endif |
| 148 | #include <sys/types.h> |
| 149 | #include <errno.h> |
| 150 | #include <stdio.h> |
| 151 | -- |
| 152 | 2.6.1 |
| 153 | |