~ubuntu-branches/ubuntu/oneiric/nis/oneiric-proposed

« back to all changes in this revision

Viewing changes to ypserv-2.18/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2005-11-16 23:42:06 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051116234206-p00omaw5ji5q0qhr
Tags: 3.15-3ubuntu1
Resynchronise with Debian.  (me)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Copyright (C) 1999-2005 Thorsten Kukuk <kukuk@thkukuk.de>
 
3
#
 
4
dnl Process this file with autoconf to produce a configure script.
 
5
AC_INIT(ypserv, 2.18, kukuk@linux-nis.org)
 
6
AM_INIT_AUTOMAKE
 
7
AC_CONFIG_SRCDIR([ypserv/ypserv.c])
 
8
AM_CONFIG_HEADER(config.h)
 
9
AC_PREFIX_DEFAULT(/usr)
 
10
 
 
11
AC_SUBST(PACKAGE)
 
12
AC_SUBST(VERSION)
 
13
 
 
14
dnl Some hacks...
 
15
test "${prefix}" = "NONE" && prefix="/usr"
 
16
if test ${prefix} = '/usr'
 
17
then
 
18
dnl If we use /usr as prefix, use /etc for ypserv.conf
 
19
        if test ${sysconfdir} = '${prefix}/etc'
 
20
        then
 
21
           sysconfdir="/etc"
 
22
        fi
 
23
dnl If we use /usr as prefix, use /usr/share/man for manual pages
 
24
        if test ${mandir} = '${prefix}/man'
 
25
        then
 
26
           mandir='${prefix}/share/man'
 
27
        fi
 
28
fi
 
29
dnl Change libexec to lib/yp
 
30
if test ${libexecdir} = '${exec_prefix}/libexec'
 
31
then
 
32
  libexecdir='${exec_prefix}/lib/yp'
 
33
  if test "${exec_prefix}" = "NONE"
 
34
  then
 
35
    YPBINDIR=/usr/lib/yp
 
36
  else
 
37
    YPBINDIR=${exec_prefix}/lib/yp
 
38
  fi
 
39
else
 
40
  YPBINDIR=${libexecdir}
 
41
fi
 
42
AC_SUBST(YPBINDIR)
 
43
 
 
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)
 
48
AC_SUBST(YPMAPDIR)
 
49
 
 
50
 
 
51
if test ${sbindir} = '${exec_prefix}/sbin'
 
52
then
 
53
  if test "${exec_prefix}" = "NONE"
 
54
  then
 
55
    SBINDIR=/usr/sbin
 
56
  else
 
57
    SBINDIR=${exec_prefix}/sbin
 
58
  fi
 
59
else
 
60
  SBINDIR=${sbindir}
 
61
fi
 
62
AC_SUBST(SBINDIR)
 
63
 
 
64
dnl Checks for programs.
 
65
AC_PROG_CC
 
66
AC_ISC_POSIX
 
67
AC_PROG_CPP
 
68
AC_PROG_INSTALL
 
69
AC_PROG_MAKE_SET
 
70
AC_PROG_RANLIB
 
71
 
 
72
if eval "test x$GCC = xyes"; then
 
73
  for flag in \
 
74
      -pedantic \
 
75
      -W \
 
76
      -Wall \
 
77
      -Wbad-function-cast \
 
78
      -Wcast-align \
 
79
      -Wcast-qual \
 
80
      -Wmissing-declarations \
 
81
      -Wmissing-prototypes \
 
82
      -Wpointer-arith \
 
83
      -Wreturn-type \
 
84
      -Wstrict-prototypes 
 
85
  do
 
86
    JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
 
87
  done
 
88
fi
 
89
 
 
90
AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
 
91
  cat > conftest.c <<EOF
 
92
int foo;
 
93
main () { return 0;}
 
94
EOF
 
95
  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
 
96
                              -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
 
97
  then
 
98
    libc_cv_fpie=yes
 
99
    PIE_CFLAGS="-fpie"
 
100
    PIE_LDFLAGS="-pie"
 
101
  else
 
102
    libc_cv_fpie=no
 
103
    PIE_CFLAGS=""
 
104
    PIE_LDFLAGS=""
 
105
  fi
 
106
  rm -f conftest*])
 
107
AC_SUBST(libc_cv_fpie)
 
108
AC_SUBST(PIE_CFLAGS)
 
109
AC_SUBST(PIE_LDFLAGS)
 
110
 
 
111
AM_WITH_DMALLOC
 
112
AM_WITH_EFENCE
 
113
 
 
114
dnl Check for big or little endian system
 
115
AC_C_BIGENDIAN
 
116
dnl Check for 64bit systems
 
117
AC_CHECK_SIZEOF(long)
 
118
 
 
119
dnl Search a awk program
 
120
AC_PATH_PROGS(AWK, mawk gawk nawk awk, ERROR)
 
121
if test $AWK = ERROR
 
122
then
 
123
   echo " "
 
124
   echo "ERROR: You must have at last one of the following programs:"
 
125
   echo "       mawk, gawk, nawk or awk !"
 
126
   echo " "
 
127
   exit
 
128
fi
 
129
 
 
130
dnl Search the bash
 
131
AC_PATH_PROGS(BASH, bash /sbin/sh, /bin/sh)
 
