]> andersk Git - openssh.git/blob - configure.in
05a354d1ab6b50ebca729972a868305c1cce1173
[openssh.git] / configure.in
1 AC_INIT(ssh.c)
2
3 AC_CONFIG_HEADER(config.h)
4
5 dnl Checks for programs.
6 AC_PROG_CC
7 AC_PROG_CPP
8 AC_PROG_RANLIB
9 AC_CHECK_PROG(AR, ar, ar)
10 if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
11
12 dnl Check for OpenSSL/SSLeay directories.
13 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
14 for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
15         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
25 done
26 if test -z "$GOT_SSL" ; then
27         AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])       
28 fi
29 AC_SUBST(ssldir)
30 AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
31 if test "$ssldir" != "/usr"; then
32         CFLAGS="$CFLAGS -I$ssldir/include"
33         LIBS="$LIBS -L$ssldir/lib"
34 fi
35 LIBS="$LIBS -lssl -lcrypto"
36 AC_MSG_RESULT($ssldir)
37
38 dnl Check for RSAref library.
39 AC_MSG_CHECKING([for RSAref library])
40 saved_LIBS="$LIBS"
41 LIBS="$saved_LIBS -lRSAglue -lrsaref"
42 AC_TRY_LINK([], [],
43 [AC_MSG_RESULT(yes); ],
44 [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
45
46 dnl Checks for libraries.
47 AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
48 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
49 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
50 AC_CHECK_LIB(nsl, yp_match, , )
51 AC_CHECK_LIB(socket, main, , )
52
53 dnl libdl is needed by PAM on Redhat systems
54 AC_CHECK_LIB(dl, dlopen, , )
55 AC_CHECK_LIB(pam, pam_authenticate, , )
56
57 dnl Checks for header files.
58 AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h maillock.h sys/select.h)
59
60 dnl Checks for library functions.
61 AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin)
62
63 dnl Check whether use wants to disable the external ssh-askpass
64 INSTALL_ASKPASS="yes"
65 AC_MSG_CHECKING([whether to enable external ssh-askpass support])
66 AC_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 )
76 if test "x$INSTALL_ASKPASS" = "xyes" ; then
77         AC_DEFINE(USE_EXTERNAL_ASKPASS)
78         AC_SUBST(INSTALL_ASKPASS)
79         AC_MSG_RESULT(yes)
80 else
81         AC_MSG_RESULT(no)
82 fi
83
84 if 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
103 fi
104
105 dnl Check for user-specified random device
106 AC_ARG_WITH(random,
107         [  --with-random=FILE      read randomness from FILE (default=/dev/urandom)],
108         [
109                 RANDOM_POOL="$withval";
110                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
111         ],
112         [
113                 dnl Check for random device
114                 AC_CHECK_FILE("/dev/urandom",
115                         [
116                                 RANDOM_POOL="/dev/urandom"; 
117                                 AC_SUBST(RANDOM_POOL)
118                                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
119                         ]
120                 )
121         ]
122 )
123
124 dnl Check for EGD pool file
125 AC_ARG_WITH(egd-pool,
126         [  --with-egd-pool=FILE    read randomness from EGD pool FILE (default none)],
127         [
128                 RANDOM_POOL="$withval";
129                 AC_DEFINE(HAVE_EGD)
130                 AC_SUBST(RANDOM_POOL)
131                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
132         ]
133 )
134
135 dnl Make sure we have random number support
136 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
137         AC_MSG_ERROR([No random device found, and no EGD random pool specified])
138 fi
139
140 dnl Check for ut_host field in utmp
141 AC_MSG_CHECKING([whether utmp.h has ut_host field])
142 AC_EGREP_HEADER(ut_host, utmp.h, 
143         [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], 
144         [AC_MSG_RESULT(no)]
145 )
146
147 dnl Look for lastlog location
148 AC_MSG_CHECKING([location of lastlog file])
149 for 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
155 done
156
157 AC_MSG_CHECKING([whether libc defines __progname])
158 AC_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
169 AC_OUTPUT(Makefile)
This page took 0.044613 seconds and 3 git commands to generate.