diff options
author | Nalin Dahyabhai <nalin@dahyabhai.net> | 2011-05-13 14:10:38 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@dahyabhai.net> | 2011-05-13 14:24:07 -0400 |
commit | c96a766171b601d5061b566d5da3794d9df354d2 (patch) | |
tree | 965c207f52ab4087f2a880fe7b2866cb99623790 | |
parent | e5698d42c039b6d7d33af94eb1ee7d4c044625df (diff) | |
download | slapi-nis-c96a766171b601d5061b566d5da3794d9df354d2.tar.gz slapi-nis-c96a766171b601d5061b566d5da3794d9df354d2.tar.xz slapi-nis-c96a766171b601d5061b566d5da3794d9df354d2.zip |
- don't assume that libc will provide yp headers -- build them ourselves
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 46 | ||||
-rw-r--r-- | src/back-nis.c | 4 | ||||
-rw-r--r-- | src/back-sch.c | 4 | ||||
-rw-r--r-- | src/back-shr.c | 4 | ||||
-rw-r--r-- | src/disp-nis.c | 4 | ||||
-rw-r--r-- | src/format.c | 2 | ||||
-rw-r--r-- | src/nis.c | 4 | ||||
-rw-r--r-- | src/plug-nis.c | 4 | ||||
-rw-r--r-- | src/plug-sch.c | 4 | ||||
-rw-r--r-- | src/portmap.c | 4 | ||||
-rw-r--r-- | tests/clients/Makefile.am | 6 | ||||
-rw-r--r-- | tests/clients/yp.c | 5 | ||||
-rw-r--r-- | yp/Makefile.am | 11 | ||||
-rw-r--r-- | yp/yp.x (renamed from rpc/yp.x) | 0 |
15 files changed, 53 insertions, 51 deletions
diff --git a/Makefile.am b/Makefile.am index 8900d48..b1ee711 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST = COPYING NEWS README STATUS slapi-nis.spec doc/*.txt doc/examples/*.ldif.in doc/devel doc/ipa src/nisserver-plugin-defs.1 -SUBDIRS = src tests +SUBDIRS = yp src tests ACLOCAL_AMFLAGS=-I m4 noinst_DATA = $(builddir)/doc/nis-known-maps.txt diff --git a/configure.ac b/configure.ac index 95e3ec4..dc77185 100644 --- a/configure.ac +++ b/configure.ac @@ -123,22 +123,19 @@ AC_SUBST(LIBPTHREAD) AC_ARG_WITH(tirpc, AS_HELP_STRING([--with-tirpc], [use libtirpc]), use_tirpc=$withval, - use_tirpc=no) -if pkg-config libtirpc 2> /dev/null ; then - if test $use_tirpc = yes ; then - AC_DEFINE(HAVE_LIBTIRPC,1,[Define if you have libtirpc.]) - PKG_CHECK_MODULES(TIRPC,libtirpc) - else - RPC_CFLAGS= - RPC_LIBS=-lnsl - fi + [ + AC_CHECK_HEADERS(rpc/xdr.h) + if test x$ac_cv_header_rpc_xdr_h = xno ; then + use_tirpc=yes + else + use_tirpc=no + fi + ]) +if test $use_tirpc = yes ; then + PKG_CHECK_MODULES(TIRPC,libtirpc) else - if test $use_tirpc = yes ; then - PKG_CHECK_MODULES(TIRPC,libtirpc) - else - RPC_CFLAGS= - RPC_LIBS=-lnsl - fi + RPC_CFLAGS= + RPC_LIBS=-lnsl fi AC_SUBST(RPC_CFLAGS) AC_SUBST(RPC_LIBS) @@ -193,14 +190,6 @@ AC_SUBST(mysuffix) myincludedir=`eval echo "$includedir" | sed "s,NONE,${ac_default_prefix},g"` myincludedir=`eval echo "$myincludedir" | sed "s,NONE,${ac_prefix},g"` -AC_MSG_CHECKING([for yp.x]) -if test -s $myincludedir/rpcsvc/yp.x ; then - yp_x_include_dir=$myincludedir -else - yp_x_include_dir=/usr/include -fi -AC_MSG_RESULT($yp_x_include_dir/rpcsvc/yp.x) -AC_SUBST(yp_x_include_dir) AC_ARG_WITH(users, AS_HELP_STRING([--with-users=cn=Users], @@ -309,11 +298,16 @@ AC_SUBST(schentryformatattr) AC_SUBST(groupattr) AC_SUBST(containerattr) +AC_PATH_PROG(RPCGEN,[rpcgen],no-rpcgen,[$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/libexec]) +if test x$RPCGEN = xno-rpcgen ; then + AC_MSG_ERROR([rpcgen needed but not found]) +fi + if test "$server" = dirsrv ; then AC_PATH_PROG(SLAPD,[ns-slapd],no-slapd,[$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/libexec]) - AC_PATH_PROG(RPCGEN,[rpcgen],no-rpcgen,[$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/libexec]) fi -AM_CONDITIONAL(CAN_TEST,[test "$server" = dirsrv && test "$SLAPD" != no-slapd && test "$RPCGEN" != no-rpcgen]) + +AM_CONDITIONAL(CAN_TEST,[test "$server" = dirsrv && test "$SLAPD" != no-slapd]) AC_SUBST(CAN_TEST) test_user=`id -un` AC_SUBST(test_user) @@ -339,7 +333,7 @@ AC_SUBST(NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV) AC_SUBST(TRACE_CMD) AC_CONFIG_HEADER(src/config.h) -AC_OUTPUT(Makefile src/Makefile +AC_OUTPUT(Makefile yp/Makefile src/Makefile doc/examples/nis-plugin-example.ldif doc/examples/sch-plugin-example.ldif tests/Makefile tests/clients/Makefile tests/slapd.sh tests/config/dse.ldif.initial diff --git a/src/back-nis.c b/src/back-nis.c index 360f9ac..906f25a 100644 --- a/src/back-nis.c +++ b/src/back-nis.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Red Hat, Inc. + * Copyright 2008,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #endif #include <rpc/xdr.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #ifdef HAVE_TCPD_H #include <tcpd.h> diff --git a/src/back-sch.c b/src/back-sch.c index f9425fd..a6602c4 100644 --- a/src/back-sch.c +++ b/src/back-sch.c @@ -1,5 +1,5 @@ /* - * Copyright 2008,2009,2010 Red Hat, Inc. + * Copyright 2008,2009,2010,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ #endif #include <rpc/xdr.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #ifdef HAVE_TCPD_H #include <tcpd.h> diff --git a/src/back-shr.c b/src/back-shr.c index 1d700a7..355686b 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -1,5 +1,5 @@ /* - * Copyright 2008,2010 Red Hat, Inc. + * Copyright 2008,2010,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #endif #include <rpc/xdr.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #ifdef HAVE_TCPD_H #include <tcpd.h> diff --git a/src/disp-nis.c b/src/disp-nis.c index 28b55fd..b381e0c 100644 --- a/src/disp-nis.c +++ b/src/disp-nis.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Red Hat, Inc. + * Copyright 2008,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ #endif #include <rpc/rpc.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #include "plugin.h" #include "disp-nis.h" diff --git a/src/format.c b/src/format.c index 0d3df33..51be5e9 100644 --- a/src/format.c +++ b/src/format.c @@ -40,7 +40,7 @@ #include <slapi-plugin.h> #endif -#include <rpcsvc/yp.h> +#include "../yp/yp.h" #include "backend.h" #include "back-shr.h" @@ -1,5 +1,5 @@ /* - * Copyright 2008 Red Hat, Inc. + * Copyright 2008,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ #endif #include <rpc/rpc.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #include "disp-nis.h" #include "map.h" diff --git a/src/plug-nis.c b/src/plug-nis.c index 4db1061..c6fa274 100644 --- a/src/plug-nis.c +++ b/src/plug-nis.c @@ -1,5 +1,5 @@ /* - * Copyright 2008,2009 Red Hat, Inc. + * Copyright 2008,2009,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ #include <unistd.h> #include <rpc/rpc.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #ifdef HAVE_TCPD_H #include <tcpd.h> diff --git a/src/plug-sch.c b/src/plug-sch.c index 7bd121d..e7d4762 100644 --- a/src/plug-sch.c +++ b/src/plug-sch.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Red Hat, Inc. + * Copyright 2008,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ #include <unistd.h> #include <rpc/rpc.h> -#include <rpcsvc/yp_prot.h> +#include "../yp/yp.h" #ifdef HAVE_TCPD_H #include <tcpd.h> diff --git a/src/portmap.c b/src/portmap.c index 12bd34d..6b4a3cd 100644 --- a/src/portmap.c +++ b/src/portmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2008,2009 Red Hat, Inc. + * Copyright 2008,2009,2011 Red Hat, Inc. * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,8 +38,8 @@ #include <slapi-plugin.h> #endif -#include <rpcsvc/yp_prot.h> #include <rpc/xdr.h> +#include "../yp/yp.h" #include <rpc/pmap_prot.h> #include "portmap.h" diff --git a/tests/clients/Makefile.am b/tests/clients/Makefile.am index 923f4dd..2a7dfde 100644 --- a/tests/clients/Makefile.am +++ b/tests/clients/Makefile.am @@ -1,11 +1,7 @@ EXTRA_DIST = ypmaplist.py AM_CFLAGS = @TIRPC_CFLAGS@ @RPC_CFLAGS@ -RPCGEN=@RPCGEN@ if CAN_TEST noinst_PROGRAMS = yp ldifsort -yp_SOURCES = yp.c yp_clnt.c +yp_SOURCES = yp.c ../../yp/yp_clnt.c ../../yp/yp_xdr.c yp_LDADD = @TIRPC_LIBS@ @RPC_LIBS@ -yp_clnt.c: @yp_x_include_dir@/rpcsvc/yp.x - $(RPCGEN) -l $< > $@ -CLEANFILES = yp_clnt.c endif diff --git a/tests/clients/yp.c b/tests/clients/yp.c index dc5c4d5..cdf7b38 100644 --- a/tests/clients/yp.c +++ b/tests/clients/yp.c @@ -25,14 +25,15 @@ #include <netdb.h> #include <netinet/in.h> #include <netinet/tcp.h> -#include <rpc/rpc.h> -#include <rpcsvc/yp.h> #include <getopt.h> #include <stdio.h> #include <string.h> #include <time.h> #include <unistd.h> +#include <rpc/rpc.h> +#include "../../yp/yp.h" + static struct sockaddr_in server; static int connected; diff --git a/yp/Makefile.am b/yp/Makefile.am new file mode 100644 index 0000000..b24e958 --- /dev/null +++ b/yp/Makefile.am @@ -0,0 +1,11 @@ +EXTRA_FILES = yp.x +CLEANFILES = yp.h yp_xdr.c yp_clnt.c + +all: $(CLEANFILES) + +yp.h: yp.x + $(RPCGEN) -h -o $@ $^ +yp_xdr.c: yp.x + $(RPCGEN) -c -o $@ $^ +yp_clnt.c: yp.x + $(RPCGEN) -l -o $@ $^ |