132
 
 
133
dnl Search make
 
134
AC_PATH_PROGS(MAKE, gmake make, "", $PATH:/usr/ccs/bin:/usr/local/bin)
 
135
if test x$MAKE = x
 
136
then
 
137
   echo " "
 
138
   echo "Warning: No make on this system?"
 
139
   echo " "
 
140
   exit
 
141
fi
 
142
AC_SUBST(MAKE)
 
143
 
 
144
dnl Check for aliases path
 
145
AC_PATH_PROG(ALIASES, aliases, /etc/mail/aliases, /etc/mail:/etc)
 
146
 
 
147
 
 
148
 
 
149
dnl Should we use a gethostbyname after gethostname to use FQDN ? default yes
 
150
AC_ARG_ENABLE(fqdn,
 
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
 
154
  USE_FQDN=0
 
155
else
 
156
  USE_FQDN=1
 
157
fi
 
158
AC_SUBST(USE_FQDN)
 
159
 
 
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)
 
164
AC_SUBST(CHECKROOT)
 
165
 
 
166
AC_CHECK_LIB(gdbm,gdbm_open,LIBDBM="-lgdbm",LIBDBM="")
 
167
if test x"" != x"${LIBDBM}"
 
168
then
 
169
        AC_DEFINE(HAVE_LIBGDBM, 1, [Use gdbm library as database])
 
170
        libdb_parameter=yes
 
171
else
 
172
        AC_CHECK_FUNCS(dbm_open)
 
173
        if test x$ac_cv_func_dbm_open = xyes
 
174
        then
 
175
                AC_DEFINE(HAVE_NDBM, 1, [Use ndbm library as database])
 
176
                libdb_parameter=yes
 
177
        fi
 
178
fi
 
179
AC_SUBST(LIBDBM)
 
180
 
 
181
if test x$libdb_parameter != xyes
 
182
then
 
183
  echo "
 
184
 
 
185
 You need the GNU GDBM or the Solaris NDBM functions for this package !"
 
186
  echo ""
 
187
  echo ""
 
188
  exit
 
189
fi
 
190
 
 
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)
 
195
else
 
196
  AC_CHECK_HEADERS(xcrypt.h crypt.h)
 
197
fi
 
198
AC_SUBST(LIBCRYPT)
 
199
 
 
200
USE_SLP=0
 
201
AC_CHECK_LIB(slp,SLPReg,LIBSLP="-lslp",LIBSLP="")
 
202
AC_SUBST(LIBSLP)
 
203
if test -n "$LIBSLP" ; then
 
204
        AC_CHECK_HEADERS(slp.h)
 
205
        if test "$ac_cv_header_slp_h" = yes; then
 
206
          USE_SLP=1
 
207
        fi
 
208
fi
 
209
AC_SUBST(USE_SLP)
 
210
 
 
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"])
 
215
fi
 
216
 
 
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
 
221
then
 
222
        AC_DEFINE(HAVE_RES_GETHOSTBYNAME, 1, [Define if you have the res_gethostbyname function.])
 
223
else
 
224
        AC_CHECK_LIB(resolv+, gethostbyname, RESOLV="-lresolv+", RESOLV="")
 
225
fi
 
226
AC_SUBST(RESOLV)
 
227
 
 
228
dnl Checks for header files.
 
229
AC_HEADER_DIRENT
 
230
AC_HEADER_STDC
 
231
AC_HEADER_SYS_WAIT
 
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>])
 
236
 
 
237
dnl Checks for typedefs, structures, and compiler characteristics.
 
238
AC_C_CONST
 
239
AC_C_INLINE
 
240
AC_C___ATTRIBUTE__
 
241
TYPE_SOCKLEN_T
 
242
AC_TYPE_PID_T
 
243
AC_TYPE_SIZE_T
 
244
AC_HEADER_TIME
 
245
 
 
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),\
 
250
        AC_MSG_RESULT(no))
 
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),\
 
254
        AC_MSG_RESULT(no))
 
255
 
 
256
dnl Checks for library functions.
 
257
AC_FUNC_MEMCMP
 
258
AC_FUNC_VPRINTF
 
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)
 
271
 
 
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)
 
283
 
 
284
echo "
 
285
Configuration:
 
286
 
 
287
  Source code location:   ${srcdir}
 
288
  Compiler:               ${CC}
 
289
  Compiler flags:         ${CFLAGS}
 
290
  Preprocessor:           ${CPP}
 
291
  Preprocessor flags:     ${CPPFLAGS}
 
292
  Libraries:              ${LIBS} ${LIBDBM} ${LIBCRYPT}
 
293
  Awk:                    ${AWK}
 
294
  Shell:                  ${BASH}
 
295
  NIS map dir:            ${YPMAPDIR}
 
296
  Install path prefix:    ${prefix}"
 
297
if test ${sysconfdir} != '${prefix}/etc'
 
298
then
 
299
  echo "  Install ypserv.conf in:  ${sysconfdir}"
 
300
else
 
301
  echo "  Install ypserv.conf in:  ${prefix}/etc"
 
302
fi
 
303
  echo "  Allow root password:     ${CHECKROOT}"
 
304
  echo "  Use FQDN as master name: ${USE_FQDN}"
 
305
echo ""