blob: 0b54fd58a560dd89f123157d05a5eabd6979ac60 [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
4
5dnl Checks for programs.
6AC_PROG_CC
Damien Millerab18c411999-11-11 10:40:23 +11007AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10008AC_PROG_RANLIB
Damien Millerc7b38ce1999-11-09 10:28:04 +11009AC_CHECK_PROG(AR, ar, ar)
10if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
Damien Miller7f6ea021999-10-28 13:25:17 +100011
Damien Millerc7b38ce1999-11-09 10:28:04 +110012dnl Check for OpenSSL/SSLeay directories.
13AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
Damien Millerab18c411999-11-11 10:40:23 +110014for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
Damien Millera82feb31999-11-11 11:04:17 +110015 if test -f "$ssldir/include/openssl/crypto.h"; then
16 AC_DEFINE(HAVE_OPENSSL)
17 GOT_SSL="yes"
18 break
19 fi
20 if test -f "$ssldir/include/ssl/crypto.h"; then
21 AC_DEFINE(HAVE_SSL)
22 GOT_SSL="yes"
23 break
24 fi
Damien Millerc7b38ce1999-11-09 10:28:04 +110025done
Damien Millera82feb31999-11-11 11:04:17 +110026if test -z "$GOT_SSL" ; then
27 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
28fi
Damien Millerc7b38ce1999-11-09 10:28:04 +110029AC_SUBST(ssldir)
30AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
31if test "$ssldir" != "/usr"; then
32 CFLAGS="$CFLAGS -I$ssldir/include"
33 LIBS="$LIBS -L$ssldir/lib"
34fi
35LIBS="$LIBS -lssl -lcrypto"
Damien Millera82feb31999-11-11 11:04:17 +110036AC_MSG_RESULT($ssldir)
Damien Miller7f6ea021999-10-28 13:25:17 +100037
Damien Millerc7b38ce1999-11-09 10:28:04 +110038dnl Check for RSAref library.
39AC_MSG_CHECKING([for RSAref library])
40saved_LIBS="$LIBS"
41LIBS="$saved_LIBS -lRSAglue -lrsaref"
42AC_TRY_LINK([], [],
43[AC_MSG_RESULT(yes); ],
44[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
Damien Miller7f6ea021999-10-28 13:25:17 +100045
Damien Millerab18c411999-11-11 10:40:23 +110046dnl Checks for libraries.
47AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
48AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
49AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
50AC_CHECK_LIB(nsl, yp_match, , )
51AC_CHECK_LIB(socket, main, , )
52
53dnl libdl is needed by PAM on Redhat systems
54AC_CHECK_LIB(dl, dlopen, , )
55AC_CHECK_LIB(pam, pam_authenticate, , )
56
Damien Miller7f6ea021999-10-28 13:25:17 +100057dnl Checks for header files.
Damien Miller4874c791999-11-16 13:29:26 +110058AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h maillock.h sys/select.h)
Damien Millerab18c411999-11-11 10:40:23 +110059
Damien Millercedfecc1999-11-15 14:36:53 +110060dnl Checks for library functions.
61AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin)
62
63dnl Check whether use wants to disable the external ssh-askpass
64INSTALL_ASKPASS="yes"
65AC_MSG_CHECKING([whether to enable external ssh-askpass support])
66AC_ARG_WITH(askpass,
67 [ --with-askpass=yes/no Enable external ssh-askpass support (default=no)],
68 [
69 if test x$withval = xno ; then
70 INSTALL_ASKPASS="no"
71 else
72 INSTALL_ASKPASS="yes"
73 fi
74 ]
75)
76if test "x$INSTALL_ASKPASS" = "xyes" ; then
77 AC_DEFINE(USE_EXTERNAL_ASKPASS)
78 AC_SUBST(INSTALL_ASKPASS)
79 AC_MSG_RESULT(yes)
80else
81 AC_MSG_RESULT(no)
82fi
83
84if test "x$INSTALL_ASKPASS" = "xyes" ; then
85 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
86 dnl Check whether user wants GNOME ssh-askpass
87 AC_ARG_WITH(gnome-askpass,
88 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
89 [
90 if test x$withval = xno ; then
91 GNOME_ASKPASS="";
92 else
93 GNOME_ASKPASS="gnome-ssh-askpass";
94 fi
95 ])
96 AC_SUBST(GNOME_ASKPASS)
97
98 if test -z "$GNOME_ASKPASS" ; then
99 AC_MSG_RESULT(no)
100 else
101 AC_MSG_RESULT(yes)
102 fi
103fi
Damien Millere0d444c1999-11-09 14:23:45 +1100104
Damien Millerab18c411999-11-11 10:40:23 +1100105dnl Check for user-specified random device
106AC_ARG_WITH(random,
Damien Millercedfecc1999-11-15 14:36:53 +1100107 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
Damien Millerab18c411999-11-11 10:40:23 +1100108 [
109 RANDOM_POOL="$withval";
Damien Miller0a6e6681999-11-15 09:56:06 +1100110 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100111 ],
112 [
113 dnl Check for random device
114 AC_CHECK_FILE("/dev/urandom",
115 [
116 RANDOM_POOL="/dev/urandom";
Damien Millera82feb31999-11-11 11:04:17 +1100117 AC_SUBST(RANDOM_POOL)
118 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100119 ]
120 )
121 ]
122)
123
124dnl Check for EGD pool file
125AC_ARG_WITH(egd-pool,
Damien Millercedfecc1999-11-15 14:36:53 +1100126 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
Damien Millerab18c411999-11-11 10:40:23 +1100127 [
128 RANDOM_POOL="$withval";
129 AC_DEFINE(HAVE_EGD)
Damien Millera82feb31999-11-11 11:04:17 +1100130 AC_SUBST(RANDOM_POOL)
131 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100132 ]
133)
134
Damien Millercedfecc1999-11-15 14:36:53 +1100135dnl Make sure we have random number support
Damien Millerab18c411999-11-11 10:40:23 +1100136if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
137 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
138fi
139
Damien Miller3f905871999-11-15 17:10:57 +1100140dnl Check for ut_host field in utmp
141AC_MSG_CHECKING([whether utmp.h has ut_host field])
142AC_EGREP_HEADER(ut_host, utmp.h,
143 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
144 [AC_MSG_RESULT(no)]
145)
146
147dnl Look for lastlog location
148AC_MSG_CHECKING([location of lastlog file])
149for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
150 if test -f $lastlog ; then
151 AC_MSG_RESULT($lastlog)
152 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
153 break
154 fi
155done
156
157AC_MSG_CHECKING([whether libc defines __progname])
158AC_TRY_LINK([],
159 [extern char *__progname;],
160 [
161 AC_DEFINE(HAVE___PROGNAME)
162 AC_MSG_RESULT(yes)
163 ],
164 [
165 AC_MSG_RESULT(no)
166 ]
167)
168
Damien Miller80297751999-11-19 13:03:25 +1100169dnl Check whether user wants Kerberos support
170AC_ARG_WITH(kerberos4,
171 [ --with-kerberos4 Enable Kerberos 4 support],
172 [
173 AC_DEFINE(KRB4)
174 LIBS="$LIBS -lkrb"
175 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
176 ]
177)
178
179dnl Check whether user wants AFS support
180AC_ARG_WITH(kerberos4,
181 [ --with-afs Enable AFS support],
182 [
183 AC_DEFINE(AFS)
184 LIBS="$LIBS -lkafs"
185 ]
186)
187
188dnl Check whether user wants S/Key support
189AC_ARG_WITH(skey,
190 [ --with-skey Enable S/Key support],
191 [
192 AC_DEFINE(SKEY)
193 LIBS="$LIBS -lskey"
194 ]
195)
196
197dnl Check whether user wants TCP wrappers support
198AC_ARG_WITH(skey,
199 [ --with-tcp-wrappers Enable tcpwrappers support],
200 [
201 AC_DEFINE(LIBWRAP)
202 LIBS="$LIBS -lwrap"
203 ]
204)
205
Damien Miller7f6ea021999-10-28 13:25:17 +1000206AC_OUTPUT(Makefile)