aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch
blob: 9504d8e7fbf28f40ac5ff31f3385dffa08463812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
Upstream-Status: Backport

autofs-5.0.7 - make yellow pages support optional

From: Chris Packham <chris.packham@alliedtelesis.co.nz>

If rpcsvc/ypclnt.h is not available don't compile in Yellow Pages
support.
---

 Makefile.conf.in    |    3 +++
 configure           |   16 ++++++++++++++++
 configure.in        |    9 +++++++++
 include/config.h.in |    3 +++
 lib/rpc_subs.c      |    1 -
 modules/Makefile    |    9 +++++++--
 7 files changed, 39 insertions(+), 3 deletions(-)


diff --git a/Makefile.conf.in b/Makefile.conf.in
index 802318b..3766d45 100644
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -43,6 +43,9 @@ NISPLUS = @HAVE_NISPLUS@
 # SMBFS support: yes (1) no (0)
 SMBFS = @HAVE_SMBMOUNT@
 
+# YellowPages support: yes (1) no (0)
+YPCLNT = @HAVE_YPCLNT@
+
 # Support for calling e2fsck when mounting ext2 filesystems
 EXT2FS = @HAVE_E2FSCK@
 
diff --git a/configure b/configure
index 3722a46..cf6428c 100755
--- a/configure
+++ b/configure
@@ -614,6 +614,7 @@ XML_FLAGS
 LIBLDAP
 HAVE_LDAP
 LDAP_FLAGS
+HAVE_YPCLNT
 HAVE_NISPLUS
 EGREP
 GREP
@@ -4575,6 +4576,21 @@ fi
 
 
 
+# YellowPages support?
+HAVE_YPCLNT=0
+ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/ypclnt.h" "ac_cv_header_rpcsvc_ypclnt_h" "$ac_includes_default"
+if test "x$ac_cv_header_rpcsvc_ypclnt_h" = xyes; then :
+  HAVE_YPCLNT=1
+fi
+
+
+
+if test "$HAVE_YPCLNT" = "1"; then
+
+$as_echo "#define HAVE_YPCLNT 1" >>confdefs.h
+
+fi
+
 #
 # OpenLDAP support?  Expect that this may have a special directory...
 #
diff --git a/configure.in b/configure.in
index 90bda62..363c376 100644
--- a/configure.in
+++ b/configure.in
@@ -213,6 +213,15 @@ HAVE_NISPLUS=0
 AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1)
 AC_SUBST(HAVE_NISPLUS)
 
+# YellowPages support?
+HAVE_YPCLNT=0
+AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1)
+AC_SUBST(HAVE_YPCLNT)
+if test "$HAVE_YPCLNT" = "1"; then
+	AC_DEFINE(HAVE_YPCLNT, 1,
+		[Define if using YellowPages])
+fi
+
 #
 # OpenLDAP support?  Expect that this may have a special directory...
 #
diff --git a/include/config.h.in b/include/config.h.in
index 9bdf98a..7f1c5b5 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -72,6 +72,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define if using YellowPages */
+#undef HAVE_YPCLNT
+
 /* Use libxml2 tsd usage workaround */
 #undef LIBXML2_WORKAROUND
 
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index ad1d557..718caf9 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -27,7 +27,6 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <rpcsvc/ypclnt.h>
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <ctype.h>
diff --git a/modules/Makefile b/modules/Makefile
index 939da7c..c5deb24 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -5,13 +5,13 @@
 -include ../Makefile.conf
 include ../Makefile.rules
 
-SRCS :=	lookup_yp.c  lookup_file.c lookup_program.c  lookup_userhome.c \
+SRCS :=	lookup_file.c lookup_program.c  lookup_userhome.c \
 	lookup_multi.c lookup_hosts.c lookup_dir.c \
 	parse_sun.c    \
 	mount_generic.c  mount_nfs.c  mount_afs.c  mount_autofs.c \
 	mount_changer.c  mount_bind.c
 
-MODS :=	lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \
+MODS :=	lookup_file.so lookup_program.so lookup_userhome.so \
 	lookup_multi.so lookup_hosts.so lookup_dir.so \
 	parse_sun.so \
 	mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \
@@ -37,6 +37,11 @@ ifeq ($(NISPLUS), 1)
   MODS += lookup_nisplus.so
 endif
 
+ifeq ($(YPCLNT), 1)
+  SRCS += lookup_yp.c
+  MODS += lookup_yp.so
+endif
+
 ifeq ($(LDAP), 1)
   SRCS += lookup_ldap.c
   MODS += lookup_ldap.so