]> andersk Git - openssh.git/blob - configure.in
- Configure fix from Hiroshi Takekawa <takekawa@sr3.t.u-tokyo.ac.jp>
[openssh.git] / configure.in
1 AC_INIT(ssh.c)
2
3 AC_CONFIG_HEADER(config.h)
4 AC_CANONICAL_HOST
5
6 # C Compiler features
7 if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
8 AC_C_INLINE
9
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_CPP
13 AC_PROG_RANLIB
14 AC_PROG_INSTALL
15 AC_CHECK_PROG(AR, ar, ar)
16 AC_PATH_PROG(PERL, perl)
17 AC_SUBST(PERL)
18
19 # Check for some target-specific stuff
20 case "$host" in
21 *-*-aix*)
22         AFS_LIBS="-lld"
23         AC_DEFINE(BROKEN_GETADDRINFO)
24         ;;
25 *-*-hpux10*)
26         if test -z "$GCC"; then
27                 CFLAGS="$CFLAGS -Aa"
28         fi
29         CFLAGS="$CFLAGS -D_HPUX_SOURCE"
30         AC_DEFINE(IPADDR_IN_DISPLAY)
31         AC_DEFINE(USE_UTMPX)
32         AC_MSG_CHECKING(for HPUX trusted system password database)
33         if test -f /tcb/files/auth/system/default; then
34                 AC_MSG_RESULT(yes)
35                 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
36                 LIBS="$LIBS -lsec"
37                 AC_MSG_WARN([This configuration is untested])
38         else
39                 AC_MSG_RESULT(no)
40                 AC_DEFINE(DISABLE_SHADOW)
41         fi
42         MANTYPE='$(CATMAN)'
43         mansubdir=cat
44         ;;
45 *-*-irix5*)
46         MANTYPE='$(CATMAN)'
47         no_libsocket=1
48         no_libnsl=1
49         ;;
50 *-*-irix6*)
51         MANTYPE='$(CATMAN)'
52         AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
53         no_libsocket=1
54         no_libnsl=1
55         ;;
56 *-*-linux*)
57         no_dev_ptmx=1
58         need_pty_removed_on_close=1
59         ;;
60 *-*-netbsd*)
61         need_dash_r=1
62         ;;
63 *-*-solaris*)
64         need_dash_r=1
65         LDFLAGS="-L/usr/ucblib"
66         AC_DEFINE(USE_UTMPX)
67         ;;
68 *-*-sysv*)
69         AC_DEFINE(USE_UTMPX)
70         MANTYPE='$(CATMAN)'
71         mansubdir=cat
72         LIBS="$LIBS -lgen -lsocket"
73         ;;
74 esac
75
76 # Checks for libraries.
77 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
78 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
79
80 if test -z "$no_libsocket" ; then
81         AC_CHECK_LIB(nsl, yp_match, , )
82 fi
83 if test -z "$no_libnsl" ; then
84         AC_CHECK_LIB(socket, main, , )
85 fi
86
87 # Checks for header files.
88 AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h)
89
90 # Checks for library functions.
91 AC_CHECK_FUNCS(arc4random bindresvport_af freeaddrinfo gai_strerror getaddrinfo getnameinfo innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty)
92
93 AC_CHECK_FUNC(login, 
94         [AC_DEFINE(HAVE_LOGIN)],
95         [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
96 )
97
98 AC_CHECK_FUNC(daemon, 
99         [AC_DEFINE(HAVE_DAEMON)],
100         [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
101 )
102
103 AC_CHECK_FUNC(getpagesize, 
104         [AC_DEFINE(HAVE_GETPAGESIZE)],
105         [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
106 )
107
108 AC_ARG_WITH(pam,
109         [  --without-pam           Disable PAM support ],
110         [
111                 if test "x$withval" = "xno" ; then
112                         no_pam=1
113                         AC_DEFINE(DISABLE_PAM)
114                 fi
115         ]
116 )
117 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
118         AC_CHECK_LIB(dl, dlopen, , )
119         LIBS="$LIBS -lpam"
120
121         # Check PAM strerror arguments (old PAM)
122         AC_MSG_CHECKING([whether pam_strerror takes only one argument])
123         AC_TRY_COMPILE(
124                 [
125                         #include <stdlib.h>
126                         #include <security/pam_appl.h>
127                 ], 
128                 [(void)pam_strerror((pam_handle_t *)NULL, -1);], 
129                 [AC_MSG_RESULT(no)],
130                 [
131                         AC_DEFINE(HAVE_OLD_PAM)
132                         AC_MSG_RESULT(yes)
133                 ]
134         ) 
135 fi
136
137 # The big search for OpenSSL
138 AC_ARG_WITH(ssl-dir,
139         [  --with-ssl-dir=PATH     Specify path to OpenSSL installation ],
140         [
141                 if test "x$withval" != "$xno" ; then
142                         tryssldir=$withval
143                 fi
144         ]
145 )
146
147 saved_LIBS="$LIBS"
148 saved_CFLAGS="$CFLAGS"
149 if test "x$prefix" != "xNONE" ; then
150         tryssldir="$tryssldir $prefix"
151 fi
152 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
153 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
154         if test ! -z "$ssldir" ; then
155                 LIBS="$saved_LIBS -L$ssldir"
156                 CFLAGS="$CFLAGS -I$ssldir/include"
157                 if test "x$need_dash_r" = "x1" ; then
158                         LIBS="$LIBS -R$ssldir/lib"
159                 fi
160         fi
161         LIBS="$LIBS -lcrypto"
162
163         AC_TRY_RUN(
164                 [
165                         #include <openssl/rsa.h>
166                         #include <openssl/bn.h>
167                         #include <openssl/sha.h>
168                         int main(void) 
169                         {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
170                         RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
171                         return(key==NULL);}
172                 ],
173                 [
174                         AC_DEFINE(HAVE_OPENSSL)
175                         found_crypto=1
176                         break;
177                 ], []
178         )
179         AC_TRY_RUN(
180                 [
181                         #include <ssl/rsa.h>
182                         #include <ssl/bn.h>
183                         #include <ssl/sha.h>
184                         int main(void) 
185                         {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
186                         RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
187                         return(key==NULL);}
188                 ],
189                 [
190                         AC_DEFINE(HAVE_SSL)
191                         found_crypto=1
192                         break;
193                 ], []
194         )
195 done
196
197 if test -z "$found_crypto" ; then
198         AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])       
199 fi
200 if test -z "$ssldir" ; then
201         ssldir="(system)"
202 else
203         CFLAGS="$CFLAGS -I$ssldir/include"
204         LDFLAGS="$LDFLAGS -L$ssldir/lib"
205         if test "x$need_dash_r" = "x1" ; then
206                 LDFLAGS="$LDFLAGS -R$ssldir"
207         fi
208 fi
209 LIBS="$saved_LIBS -lcrypto"
210 AC_MSG_RESULT($ssldir)
211
212 # Checks for data types
213 AC_CHECK_SIZEOF(char, 1)
214 AC_CHECK_SIZEOF(short int, 2)
215 AC_CHECK_SIZEOF(int, 4)
216 AC_CHECK_SIZEOF(long int, 4)
217 AC_CHECK_SIZEOF(long long int, 8)
218
219 # More checks for data types
220 AC_MSG_CHECKING([for intXX_t types])
221 AC_TRY_COMPILE(
222         [#include <sys/types.h>], 
223         [int16_t a; int32_t b; a = 1235; b = 1235;], 
224         [
225                 AC_DEFINE(HAVE_INTXX_T)
226                 AC_MSG_RESULT(yes)
227                 have_intxx_t=1
228         ],
229         [AC_MSG_RESULT(no)]
230
231
232 AC_MSG_CHECKING([for u_intXX_t types])
233 AC_TRY_COMPILE(
234         [#include <sys/types.h>], 
235         [u_int16_t c; u_int32_t d; c = 1235; d = 1235;], 
236         [
237                 AC_DEFINE(HAVE_U_INTXX_T)
238                 AC_MSG_RESULT(yes)
239                 have_u_intxx_t=1
240         ],
241         [AC_MSG_RESULT(no)]
242
243
244 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
245            "x$ac_cv_header_sys_bitypes_h" = "xyes"
246 then
247         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
248         AC_TRY_COMPILE(
249                 [#include <sys/bitypes.h>], 
250                 [
251                         u_int16_t c; u_int32_t d; 
252                         int16_t e; int32_t f;
253                         c = 1235; d = 1235;
254                         e = 1235; f = 1235;
255                 ], 
256                 [
257                         AC_DEFINE(HAVE_U_INTXX_T)
258                         AC_DEFINE(HAVE_INTXX_T)
259                         AC_MSG_RESULT(yes)
260                 ],
261                 [AC_MSG_RESULT(no)]
262         ) 
263 fi
264
265 AC_MSG_CHECKING([for uintXX_t types])
266 AC_TRY_COMPILE(
267         [#include <sys/types.h>], 
268         [uint16_t c; uint32_t d; c = 1235; d = 1235;], 
269         [
270                 AC_DEFINE(HAVE_UINTXX_T)
271                 AC_MSG_RESULT(yes)
272         ],
273         [AC_MSG_RESULT(no)]
274
275
276 AC_MSG_CHECKING([for socklen_t])
277 AC_TRY_COMPILE(
278         [
279                 #include <sys/types.h>
280                 #include <sys/socket.h>
281         ],
282         [socklen_t foo; foo = 1235;],
283         [
284                 AC_DEFINE(HAVE_SOCKLEN_T)
285                 AC_MSG_RESULT(yes)
286         ],
287         [AC_MSG_RESULT(no)]
288 )
289
290 AC_MSG_CHECKING([for size_t])
291 AC_TRY_COMPILE(
292         [#include <sys/types.h>],
293         [size_t foo; foo = 1235;],
294         [
295                 AC_DEFINE(HAVE_SIZE_T)
296                 AC_MSG_RESULT(yes)
297         ],
298         [AC_MSG_RESULT(no)]
299 )
300
301 AC_MSG_CHECKING([for struct sockaddr_storage])
302 AC_TRY_COMPILE(
303         [
304                 #include <sys/types.h>
305                 #include <sys/socket.h>
306         ],
307         [struct sockaddr_storage s;],
308         [
309                 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
310                 AC_MSG_RESULT(yes)
311         ],
312         [AC_MSG_RESULT(no)]
313 )
314
315 AC_MSG_CHECKING([for struct sockaddr_in6])
316 AC_TRY_COMPILE(
317         [#include <netinet/in.h>],
318         [struct sockaddr_in6 s; s.sin6_family = 0;],
319         [
320                 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
321                 AC_MSG_RESULT(yes)
322         ],
323         [AC_MSG_RESULT(no)]
324 )
325
326 AC_MSG_CHECKING([for struct in6_addr])
327 AC_TRY_COMPILE(
328         [#include <netinet/in.h>],
329         [struct in6_addr s; s.s6_addr[0] = 0;],
330         [
331                 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
332                 AC_MSG_RESULT(yes)
333         ],
334         [AC_MSG_RESULT(no)]
335 )
336
337 AC_MSG_CHECKING([for struct addrinfo])
338 AC_TRY_COMPILE(
339         [
340                 #include <sys/types.h>
341                 #include <sys/socket.h>
342                 #include <netdb.h>
343         ],
344         [struct addrinfo s; s.ai_flags = AI_PASSIVE;],
345         [
346                 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
347                 AC_MSG_RESULT(yes)
348         ],
349         [AC_MSG_RESULT(no)]
350 )
351
352 # Checks for structure members
353 AC_MSG_CHECKING([whether utmp.h has ut_host field])
354 AC_EGREP_HEADER(ut_host, utmp.h, 
355         [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], 
356         [AC_MSG_RESULT(no)]
357 )
358 AC_MSG_CHECKING([whether utmpx.h has ut_host field])
359 AC_EGREP_HEADER(ut_host, utmpx.h, 
360         [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], 
361         [AC_MSG_RESULT(no)]
362 )
363 AC_MSG_CHECKING([whether utmpx.h has syslen field])
364 AC_EGREP_HEADER(syslen, utmpx.h, 
365         [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], 
366         [AC_MSG_RESULT(no)]
367 )
368 AC_MSG_CHECKING([whether utmp.h has ut_pid field])
369 AC_EGREP_HEADER(ut_pid, utmp.h, 
370         [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], 
371         [AC_MSG_RESULT(no)]
372 )
373 AC_MSG_CHECKING([whether utmp.h has ut_type field])
374 AC_EGREP_HEADER(ut_type, utmp.h, 
375         [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], 
376         [AC_MSG_RESULT(no)]
377 )
378 AC_MSG_CHECKING([whether utmp.h has ut_tv field])
379 AC_EGREP_HEADER(ut_tv, utmp.h, 
380         [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], 
381         [AC_MSG_RESULT(no)]
382 )
383 AC_MSG_CHECKING([whether utmp.h has ut_id field])
384 AC_EGREP_HEADER(ut_id, utmp.h, 
385         [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], 
386         [AC_MSG_RESULT(no)]
387 )
388 AC_MSG_CHECKING([whether utmp.h has ut_addr field])
389 AC_EGREP_HEADER(ut_addr, utmp.h, 
390         [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ], 
391         [AC_MSG_RESULT(no)]
392 )
393 AC_MSG_CHECKING([whether utmpx.h has ut_addr field])
394 AC_EGREP_HEADER(ut_addr, utmpx.h, 
395         [AC_DEFINE(HAVE_ADDR_IN_UTMPX) AC_MSG_RESULT(yes); ], 
396         [AC_MSG_RESULT(no)]
397 )
398 AC_MSG_CHECKING([whether utmp.h has ut_addr_v6 field])
399 AC_EGREP_HEADER(ut_addr_v6, utmp.h, 
400         [AC_DEFINE(HAVE_ADDR_V6_IN_UTMP) AC_MSG_RESULT(yes); ], 
401         [AC_MSG_RESULT(no)]
402 )
403 AC_MSG_CHECKING([whether utmpx.h has ut_addr_v6 field])
404 AC_EGREP_HEADER(ut_addr_v6, utmpx.h, 
405         [AC_DEFINE(HAVE_ADDR_V6_IN_UTMPX) AC_MSG_RESULT(yes); ], 
406         [AC_MSG_RESULT(no)]
407 )
408
409 AC_MSG_CHECKING([whether struct sockaddr_storage has ss_family field])
410 AC_TRY_COMPILE(
411         [
412                 #include <sys/types.h>
413                 #include <sys/socket.h>
414         ],
415         [struct sockaddr_storage s; s.ss_family = 1;],
416         [
417                 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
418                 AC_MSG_RESULT(yes)
419         ],
420         [AC_MSG_RESULT(no)]
421 )
422 AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family field])
423 AC_TRY_COMPILE(
424         [
425                 #include <sys/types.h>
426                 #include <sys/socket.h>
427         ],
428         [struct sockaddr_storage s; s.__ss_family = 1;],
429         [
430                 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
431                 AC_MSG_RESULT(yes)
432         ],
433         [AC_MSG_RESULT(no)]
434 )
435
436 AC_MSG_CHECKING([whether libc defines __progname])
437 AC_TRY_LINK([], 
438         [extern char *__progname; printf("%s", __progname);], 
439         [
440                 AC_DEFINE(HAVE___PROGNAME)
441                 AC_MSG_RESULT(yes)
442         ], 
443         [
444                 AC_MSG_RESULT(no)
445         ]
446 )
447
448 # Looking for programs, paths and files
449 AC_ARG_WITH(rsh,
450         [  --with-rsh=PATH         Specify path to remote shell program ],
451         [
452                 if test "x$withval" != "$xno" ; then
453                         AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
454                 fi
455         ],
456         [
457                 AC_PATH_PROG(rsh_path, rsh)
458         ]
459 )
460
461 AC_ARG_WITH(xauth,
462         [  --with-xauth=PATH       Specify path to xauth program ],
463         [
464                 if test "x$withval" != "$xno" ; then
465                         AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
466                 fi
467         ],
468         [
469                 AC_PATH_PROG(xauth_path, xauth)
470                 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
471                         xauth_path="/usr/openwin/bin/xauth"
472                 fi
473         ]
474 )
475
476 if test ! -z "$xauth_path" ; then
477         AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
478 fi
479 if test ! -z "$rsh_path" ; then
480         AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
481 fi
482
483 # Check for mail directory (last resort if we cannot get it from headers)
484 if test ! -z "$MAIL" ; then
485         maildir=`dirname $MAIL`
486         AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
487 fi
488
489 # Look for lastlog location
490 AC_ARG_WITH(lastlog,
491         [  --with-lastlog=FILE     Location of lastlog file],
492         [
493                 if test "x$withval" = "xno" ; then
494                         AC_DEFINE(DISABLE_LASTLOG)
495                 else
496                         AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
497                 fi
498         ],
499         [
500                 AC_MSG_CHECKING([location of lastlog file])
501                 for lastlog in /var/log/lastlog /var/adm/lastlog /usr/adm/lastlog  /etc/security/lastlog ; do
502                         if test -f $lastlog ; then
503                                 gotlastlog="file"
504                                 break
505                         fi
506                         if test -d $lastlog ; then
507                                 gotlastlog="dir"
508                                 break
509                         fi
510                 done
511                 if test -z "$gotlastlog" ; then
512                         AC_MSG_RESULT(not found)
513                         nolastlog=1
514                 else
515                         if test "x$gotlastlog" = "xdir" ; then
516                                 AC_MSG_RESULT(${lastlog}/)
517                                 AC_DEFINE(LASTLOG_IS_DIR)
518                         else
519                                 AC_MSG_RESULT($lastlog)
520                                 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
521                         fi
522                 fi      
523         ]
524 )
525
526 if test ! -z "$nolastlog" ; then
527         AC_MSG_WARN([*** Disabling lastlog support *** ])
528         AC_DEFINE(DISABLE_LASTLOG)
529 fi
530
531 if test -z "$no_dev_ptmx" ; then
532         AC_CHECK_FILE("/dev/ptmx", 
533                 [
534                         AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
535                         have_dev_ptmx=1
536                 ]
537         )
538 fi
539 AC_CHECK_FILE("/dev/ptc", 
540         [
541                 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
542                 have_dev_ptc=1
543         ]
544 )
545
546 # Some systems (defined in platform-specific code above) automagically remove
547 # Unix98 ptys when they are closed
548 if test "x$ac_cv_func_openpty" = "xyes" -o "x$have_dev_ptmx" = "x1" -o "x$have_dev_ptc" = "x1" ; then
549         if test "x$need_pty_removed_on_close" = "x1" ; then
550                 AC_DEFINE(PTY_REMOVED_ON_CLOSE)
551         fi
552 fi
553
554 # Options from here on. Some of these are preset by platform above
555
556 # Check whether user wants GNOME ssh-askpass
557 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
558 AC_ARG_WITH(gnome-askpass,
559         [  --with-gnome-askpass    Build the GNOME passphrase requester (default=no)],
560         [
561                 if test x$withval = xno ; then
562                         GNOME_ASKPASS="";
563                 else
564                         GNOME_ASKPASS="gnome-ssh-askpass";
565                 fi
566         ])
567 AC_SUBST(GNOME_ASKPASS)
568
569 if test -z "$GNOME_ASKPASS" ; then
570         AC_MSG_RESULT(no)
571 else
572         AC_MSG_RESULT(yes)
573 fi
574
575 # Check for user-specified random device, otherwise check /dev/urandom
576 AC_ARG_WITH(random,
577         [  --with-random=FILE      read randomness from FILE (default=/dev/urandom)],
578         [
579                 RANDOM_POOL="$withval";
580                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
581         ],
582         [
583                 # Check for random device
584                 AC_CHECK_FILE("/dev/urandom",
585                         [
586                                 RANDOM_POOL="/dev/urandom"; 
587                                 AC_SUBST(RANDOM_POOL)
588                                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
589                         ]
590                 )
591         ]
592 )
593
594 # Check for EGD pool file
595 AC_ARG_WITH(egd-pool,
596         [  --with-egd-pool=FILE    read randomness from EGD pool FILE (default none)],
597         [
598                 RANDOM_POOL="$withval";
599                 AC_DEFINE(HAVE_EGD)
600                 AC_SUBST(RANDOM_POOL)
601                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
602         ]
603 )
604
605 # Make sure we have some random number support
606 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
607         AC_MSG_ERROR([No random device found, and no EGD random pool specified])
608 fi
609
610 AC_ARG_WITH(catman,
611         [  --with-catman=man|cat   Install preformatted manpages[no]],
612         [
613                 MANTYPE='$(CATMAN)'
614                 if test x"$withval" != x"yes" ; then
615                    mansubdir=$withval
616                 else
617                    mansubdir=cat
618                 fi
619         ], [
620                 if test -z "$MANTYPE" ; then
621                         MANTYPE='$(TROFFMAN)'
622                         mansubdir=man
623                 fi
624         ]
625 )
626 AC_SUBST(MANTYPE)
627 AC_SUBST(mansubdir)
628
629 # Check whether user wants Kerberos support
630 AC_ARG_WITH(kerberos4,
631         [  --with-kerberos4=PATH   Enable Kerberos 4 support],
632         [
633                 if test "x$withval" != "$xno" ; then
634         
635                         if test "x$withval" != "$xyes" ; then
636                                 CFLAGS="$CFLAGS -I${withval}/include"
637                                 LDFLAGS="$LDFLAGS -L${withval}/lib"
638                         else
639                                 if test -d /usr/include/kerberosIV ; then
640                                         CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
641                                 fi
642                         fi
643
644                         AC_CHECK_HEADERS(krb.h)
645                         AC_CHECK_LIB(krb, main)
646                         if test "$ac_cv_header_krb_h" != yes; then
647                                 AC_MSG_WARN([Cannot find krb.h, build may fail])
648                         fi
649                         if test "$ac_cv_lib_krb_main" != yes; then
650                                 AC_MSG_WARN([Cannot find libkrb, build may fail])
651                         fi
652
653                         KLIBS="-lkrb -ldes"
654                         AC_CHECK_LIB(resolv, dn_expand, , )
655                         KRB4=yes
656                         AC_DEFINE(KRB4)
657                 fi
658         ]
659 )
660
661 # Check whether user wants AFS support
662 AC_ARG_WITH(afs,
663         [  --with-afs=PATH         Enable AFS support],
664         [
665                 if test "x$withval" != "$xno" ; then
666
667                         if test "x$withval" != "$xyes" ; then
668                                 CFLAGS="$CFLAGS -I${withval}/include"
669                                 LFLAGS="$LFLAGS -L${withval}/lib"
670                         fi
671
672                         if test -z "$KRB4" ; then
673                                 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
674                         fi
675
676                         LIBS="$LIBS -lkafs"
677                         if test ! -z "$AFS_LIBS" ; then
678                                 LIBS="$LIBS $AFS_LIBS"
679                         fi
680                         AC_DEFINE(AFS)
681                 fi
682         ]
683 )
684 LIBS="$LIBS $KLIBS"
685
686 # Check whether user wants S/Key support
687 AC_ARG_WITH(skey,
688         [  --with-skey             Enable S/Key support],
689         [
690                 if test "x$withval" != "$xno" ; then
691                         AC_DEFINE(SKEY)
692                         LIBS="$LIBS -lskey"
693                 fi
694         ]
695 )
696
697 # Check whether user wants TCP wrappers support
698 AC_ARG_WITH(tcp-wrappers,
699         [  --with-tcp-wrappers     Enable tcpwrappers support],
700         [
701                 if test "x$withval" != "$xno" ; then
702                         saved_LIBS="$LIBS"
703                         LIBS="$LIBS -lwrap"
704                         AC_MSG_CHECKING(for libwrap)
705                         AC_TRY_LINK(
706                                 [
707                                         #include <tcpd.h>
708                                         int deny_severity = 0, allow_severity = 0;
709                                 ],
710                                 [hosts_access(0);],
711                                 [
712                                         AC_MSG_RESULT(yes)
713                                         AC_DEFINE(LIBWRAP)
714                                 ],
715                                 [
716                                         AC_MSG_RESULT(no)
717                                         AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
718                                         LIBS="$saved_LIBS"
719                                 ]
720                         )
721                 fi
722         ]
723 )
724
725 # Check whether to enable MD5 passwords
726 AC_ARG_WITH(md5-passwords,
727         [  --with-md5-passwords    Enable use of MD5 passwords],
728         [
729                 if test "x$withval" != "$xno" ; then
730                         AC_DEFINE(HAVE_MD5_PASSWORDS)
731                 fi
732         ]
733 )
734
735 # Check whether to enable utmpx support
736 AC_ARG_WITH(utmpx,
737         [  --with-utmpx            Enable utmpx support],
738         [
739                 if test "x$withval" != "xno" ; then
740                         AC_DEFINE(USE_UTMPX)
741                 fi
742         ]
743 )
744
745 # Whether to disable shadow password support
746 AC_ARG_WITH(shadow,
747         [  --without-shadow        Disable shadow password support],
748         [
749                 if test "x$withval" = "xno" ; then      
750                         AC_DEFINE(DISABLE_SHADOW)
751                 fi
752         ]
753 )
754
755 # Use ip address instead of hostname in $DISPLAY
756 AC_ARG_WITH(ipaddr-display,
757         [  --with-ipaddr-display   Use ip address instead of hostname in \$DISPLAY],
758         [
759                 if test "x$withval" = "xno" ; then      
760                         AC_DEFINE(IPADDR_IN_DISPLAY)
761                 fi
762         ]
763 )
764
765 # Whether to mess with the default path
766 AC_ARG_WITH(default-path,
767         [  --with-default-path=PATH Specify default \$PATH environment for server],
768         [
769                 if test "x$withval" != "xno" ; then     
770                         AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
771                 fi
772         ]
773 )
774
775 # Whether to force IPv4 by default (needed on broken glibc Linux)
776 AC_ARG_WITH(ipv4-default,
777         [  --with-ipv4-default     Use IPv4 by connections unless '-6' specified],
778         [
779                 if test "x$withval" != "xno" ; then     
780                         AC_DEFINE(IPV4_DEFAULT)
781                 fi
782         ]
783 )
784
785 # Where to place sshd.pid
786 piddir=/var/run
787 AC_ARG_WITH(pid-dir,
788         [  --with-pid-dir=PATH     Specify location of ssh.pid file],
789         [
790                 if test "x$withval" != "xno" ; then     
791                         piddir=$withval
792                 fi
793         ]
794 )
795 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
796 AC_SUBST(piddir)
797
798 AC_OUTPUT(Makefile)
This page took 0.121218 seconds and 5 git commands to generate.