2
# Copyright (C) 1999-2005 Thorsten Kukuk <kukuk@thkukuk.de>
4
dnl Process this file with autoconf to produce a configure script.
5
AC_INIT(ypserv, 2.18, kukuk@linux-nis.org)
7
AC_CONFIG_SRCDIR([ypserv/ypserv.c])
8
AM_CONFIG_HEADER(config.h)
9
AC_PREFIX_DEFAULT(/usr)
15
test "${prefix}" = "NONE" && prefix="/usr"
16
if test ${prefix} = '/usr'
18
dnl If we use /usr as prefix, use /etc for ypserv.conf
19
if test ${sysconfdir} = '${prefix}/etc'
23
dnl If we use /usr as prefix, use /usr/share/man for manual pages
24
if test ${mandir} = '${prefix}/man'
26
mandir='${prefix}/share/man'
29
dnl Change libexec to lib/yp
30
if test ${libexecdir} = '${exec_prefix}/libexec'
32
libexecdir='${exec_prefix}/lib/yp'
33
if test "${exec_prefix}" = "NONE"
37
YPBINDIR=${exec_prefix}/lib/yp
40
YPBINDIR=${libexecdir}
44
dnl Location of the NIS maps. default: /var/yp
45
AC_ARG_ENABLE(ypmapdir,
46
[ --enable-ypmapdir=path Location of NIS maps [default=/var/yp]],
47
YPMAPDIR=$enableval, YPMAPDIR=/var/yp)
51
if test ${sbindir} = '${exec_prefix}/sbin'
53
if test "${exec_prefix}" = "NONE"
57
SBINDIR=${exec_prefix}/sbin
64
dnl Checks for programs.
72
if eval "test x$GCC = xyes"; then
80
-Wmissing-declarations \
81
-Wmissing-prototypes \
86
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
90
AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
91
cat > conftest.c <<EOF
95
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
96
-o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
107
AC_SUBST(libc_cv_fpie)
109
AC_SUBST(PIE_LDFLAGS)
114
dnl Check for big or little endian system
116
dnl Check for 64bit systems
117
AC_CHECK_SIZEOF(long)
119
dnl Search a awk program
120
AC_PATH_PROGS(AWK, mawk gawk nawk awk, ERROR)
124
echo "ERROR: You must have at last one of the following programs:"
125
echo " mawk, gawk, nawk or awk !"
131
AC_PATH_PROGS(BASH, bash /sbin/sh, /bin/sh)
134
AC_PATH_PROGS(MAKE, gmake make, "", $PATH:/usr/ccs/bin:/usr/local/bin)
138
echo "Warning: No make on this system?"
144
dnl Check for aliases path
145
AC_PATH_PROG(ALIASES, aliases, /etc/mail/aliases, /etc/mail:/etc)
149
dnl Should we use a gethostbyname after gethostname to use FQDN ? default yes
151
[ --disable-fqdn Always use FQDN [default=yes]],
152
USE_PARAM_FQDN=$enableval, USE_PARAM_FQDN=yes)
153
if test "$USE_PARAM_FQDN" = "no"; then
160
dnl Should we allow root to change a password with yppasswd ? default: yes
161
AC_ARG_ENABLE(checkroot,
162
[ --disable-checkroot Disable check for root password [default=yes]],
163
CHECKROOT=$enableval, CHECKROOT=yes)
166
AC_CHECK_LIB(gdbm,gdbm_open,LIBDBM="-lgdbm",LIBDBM="")
167
if test x"" != x"${LIBDBM}"
169
AC_DEFINE(HAVE_LIBGDBM, 1, [Use gdbm library as database])
172
AC_CHECK_FUNCS(dbm_open)
173
if test x$ac_cv_func_dbm_open = xyes
175
AC_DEFINE(HAVE_NDBM, 1, [Use ndbm library as database])
181
if test x$libdb_parameter != xyes
185
You need the GNU GDBM or the Solaris NDBM functions for this package !"
191
AC_CHECK_LIB(xcrypt,crypt,LIBCRYPT="-lxcrypt",LIBCRYPT="")
192
if test -z "$LIBCRYPT" ; then
193
AC_CHECK_LIB(crypt,crypt,LIBCRYPT="-lcrypt",LIBCRYPT="")
194
AC_CHECK_HEADERS(crypt.h)
196
AC_CHECK_HEADERS(xcrypt.h crypt.h)
201
AC_CHECK_LIB(slp,SLPReg,LIBSLP="-lslp",LIBSLP="")
203
if test -n "$LIBSLP" ; then
204
AC_CHECK_HEADERS(slp.h)
205
if test "$ac_cv_header_slp_h" = yes; then
211
AC_CHECK_FUNCS(getrpcport)
212
if test "$ac_cv_func_getrpcport" = no; then
213
AC_CHECK_LIB([rpcsvc], [getrpcport],
214
[ac_cv_func_getrpcport=yes; LIBS="-lrpcsvc $LIBS"])
217
AC_CHECK_LIB(nsl,gethostbyname)
218
AC_CHECK_LIB(socket,socket)
219
AC_CHECK_LIB(resolv, res_gethostbyname, RESOLV="-lresolv", RESOLV="")
220
if test x$RESOLV != x
222
AC_DEFINE(HAVE_RES_GETHOSTBYNAME, 1, [Define if you have the res_gethostbyname function.])
224
AC_CHECK_LIB(resolv+, gethostbyname, RESOLV="-lresolv+", RESOLV="")
228
dnl Checks for header files.
232
AC_CHECK_HEADERS(fcntl.h paths.h sys/file.h sys/time.h syslog.h unistd.h)
233
AC_CHECK_HEADERS(getopt.h shadow.h rpc/clnt_soc.h rpc/svc_soc.h)
234
AC_CHECK_HEADERS(netinet/in.h alloca.h)
235
AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE(in_addr_t,int,[Define to int if you don't have in_addr_t])],[#include <netinet/in.h>])
237
dnl Checks for typedefs, structures, and compiler characteristics.
246
dnl Checks if resultproc_t has been defined
247
AC_MSG_CHECKING(for resultproc_t in rpc/clnt.h)
248
AC_EGREP_HEADER(resultproc_t,rpc/clnt.h,\
249
AC_DEFINE(HAVE_RESULTPROC_T, 1, [Define if the systems has the resultproc_t type.]) AC_MSG_RESULT(yes),\
251
AC_MSG_CHECKING(for resultproc_t in rpc/pmap_clnt.h)
252
AC_EGREP_HEADER(resultproc_t,rpc/pmap_clnt.h,\
253
AC_DEFINE(HAVE_RESULTPROC_T) AC_MSG_RESULT(yes),\
256
dnl Checks for library functions.
259
AC_CHECK_FUNCS(setenv putenv)
260
AC_CHECK_FUNCS(fgetpwent putpwent fgetgrent getspnam)
261
AC_CHECK_FUNCS(inet_aton inet_pton vsyslog lckpwdf)
262
AC_CHECK_FUNCS(strdup strndup strerror strstr strsep stpcpy)
263
AC_CHECK_FUNCS(snprintf asprintf)
264
AC_CHECK_FUNCS(gethostname gettimeofday select socket uname getopt_long)
265
AC_CHECK_FUNCS(_rpc_dtablesize getdtablesize)
266
AC_CHECK_FUNCS(svc_getcaller svc_getrpccaller getline getdelim)
267
AC_CHECK_FUNCS(xdr_domainname xdr_ypxfrstat xdr_ypresp_xfr xdr_ypreq_xfr)
268
AC_CHECK_FUNCS(xdr_ypmap_parms xdr_ypreq_nokey xdr_ypresp_master xdr_mapname)
269
AC_CHECK_FUNCS(xdr_peername xdr_ypstat xdr_ypbind_binding xdr_yppushresp_xfr)
270
AC_CHECK_FUNCS(xdr_yppush_status)
272
AC_OUTPUT(lib/Makefile etc/Makefile ypserv/Makefile ypserv/ypserv.8
273
ypxfr/Makefile ypxfr/ypxfr.8 yppush/Makefile yppush/yppush.8
274
makedbm/Makefile makedbm/makedbm.8
275
revnetgroup/Makefile revnetgroup/revnetgroup.8 Makefile
276
mknetid/Makefile mknetid/mknetid.8 rpc.ypxfrd/Makefile
277
rpc.ypxfrd/rpc.ypxfrd.8 rpc.ypxfrd/ypxfrd.8 rpc.yppasswdd/Makefile
278
rpc.yppasswdd/yppasswdd.8 rpc.yppasswdd/rpc.yppasswdd.8
279
yphelper/Makefile scripts/Makefile scripts/ypxfr_1perhour
280
scripts/ypxfr_1perday scripts/ypxfr_2perday scripts/pwupdate
281
scripts/pwupdate.8 scripts/create_printcap scripts/match_printcap
282
scripts/ypinit scripts/ypinit.8 scripts/ypMakefile)
287
Source code location: ${srcdir}
289
Compiler flags: ${CFLAGS}
291
Preprocessor flags: ${CPPFLAGS}
292
Libraries: ${LIBS} ${LIBDBM} ${LIBCRYPT}
295
NIS map dir: ${YPMAPDIR}
296
Install path prefix: ${prefix}"
297
if test ${sysconfdir} != '${prefix}/etc'
299
echo " Install ypserv.conf in: ${sysconfdir}"
301
echo " Install ypserv.conf in: ${prefix}/etc"
303
echo " Allow root password: ${CHECKROOT}"
304
echo " Use FQDN as master name: ${USE_FQDN}"