nfs-kernel-server: add a host build for rpcgen with the header file fixes, fix patchi...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 13 Feb 2011 15:21:37 +0000 (15:21 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 13 Feb 2011 15:21:37 +0000 (15:21 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@25519 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/nfs-kernel-server/Makefile
net/nfs-kernel-server/patches/001-nfs_utils_uclibc.patch
net/nfs-kernel-server/patches/002-no_ttycom_h.patch [new file with mode: 0644]
net/nfs-kernel-server/patches/003-no_malloc_h.patch [new file with mode: 0644]

index b834c36..3b3b425 100644 (file)
@@ -14,10 +14,13 @@ PKG_MD5SUM:=b0d1b8ec5c8c081a340cfc77bb8670cd
 PKG_SOURCE_URL:=@SF/nfs
 PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
 
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/nfs-utils-$(PKG_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/nfs-utils-$(PKG_VERSION)
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=$(PKG_NAME)/host
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/nfs-kernel-server/Default
@@ -76,7 +79,36 @@ CONFIGURE_ARGS += \
 MAKE_FLAGS += \
        OPT="$(TARGET_CFLAGS)" \
        INSTALLSUID="install -m 4755" \
-       DESTDIR="$(PKG_INSTALL_DIR)"
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       RPCGEN_PATH=$(STAGING_DIR_HOST)/bin/rpcgen \
+       RPCGEN=$(STAGING_DIR_HOST)/bin/rpcgen
+
+HOST_CFLAGS += -Dlinux
+
+HOST_CONFIGURE_ARGS += \
+       --disable-gss \
+       --disable-nfsv4
+
+HOST_CONFIGURE_VARS += \
+       ac_cv_lib_event_event_dispatch=yes \
+       ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes \
+       ac_cv_lib_blkid_blkid_get_library_version=yes \
+       ac_cv_header_event_h=yes \
+       ac_cv_header_nfsidmap_h=yes \
+       ac_cv_header_blkid_blkid_h=yes \
+       GSSGLUE_CFLAGS=" " \
+       GSSGLUE_LIBS=" " \
+       RPCSECGSS_CFLAGS=" " \
+       RPCSECGSS_LIBS=" " \
+
+
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all
+endef
+
+define Host/Install
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOST)/bin/rpcgen
+endef
 
 define Package/nfs-kernel-server/install
        $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
@@ -101,6 +133,7 @@ define Package/nfs-utils/install
        (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,nfs-kernel-server))
 $(eval $(call BuildPackage,nfs-kernel-server-utils))
 $(eval $(call BuildPackage,nfs-utils))
index 8ee831c..9a561e8 100644 (file)
    if (ret == 0 && rpcp != NULL)
      {
        /* First try name.  */
---- a/utils/statd/sm_inter_svc.c
-+++ b/utils/statd/sm_inter_svc.c
-@@ -10,7 +10,9 @@
- #include <stdlib.h>
- #include <netdb.h>
- #include <signal.h>
-+#ifndef __UCLIBC__
- #include <sys/ttycom.h>
-+#endif
- #include <memory.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
diff --git a/net/nfs-kernel-server/patches/002-no_ttycom_h.patch b/net/nfs-kernel-server/patches/002-no_ttycom_h.patch
new file mode 100644 (file)
index 0000000..8db2a07
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/tools/rpcgen/rpc_main.c
++++ b/tools/rpcgen/rpc_main.c
+@@ -545,13 +545,6 @@ s_output(int argc, char **argv, char *in
+         timerflag = 1;
+       }
+-#ifndef linux
+-      if( !tirpcflag && inetdflag )
+-        f_print(fout, "#include <sys/ttycom.h>/* TIOCNOTTY */\n");
+-#else
+-      if( !tirpcflag )
+-        f_print(fout, "#include <sys/ttycom.h>/* TIOCNOTTY */\n");
+-#endif
+       if( Cflag && (inetdflag || pmflag ) ) {
+         f_print(fout, "#ifdef __cplusplus\n");
+         f_print(fout, "#include <sysent.h> /* getdtablesize, open */\n"); 
+--- a/tools/rpcgen/rpc_svcout.c
++++ b/tools/rpcgen/rpc_svcout.c
+@@ -788,7 +788,6 @@ write_rpc_svc_fg(char *infile, char *sp)
+       else {
+         f_print(fout, "%si = open(\"/dev/tty\", 2);\n", sp);
+         f_print(fout, "%sif (i >= 0) {\n", sp);
+-        f_print(fout, "%s\t(void) ioctl(i, TIOCNOTTY, (char *)NULL);\n", sp);;
+         f_print(fout, "%s\t(void) close(i);\n", sp);
+         f_print(fout, "%s}\n", sp);
+       }
diff --git a/net/nfs-kernel-server/patches/003-no_malloc_h.patch b/net/nfs-kernel-server/patches/003-no_malloc_h.patch
new file mode 100644 (file)
index 0000000..4595749
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/tools/rpcgen/rpc_cout.c
++++ b/tools/rpcgen/rpc_cout.c
+@@ -38,7 +38,6 @@ static char sccsid[] = "@(#)rpc_cout.c 1
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <malloc.h>
+ #include <ctype.h>
+ #include "rpc_parse.h"
+ #include "rpc_util.h"