]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openssh/openssh-3.8p1/configure.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / openssh / openssh-3.8p1 / configure.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 --- openssh-3.8p1/configure.ac~configure        2004-02-24 00:47:04.000000000 -0500
7 +++ openssh-3.8p1/configure.ac  2004-03-17 16:17:16.000000000 -0500
8 @@ -53,7 +53,7 @@
9  AC_SUBST(LD)
10         
11  AC_C_INLINE
12 -if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
13 +if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 
14         CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
15  fi
16  
17 @@ -72,7 +72,7 @@
18  # Check for some target-specific stuff
19  case "$host" in
20  *-*-aix*)
21 -       AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
22 +       AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) 
23         if (test -z "$blibpath"); then
24                 blibpath="/usr/lib:/lib"
25         fi
26 @@ -80,7 +80,7 @@
27         for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
28                 if (test -z "$blibflags"); then
29                         LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
30 -                       AC_TRY_LINK([], [], [blibflags=$tryflags])
31 +                       AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[blibflags=$tryflags],[])
32                 fi
33         done
34         if (test -z "$blibflags"); then
35 @@ -100,13 +100,9 @@
36         dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
37         AC_CHECK_DECL(loginfailed,
38                  [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
39 -                 AC_TRY_COMPILE(
40 -                       [#include <usersec.h>],
41 -                       [(void)loginfailed("user","host","tty",0);],
42 -                       [AC_MSG_RESULT(yes)
43 -                        AC_DEFINE(AIX_LOGINFAILED_4ARG)],
44 -                       [AC_MSG_RESULT(no)]
45 -               )],
46 +                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <usersec.h>]], [[(void)loginfailed("user","host","tty",0);]])],[AC_MSG_RESULT(yes)
47 +                        AC_DEFINE(AIX_LOGINFAILED_4ARG)],[AC_MSG_RESULT(no)
48 +               ])],
49                 [],
50                 [#include <usersec.h>]
51         )
52 @@ -141,15 +137,13 @@
53         ;;
54  *-*-darwin*)
55         AC_MSG_CHECKING(if we have working getaddrinfo)
56 -       AC_TRY_RUN([#include <mach-o/dyld.h>
57 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mach-o/dyld.h>
58  main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
59                 exit(0);
60         else
61                 exit(1);
62 -}], [AC_MSG_RESULT(working)],
63 -       [AC_MSG_RESULT(buggy)
64 -       AC_DEFINE(BROKEN_GETADDRINFO)],
65 -       [AC_MSG_RESULT(assume it is working)])
66 +}]])],[AC_MSG_RESULT(working)],[AC_MSG_RESULT(buggy)
67 +       AC_DEFINE(BROKEN_GETADDRINFO)],[AC_MSG_RESULT(assume it is working)])
68         AC_DEFINE(SETEUID_BREAKS_SETUID)
69         AC_DEFINE(BROKEN_SETREUID)
70         AC_DEFINE(BROKEN_SETREGID)
71 @@ -246,7 +240,7 @@
72  *-*-netbsd*)
73         check_for_libcrypt_before=1
74         if test "x$withval" != "xno" ; then     
75 -               need_dash_r=1
76 +       need_dash_r=1
77         fi
78         ;;
79  *-*-freebsd*)
80 @@ -473,16 +467,14 @@
81  )
82  
83  AC_MSG_CHECKING(compiler and flags for sanity)
84 -AC_TRY_RUN([
85 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
86  #include <stdio.h>
87  int main(){exit(0);}
88 -       ],
89 -       [       AC_MSG_RESULT(yes) ],
90 -       [
91 +       ]])],[  AC_MSG_RESULT(yes) ],[
92                 AC_MSG_RESULT(no)
93                 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
94 -       ]
95 -)
96 +       ],[     AC_MSG_RESULT(yes) 
97 +])
98  
99  # Checks for header files.
100  AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
101 @@ -514,8 +506,7 @@
102                         ac_cv_have_broken_dirname, [
103                         save_LIBS="$LIBS"
104                         LIBS="$LIBS -lgen"
105 -                       AC_TRY_RUN(
106 -                               [
107 +                       AC_RUN_IFELSE([AC_LANG_SOURCE([[
108  #include <libgen.h>
109  #include <string.h>
110  
111 @@ -530,10 +521,8 @@
112         exit(0);
113      }
114  }
115 -                               ],
116 -                               [ ac_cv_have_broken_dirname="no" ],
117 -                               [ ac_cv_have_broken_dirname="yes" ]
118 -                       )
119 +                               ]])],[ ac_cv_have_broken_dirname="no" ],[ ac_cv_have_broken_dirname="yes" 
120 +                       ],[])
121                         LIBS="$save_LIBS"
122                 ])
123                 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
124 @@ -607,39 +596,36 @@
125  )
126  
127  AC_MSG_CHECKING(for zlib 1.1.4 or greater)
128 -AC_TRY_RUN([
129 -#include <zlib.h>
130 -int main()
131 -{
132 -       int a, b, c, v;
133 -       if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
134 -               exit(1);
135 -       v = a*1000000 + b*1000 + c;
136 -       if (v >= 1001004)
137 -               exit(0);
138 -       exit(2);
139 -}
140 -       ],
141 -       AC_MSG_RESULT(yes),
142 -       [ AC_MSG_RESULT(no)
143 -         if test -z "$zlib_check_nonfatal" ; then
144 +if test "x$zlib_check_nonfatal" = "x1"; then
145 +       AC_MSG_WARN([skipping zlib version check])
146 +else
147 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
148 +       #include <zlib.h>
149 +       int main()
150 +       {
151 +               int a, b, c, v;
152 +               if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
153 +                       exit(1);
154 +               v = a*1000000 + b*1000 + c;
155 +               if (v >= 1001004)
156 +                       exit(0);
157 +               exit(2);
158 +       }
159 +               ]])],[AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no)
160                 AC_MSG_ERROR([*** zlib too old - check config.log ***
161 -Your reported zlib version has known security problems.  It's possible your
162 -vendor has fixed these problems without changing the version number.  If you
163 -are sure this is the case, you can disable the check by running
164 -"./configure --without-zlib-version-check".
165 -If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
166 -         else
167 -               AC_MSG_WARN([zlib version may have security problems])
168 -         fi
169 -       ]
170 -)
171 +       Your reported zlib version has known security problems.  It's possible your
172 +       vendor has fixed these problems without changing the version number.  If you
173 +       are sure this is the case, you can disable the check by running
174 +       "./configure --without-zlib-version-check".
175 +       If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
176 +       ],[])
177 +fi
178  
179  dnl UnixWare 2.x
180 -AC_CHECK_FUNC(strcasecmp,
181 +AC_CHECK_FUNC(strcasecmp, 
182         [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
183  )
184 -AC_CHECK_FUNC(utimes,
185 +AC_CHECK_FUNC(utimes, 
186         [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
187                                         LIBS="$LIBS -lc89"]) ]
188  )
189 @@ -659,7 +645,7 @@
190                 #ifdef GLOB_ALTDIRFUNC
191                 FOUNDIT
192                 #endif
193 -       ],
194 +       ], 
195         [
196                 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
197                 AC_MSG_RESULT(yes)
198 @@ -672,38 +658,37 @@
199  # Check for g.gl_matchc glob() extension
200  AC_MSG_CHECKING(for gl_matchc field in glob_t)
201  AC_EGREP_CPP(FOUNDIT,
202 -       [
203 -               #include <glob.h>
204 +        [
205 +                #include <glob.h>
206                 int main(void){glob_t g; g.gl_matchc = 1;}
207 -       ],
208 -       [
209 -               AC_DEFINE(GLOB_HAS_GL_MATCHC)
210 -               AC_MSG_RESULT(yes)
211 -       ],
212 -       [
213 -               AC_MSG_RESULT(no)
214 -       ]
215 +        ],
216 +        [
217 +                AC_DEFINE(GLOB_HAS_GL_MATCHC)
218 +                AC_MSG_RESULT(yes)
219 +        ],
220 +        [
221 +                AC_MSG_RESULT(no)
222 +        ]
223  )
224  
225 -AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
226 -AC_TRY_RUN(
227 -       [
228 -#include <sys/types.h>
229 -#include <dirent.h>
230 -int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
231 -       ],
232 -       [AC_MSG_RESULT(yes)],
233 -       [
234 -               AC_MSG_RESULT(no)
235 -               AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
236 -       ]
237 -)
238 +AC_CACHE_CHECK([whether struct dirent allocates space for d_name], ac_cv_have_space_d_name_in_struct_dirent, [
239 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
240 +                       #include <sys/types.h>
241 +                       #include <dirent.h>
242 +                       int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
243 +               ]])],[ac_cv_have_space_d_name_in_struct_dirent="yes"],[ac_cv_have_space_d_name_in_struct_dirent="no"
244 +       ],[])
245 +])
246 +
247 +if test "x$ac_cv_dirent_have_space_d_name" = "xyes" ; then
248 +       AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
249 +fi
250  
251  # Check whether user wants S/Key support
252 -SKEY_MSG="no"
253 +SKEY_MSG="no" 
254  AC_ARG_WITH(skey,
255         [  --with-skey[[=PATH]]      Enable S/Key support
256 -                           (optionally in PATH)],
257 +                            (optionally in PATH)],
258         [
259                 if test "x$withval" != "xno" ; then
260  
261 @@ -714,20 +699,17 @@
262  
263                         AC_DEFINE(SKEY)
264                         LIBS="-lskey $LIBS"
265 -                       SKEY_MSG="yes"
266 +                       SKEY_MSG="yes" 
267         
268                         AC_MSG_CHECKING([for s/key support])
269 -                       AC_TRY_RUN(
270 -                               [
271 +                       AC_RUN_IFELSE([AC_LANG_SOURCE([[
272  #include <stdio.h>
273  #include <skey.h>
274  int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
275 -                               ],
276 -                               [AC_MSG_RESULT(yes)],
277 -                               [
278 +                               ]])],[AC_MSG_RESULT(yes)],[
279                                         AC_MSG_RESULT(no)
280                                         AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
281 -                               ])
282 +                               ],[])
283                 fi
284         ]
285  )
286 @@ -736,7 +718,7 @@
287  TCPW_MSG="no"
288  AC_ARG_WITH(tcp-wrappers,
289         [  --with-tcp-wrappers[[=PATH]]      Enable tcpwrappers support
290 -                           (optionally in PATH)],
291 +                            (optionally in PATH)],
292         [
293                 if test "x$withval" != "xno" ; then
294                         saved_LIBS="$LIBS"
295 @@ -765,22 +747,18 @@
296                         LIBWRAP="-lwrap"
297                         LIBS="$LIBWRAP $LIBS"
298                         AC_MSG_CHECKING(for libwrap)
299 -                       AC_TRY_LINK(
300 -                               [
301 +                       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
302  #include <tcpd.h>
303                                         int deny_severity = 0, allow_severity = 0;
304 -                               ],
305 -                               [hosts_access(0);],
306 -                               [
307 +                               ]], [[hosts_access(0);]])],[
308                                         AC_MSG_RESULT(yes)
309                                         AC_DEFINE(LIBWRAP)
310                                         AC_SUBST(LIBWRAP)
311                                         TCPW_MSG="yes"
312 -                               ],
313 -                               [
314 +                               ],[
315                                         AC_MSG_ERROR([*** libwrap missing])
316 -                               ]
317 -                       )
318 +                               
319 +                       ])
320                         LIBS="$saved_LIBS"
321                 fi
322         ]
323 @@ -805,17 +783,17 @@
324  # IRIX has a const char return value for gai_strerror()
325  AC_CHECK_FUNCS(gai_strerror,[
326         AC_DEFINE(HAVE_GAI_STRERROR)
327 -       AC_TRY_COMPILE([
328 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
329  #include <sys/types.h>
330  #include <sys/socket.h>
331  #include <netdb.h>
332  
333 -const char *gai_strerror(int);],[
334 +const char *gai_strerror(int);]], [[
335  char *str;
336  
337 -str = gai_strerror(0);],[
338 +str = gai_strerror(0);]])],[
339                 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
340 -               [Define if gai_strerror() returns const char *])])])
341 +               [Define if gai_strerror() returns const char *])],[])])
342  
343  AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
344  
345 @@ -826,36 +804,32 @@
346  dnl tcsendbreak might be a macro
347  AC_CHECK_DECL(tcsendbreak,
348         [AC_DEFINE(HAVE_TCSENDBREAK)],
349 -       [AC_CHECK_FUNCS(tcsendbreak)],
350 +       [AC_CHECK_FUNCS(tcsendbreak)], 
351         [#include <termios.h>]
352  )
353  
354  AC_CHECK_FUNCS(setresuid, [
355         dnl Some platorms have setresuid that isn't implemented, test for this
356         AC_MSG_CHECKING(if setresuid seems to work)
357 -       AC_TRY_RUN([
358 +       AC_LINK_IFELSE([AC_LANG_SOURCE([[
359  #include <stdlib.h>
360  #include <errno.h>
361  int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
362 -               ],
363 -               [AC_MSG_RESULT(yes)],
364 -               [AC_DEFINE(BROKEN_SETRESUID)
365 -                AC_MSG_RESULT(not implemented)]
366 -       )
367 +               ]])],[AC_MSG_RESULT(yes)],[AC_DEFINE(BROKEN_SETRESUID)
368 +                AC_MSG_RESULT(not implemented)
369 +       ],[])
370  ])
371  
372  AC_CHECK_FUNCS(setresgid, [
373         dnl Some platorms have setresgid that isn't implemented, test for this
374         AC_MSG_CHECKING(if setresgid seems to work)
375 -       AC_TRY_RUN([
376 +       AC_LINK_IFELSE([AC_LANG_SOURCE([[
377  #include <stdlib.h>
378  #include <errno.h>
379  int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
380 -               ],
381 -               [AC_MSG_RESULT(yes)],
382 -               [AC_DEFINE(BROKEN_SETRESGID)
383 -                AC_MSG_RESULT(not implemented)]
384 -       )
385 +               ]])],[AC_MSG_RESULT(yes)],[AC_DEFINE(BROKEN_SETRESGID)
386 +                AC_MSG_RESULT(not implemented)
387 +       ],[])
388  ])
389  
390  dnl    Checks for time functions
391 @@ -867,64 +841,59 @@
392  AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
393  AC_CHECK_FUNCS(setutxent utmpxname)
394  
395 -AC_CHECK_FUNC(daemon,
396 +AC_CHECK_FUNC(daemon, 
397         [AC_DEFINE(HAVE_DAEMON)],
398         [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
399  )
400  
401 -AC_CHECK_FUNC(getpagesize,
402 +AC_CHECK_FUNC(getpagesize, 
403         [AC_DEFINE(HAVE_GETPAGESIZE)],
404         [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
405  )
406  
407  # Check for broken snprintf
408  if test "x$ac_cv_func_snprintf" = "xyes" ; then
409 -       AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
410 -       AC_TRY_RUN(
411 -               [
412 +AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
413 +       ac_cv_have_broken_snprintf, [
414 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
415  #include <stdio.h>
416  int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
417 -               ],
418 -               [AC_MSG_RESULT(yes)],
419 -               [
420 -                       AC_MSG_RESULT(no)
421 -                       AC_DEFINE(BROKEN_SNPRINTF)
422 -                       AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
423 -               ]
424 -       )
425 +               ]])],[ ac_cv_have_broken_snprintf="no" ],[ ac_cv_have_broken_snprintf="yes" 
426 +       ],[])
427 +])
428 +if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
429 +       AC_DEFINE(BROKEN_SNPRINTF)
430 +       AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
431 +fi
432  fi
433  
434  dnl see whether mkstemp() requires XXXXXX
435  if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
436  AC_MSG_CHECKING([for (overly) strict mkstemp])
437 -AC_TRY_RUN(
438 -       [
439 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
440  #include <stdlib.h>
441  main() { char template[]="conftest.mkstemp-test";
442  if (mkstemp(template) == -1)
443         exit(1);
444  unlink(template); exit(0);
445  }
446 -       ],
447 -       [
448 +       ]])],[
449                 AC_MSG_RESULT(no)
450 -       ],
451 -       [
452 +       ],[ 
453                 AC_MSG_RESULT(yes)
454                 AC_DEFINE(HAVE_STRICT_MKSTEMP)
455 -       ],
456 -       [
457 +       ],[
458                 AC_MSG_RESULT(yes)
459                 AC_DEFINE(HAVE_STRICT_MKSTEMP)
460 -       ]
461 -)
462 +        
463 +])
464  fi
465  
466  dnl make sure that openpty does not reacquire controlling terminal
467  if test ! -z "$check_for_openpty_ctty_bug"; then
468 -       AC_MSG_CHECKING(if openpty correctly handles controlling tty)
469 -       AC_TRY_RUN(
470 -               [
471 +AC_CACHE_CHECK([if openpty acquires controlling terminal],
472 +       ac_cv_have_openpty_ctty_bug, [
473 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
474  #include <stdio.h>
475  #include <sys/fcntl.h>
476  #include <sys/types.h>
477 @@ -941,7 +910,7 @@
478                 exit(1);
479         } else if (pid > 0) {   /* parent */
480                 waitpid(pid, &status, 0);
481 -               if (WIFEXITED(status))
482 +               if (WIFEXITED(status)) 
483                         exit(WEXITSTATUS(status));
484                 else
485                         exit(2);
486 @@ -956,15 +925,12 @@
487                         exit(0);        /* Did not acquire ctty: OK */
488         }
489  }
490 -               ],
491 -               [
492 -                       AC_MSG_RESULT(yes)
493 -               ],
494 -               [
495 -                       AC_MSG_RESULT(no)
496 -                       AC_DEFINE(SSHD_ACQUIRES_CTTY)
497 -               ]
498 -       )
499 +               ]])],[ ac_cv_have_openpty_ctty_bug="no" ],[ ac_cv_have_openpty_ctty_bug="yes" 
500 +       ],[])
501 +])
502 +if test "x$ac_cv_have_openpty_ctty_bug" = "xyes" ; then
503 +       AC_DEFINE(SSHD_ACQUIRES_CTTY)
504 +fi
505  fi
506  
507  AC_FUNC_GETPGRP
508 @@ -1002,23 +968,19 @@
509  if test "x$PAM_MSG" = "xyes" ; then
510         # Check PAM strerror arguments (old PAM)
511         AC_MSG_CHECKING([whether pam_strerror takes only one argument])
512 -       AC_TRY_COMPILE(
513 -               [
514 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
515  #include <stdlib.h>
516  #if defined(HAVE_SECURITY_PAM_APPL_H)
517  #include <security/pam_appl.h>
518  #elif defined (HAVE_PAM_PAM_APPL_H)
519  #include <pam/pam_appl.h>
520  #endif
521 -               ],
522 -               [(void)pam_strerror((pam_handle_t *)NULL, -1);],
523 -               [AC_MSG_RESULT(no)],
524 -               [
525 +               ]], [[(void)pam_strerror((pam_handle_t *)NULL, -1);]])],[AC_MSG_RESULT(no)],[
526                         AC_DEFINE(HAVE_OLD_PAM)
527                         AC_MSG_RESULT(yes)
528                         PAM_MSG="yes (old library)"
529 -               ]
530 -       )
531 +               
532 +       ])
533  fi
534  
535  # Search for OpenSSL
536 @@ -1069,87 +1031,87 @@
537  
538  # Determine OpenSSL header version
539  AC_MSG_CHECKING([OpenSSL header version])
540 -AC_TRY_RUN(
541 -       [
542 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
543  #include <stdio.h>
544  #include <string.h>
545  #include <openssl/opensslv.h>
546  #define DATA "conftest.sslincver"
547  int main(void) {
548 -       FILE *fd;
549 -       int rc;
550 +        FILE *fd;
551 +        int rc;
552  
553 -       fd = fopen(DATA,"w");
554 -       if(fd == NULL)
555 -               exit(1);
556 +        fd = fopen(DATA,"w");
557 +        if(fd == NULL)
558 +                exit(1);
559  
560         if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
561                 exit(1);
562  
563         exit(0);
564  }
565 -       ],
566 -       [
567 +       ]])],[
568                 ssl_header_ver=`cat conftest.sslincver`
569                 AC_MSG_RESULT($ssl_header_ver)
570 -       ],
571 -       [
572 +       ],[
573                 AC_MSG_RESULT(not found)
574                 AC_MSG_ERROR(OpenSSL version header not found.)
575 -       ]
576 -)
577 +       ],[
578 +               AC_MSG_RESULT(unknown)
579 +               AC_MSG_WARN(Skipping OpenSSL header version check due to crosscompilation.)
580 +       
581 +])
582  
583  # Determine OpenSSL library version
584  AC_MSG_CHECKING([OpenSSL library version])
585 -AC_TRY_RUN(
586 -       [
587 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
588  #include <stdio.h>
589  #include <string.h>
590  #include <openssl/opensslv.h>
591  #include <openssl/crypto.h>
592  #define DATA "conftest.ssllibver"
593  int main(void) {
594 -       FILE *fd;
595 -       int rc;
596 +        FILE *fd;
597 +        int rc;
598  
599 -       fd = fopen(DATA,"w");
600 -       if(fd == NULL)
601 -               exit(1);
602 +        fd = fopen(DATA,"w");
603 +        if(fd == NULL)
604 +                exit(1);
605  
606         if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
607                 exit(1);
608  
609         exit(0);
610  }
611 -       ],
612 -       [
613 +       ]])],[
614                 ssl_library_ver=`cat conftest.ssllibver`
615                 AC_MSG_RESULT($ssl_library_ver)
616 -       ],
617 -       [
618 +       ],[
619                 AC_MSG_RESULT(not found)
620                 AC_MSG_ERROR(OpenSSL library not found.)
621 -       ]
622 -)
623 +       ],[
624 +               AC_MSG_RESULT(unknown)
625 +               AC_MSG_WARN(Skipping OpenSSL library version check due to crosscompilation.)
626 +       
627 +])
628  
629  # Sanity check OpenSSL headers
630  AC_MSG_CHECKING([whether OpenSSL's headers match the library])
631 -AC_TRY_RUN(
632 -       [
633 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
634  #include <string.h>
635  #include <openssl/opensslv.h>
636  int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
637 -       ],
638 -       [
639 +       ]])],[
640                 AC_MSG_RESULT(yes)
641 -       ],
642 -       [
643 +       ],[
644                 AC_MSG_RESULT(no)
645                 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
646  Check config.log for details.
647  Also see contrib/findssl.sh for help identifying header/library mismatches.])
648 -       ]
649 -)
650 +       ],[
651 +               AC_MSG_RESULT(unknown)
652 +               AC_MSG_WARN(Skipping OpenSSL version comparison due to crosscompilation.)
653 +       
654 +])
655  
656  # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
657  # because the system crypt() is more featureful.
658 @@ -1157,42 +1119,20 @@
659         AC_CHECK_LIB(crypt, crypt)
660  fi
661  
662 -# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
663 +# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the 
664  # version in OpenSSL.
665  if test "x$check_for_libcrypt_later" = "x1"; then
666         AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
667  fi
668  
669 -
670  ### Configure cryptographic random number support
671  
672 -# Check wheter OpenSSL seeds itself
673 -AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
674 -AC_TRY_RUN(
675 -       [
676 -#include <string.h>
677 -#include <openssl/rand.h>
678 -int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
679 -       ],
680 -       [
681 -               OPENSSL_SEEDS_ITSELF=yes
682 -               AC_MSG_RESULT(yes)
683 -       ],
684 -       [
685 -               AC_MSG_RESULT(no)
686 -               # Default to use of the rand helper if OpenSSL doesn't
687 -               # seed itself
688 -               USE_RAND_HELPER=yes
689 -       ]
690 -)
691 -
692 -
693  # Do we want to force the use of the rand helper?
694  AC_ARG_WITH(rand-helper,
695         [  --with-rand-helper      Use subprocess to gather strong randomness ],
696         [
697                 if test "x$withval" = "xno" ; then
698 -                       # Force use of OpenSSL's internal RNG, even if
699 +                       # Force use of OpenSSL's internal RNG, even if 
700                         # the previous test showed it to be unseeded.
701                         if test -z "$OPENSSL_SEEDS_ITSELF" ; then
702                                 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
703 @@ -1203,6 +1143,24 @@
704                         USE_RAND_HELPER=yes
705                 fi
706         ],
707 +       # Check whether OpenSSL seeds itself
708 +       [
709 +               AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
710 +               AC_RUN_IFELSE([AC_LANG_SOURCE([[
711 +               #include <string.h>
712 +               #include <openssl/rand.h>
713 +               int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
714 +                       ]])],[
715 +                               OPENSSL_SEEDS_ITSELF=yes
716 +                               AC_MSG_RESULT(yes)
717 +                       ],[
718 +                               AC_MSG_RESULT(no)
719 +                               # Default to use of the rand helper if OpenSSL doesn't
720 +                               # seed itself
721 +                               USE_RAND_HELPER=yes
722 +                       
723 +               ],[])
724 +       ]
725  )      
726  
727  # Which randomness source do we use?
728 @@ -1329,7 +1287,7 @@
729  test -d /usr/sbin && PATH=$PATH:/usr/sbin
730  PATH=$PATH:/etc:$OPATH
731  
732 -# These programs are used by the command hashing source to gather entropy
733 +# These programs are used by the command hashing source to gather entropy 
734  OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
735  OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
736  OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
737 @@ -1384,12 +1342,8 @@
738  
739  # More checks for data types
740  AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
741 -       AC_TRY_COMPILE(
742 -               [ #include <sys/types.h> ],
743 -               [ u_int a; a = 1;],
744 -               [ ac_cv_have_u_int="yes" ],
745 -               [ ac_cv_have_u_int="no" ]
746 -       )
747 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int a; a = 1;]])],[ ac_cv_have_u_int="yes" ],[ ac_cv_have_u_int="no" 
748 +       ])
749  ])
750  if test "x$ac_cv_have_u_int" = "xyes" ; then
751         AC_DEFINE(HAVE_U_INT)
752 @@ -1397,12 +1351,8 @@
753  fi
754  
755  AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
756 -       AC_TRY_COMPILE(
757 -               [ #include <sys/types.h> ],
758 -               [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
759 -               [ ac_cv_have_intxx_t="yes" ],
760 -               [ ac_cv_have_intxx_t="no" ]
761 -       )
762 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],[ ac_cv_have_intxx_t="yes" ],[ ac_cv_have_intxx_t="no" 
763 +       ])
764  ])
765  if test "x$ac_cv_have_intxx_t" = "xyes" ; then
766         AC_DEFINE(HAVE_INTXX_T)
767 @@ -1410,23 +1360,18 @@
768  fi
769  
770  if (test -z "$have_intxx_t" && \
771 -          test "x$ac_cv_header_stdint_h" = "xyes")
772 +           test "x$ac_cv_header_stdint_h" = "xyes")
773  then
774      AC_MSG_CHECKING([for intXX_t types in stdint.h])
775 -       AC_TRY_COMPILE(
776 -               [ #include <stdint.h> ],
777 -               [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
778 -               [
779 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],[
780                         AC_DEFINE(HAVE_INTXX_T)
781                         AC_MSG_RESULT(yes)
782 -               ],
783 -               [ AC_MSG_RESULT(no) ]
784 -       )
785 +               ],[ AC_MSG_RESULT(no) 
786 +       ])
787  fi
788  
789  AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
790 -       AC_TRY_COMPILE(
791 -               [
792 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
793  #include <sys/types.h>
794  #ifdef HAVE_STDINT_H
795  # include <stdint.h>
796 @@ -1435,23 +1380,16 @@
797  #ifdef HAVE_SYS_BITYPES_H
798  # include <sys/bitypes.h>
799  #endif
800 -               ],
801 -               [ int64_t a; a = 1;],
802 -               [ ac_cv_have_int64_t="yes" ],
803 -               [ ac_cv_have_int64_t="no" ]
804 -       )
805 +               ]], [[ int64_t a; a = 1;]])],[ ac_cv_have_int64_t="yes" ],[ ac_cv_have_int64_t="no" 
806 +       ])
807  ])
808  if test "x$ac_cv_have_int64_t" = "xyes" ; then
809         AC_DEFINE(HAVE_INT64_T)
810  fi
811  
812  AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
813 -       AC_TRY_COMPILE(
814 -               [ #include <sys/types.h> ],
815 -               [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
816 -               [ ac_cv_have_u_intxx_t="yes" ],
817 -               [ ac_cv_have_u_intxx_t="no" ]
818 -       )
819 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],[ ac_cv_have_u_intxx_t="yes" ],[ ac_cv_have_u_intxx_t="no" 
820 +       ])
821  ])
822  if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
823         AC_DEFINE(HAVE_U_INTXX_T)
824 @@ -1460,24 +1398,16 @@
825  
826  if test -z "$have_u_intxx_t" ; then
827      AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
828 -       AC_TRY_COMPILE(
829 -               [ #include <sys/socket.h> ],
830 -               [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
831 -               [
832 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],[
833                         AC_DEFINE(HAVE_U_INTXX_T)
834                         AC_MSG_RESULT(yes)
835 -               ],
836 -               [ AC_MSG_RESULT(no) ]
837 -       )
838 +               ],[ AC_MSG_RESULT(no) 
839 +       ])
840  fi
841  
842  AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
843 -       AC_TRY_COMPILE(
844 -               [ #include <sys/types.h> ],
845 -               [ u_int64_t a; a = 1;],
846 -               [ ac_cv_have_u_int64_t="yes" ],
847 -               [ ac_cv_have_u_int64_t="no" ]
848 -       )
849 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int64_t a; a = 1;]])],[ ac_cv_have_u_int64_t="yes" ],[ ac_cv_have_u_int64_t="no" 
850 +       ])
851  ])
852  if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
853         AC_DEFINE(HAVE_U_INT64_T)
854 @@ -1486,27 +1416,19 @@
855  
856  if test -z "$have_u_int64_t" ; then
857      AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
858 -       AC_TRY_COMPILE(
859 -               [ #include <sys/bitypes.h> ],
860 -               [ u_int64_t a; a = 1],
861 -               [
862 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], [[ u_int64_t a; a = 1]])],[
863                         AC_DEFINE(HAVE_U_INT64_T)
864                         AC_MSG_RESULT(yes)
865 -               ],
866 -               [ AC_MSG_RESULT(no) ]
867 -       )
868 +               ],[ AC_MSG_RESULT(no) 
869 +       ])
870  fi
871  
872  if test -z "$have_u_intxx_t" ; then
873         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
874 -               AC_TRY_COMPILE(
875 -                       [
876 +               AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
877  #include <sys/types.h>
878 -                       ],
879 -                       [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
880 -                       [ ac_cv_have_uintxx_t="yes" ],
881 -                       [ ac_cv_have_uintxx_t="no" ]
882 -               )
883 +                       ]], [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ]])],[ ac_cv_have_uintxx_t="yes" ],[ ac_cv_have_uintxx_t="no" 
884 +               ])
885         ])
886         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
887                 AC_DEFINE(HAVE_UINTXX_T)
888 @@ -1515,49 +1437,37 @@
889  
890  if test -z "$have_uintxx_t" ; then
891      AC_MSG_CHECKING([for uintXX_t types in stdint.h])
892 -       AC_TRY_COMPILE(
893 -               [ #include <stdint.h> ],
894 -               [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
895 -               [
896 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])],[
897                         AC_DEFINE(HAVE_UINTXX_T)
898                         AC_MSG_RESULT(yes)
899 -               ],
900 -               [ AC_MSG_RESULT(no) ]
901 -       )
902 +               ],[ AC_MSG_RESULT(no) 
903 +       ])
904  fi
905  
906  if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
907 -          test "x$ac_cv_header_sys_bitypes_h" = "xyes")
908 +           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
909  then
910         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
911 -       AC_TRY_COMPILE(
912 -               [
913 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
914  #include <sys/bitypes.h>
915 -               ],
916 -               [
917 +               ]], [[
918                         int8_t a; int16_t b; int32_t c;
919                         u_int8_t e; u_int16_t f; u_int32_t g;
920                         a = b = c = e = f = g = 1;
921 -               ],
922 -               [
923 +               ]])],[
924                         AC_DEFINE(HAVE_U_INTXX_T)
925                         AC_DEFINE(HAVE_INTXX_T)
926                         AC_MSG_RESULT(yes)
927 -               ],
928 -               [AC_MSG_RESULT(no)]
929 -       )
930 +               ],[AC_MSG_RESULT(no)
931 +       ]) 
932  fi
933  
934  
935  AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
936 -       AC_TRY_COMPILE(
937 -               [
938 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
939  #include <sys/types.h>
940 -               ],
941 -               [ u_char foo; foo = 125; ],
942 -               [ ac_cv_have_u_char="yes" ],
943 -               [ ac_cv_have_u_char="no" ]
944 -       )
945 +               ]], [[ u_char foo; foo = 125; ]])],[ ac_cv_have_u_char="yes" ],[ ac_cv_have_u_char="no" 
946 +       ])
947  ])
948  if test "x$ac_cv_have_u_char" = "xyes" ; then
949         AC_DEFINE(HAVE_U_CHAR)
950 @@ -1568,95 +1478,66 @@
951  AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
952  
953  AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
954 -       AC_TRY_COMPILE(
955 -               [
956 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
957  #include <sys/types.h>
958 -               ],
959 -               [ size_t foo; foo = 1235; ],
960 -               [ ac_cv_have_size_t="yes" ],
961 -               [ ac_cv_have_size_t="no" ]
962 -       )
963 +               ]], [[ size_t foo; foo = 1235; ]])],[ ac_cv_have_size_t="yes" ],[ ac_cv_have_size_t="no" 
964 +       ])
965  ])
966  if test "x$ac_cv_have_size_t" = "xyes" ; then
967         AC_DEFINE(HAVE_SIZE_T)
968  fi
969  
970  AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
971 -       AC_TRY_COMPILE(
972 -               [
973 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
974  #include <sys/types.h>
975 -               ],
976 -               [ ssize_t foo; foo = 1235; ],
977 -               [ ac_cv_have_ssize_t="yes" ],
978 -               [ ac_cv_have_ssize_t="no" ]
979 -       )
980 +               ]], [[ ssize_t foo; foo = 1235; ]])],[ ac_cv_have_ssize_t="yes" ],[ ac_cv_have_ssize_t="no" 
981 +       ])
982  ])
983  if test "x$ac_cv_have_ssize_t" = "xyes" ; then
984         AC_DEFINE(HAVE_SSIZE_T)
985  fi
986  
987  AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
988 -       AC_TRY_COMPILE(
989 -               [
990 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
991  #include <time.h>
992 -               ],
993 -               [ clock_t foo; foo = 1235; ],
994 -               [ ac_cv_have_clock_t="yes" ],
995 -               [ ac_cv_have_clock_t="no" ]
996 -       )
997 +               ]], [[ clock_t foo; foo = 1235; ]])],[ ac_cv_have_clock_t="yes" ],[ ac_cv_have_clock_t="no" 
998 +       ])
999  ])
1000  if test "x$ac_cv_have_clock_t" = "xyes" ; then
1001         AC_DEFINE(HAVE_CLOCK_T)
1002  fi
1003  
1004  AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1005 -       AC_TRY_COMPILE(
1006 -               [
1007 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1008  #include <sys/types.h>
1009  #include <sys/socket.h>
1010 -               ],
1011 -               [ sa_family_t foo; foo = 1235; ],
1012 -               [ ac_cv_have_sa_family_t="yes" ],
1013 -               [ AC_TRY_COMPILE(
1014 -                 [
1015 +               ]], [[ sa_family_t foo; foo = 1235; ]])],[ ac_cv_have_sa_family_t="yes" ],[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1016  #include <sys/types.h>
1017  #include <sys/socket.h>
1018  #include <netinet/in.h>
1019 -               ],
1020 -               [ sa_family_t foo; foo = 1235; ],
1021 -               [ ac_cv_have_sa_family_t="yes" ],
1022 -
1023 -               [ ac_cv_have_sa_family_t="no" ]
1024 -       )]
1025 -       )
1026 +               ]], [[ sa_family_t foo; foo = 1235; ]])],[ ac_cv_have_sa_family_t="yes" ],[ ac_cv_have_sa_family_t="no" 
1027 +       ])
1028 +       ])
1029  ])
1030  if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1031         AC_DEFINE(HAVE_SA_FAMILY_T)
1032  fi
1033  
1034  AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1035 -       AC_TRY_COMPILE(
1036 -               [
1037 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1038  #include <sys/types.h>
1039 -               ],
1040 -               [ pid_t foo; foo = 1235; ],
1041 -               [ ac_cv_have_pid_t="yes" ],
1042 -               [ ac_cv_have_pid_t="no" ]
1043 -       )
1044 +               ]], [[ pid_t foo; foo = 1235; ]])],[ ac_cv_have_pid_t="yes" ],[ ac_cv_have_pid_t="no" 
1045 +       ])
1046  ])
1047  if test "x$ac_cv_have_pid_t" = "xyes" ; then
1048         AC_DEFINE(HAVE_PID_T)
1049  fi
1050  
1051  AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1052 -       AC_TRY_COMPILE(
1053 -               [
1054 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1055  #include <sys/types.h>
1056 -               ],
1057 -               [ mode_t foo; foo = 1235; ],
1058 -               [ ac_cv_have_mode_t="yes" ],
1059 -               [ ac_cv_have_mode_t="no" ]
1060 -       )
1061 +               ]], [[ mode_t foo; foo = 1235; ]])],[ ac_cv_have_mode_t="yes" ],[ ac_cv_have_mode_t="no" 
1062 +       ])
1063  ])
1064  if test "x$ac_cv_have_mode_t" = "xyes" ; then
1065         AC_DEFINE(HAVE_MODE_T)
1066 @@ -1664,73 +1545,53 @@
1067  
1068  
1069  AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1070 -       AC_TRY_COMPILE(
1071 -               [
1072 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1073  #include <sys/types.h>
1074  #include <sys/socket.h>
1075 -               ],
1076 -               [ struct sockaddr_storage s; ],
1077 -               [ ac_cv_have_struct_sockaddr_storage="yes" ],
1078 -               [ ac_cv_have_struct_sockaddr_storage="no" ]
1079 -       )
1080 +               ]], [[ struct sockaddr_storage s; ]])],[ ac_cv_have_struct_sockaddr_storage="yes" ],[ ac_cv_have_struct_sockaddr_storage="no" 
1081 +       ])
1082  ])
1083  if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1084         AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1085  fi
1086  
1087  AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1088 -       AC_TRY_COMPILE(
1089 -               [
1090 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1091  #include <sys/types.h>
1092  #include <netinet/in.h>
1093 -               ],
1094 -               [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1095 -               [ ac_cv_have_struct_sockaddr_in6="yes" ],
1096 -               [ ac_cv_have_struct_sockaddr_in6="no" ]
1097 -       )
1098 +               ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],[ ac_cv_have_struct_sockaddr_in6="yes" ],[ ac_cv_have_struct_sockaddr_in6="no" 
1099 +       ])
1100  ])
1101  if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1102         AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1103  fi
1104  
1105  AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1106 -       AC_TRY_COMPILE(
1107 -               [
1108 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1109  #include <sys/types.h>
1110  #include <netinet/in.h>
1111 -               ],
1112 -               [ struct in6_addr s; s.s6_addr[0] = 0; ],
1113 -               [ ac_cv_have_struct_in6_addr="yes" ],
1114 -               [ ac_cv_have_struct_in6_addr="no" ]
1115 -       )
1116 +               ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],[ ac_cv_have_struct_in6_addr="yes" ],[ ac_cv_have_struct_in6_addr="no" 
1117 +       ])
1118  ])
1119  if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1120         AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1121  fi
1122  
1123  AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1124 -       AC_TRY_COMPILE(
1125 -               [
1126 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1127  #include <sys/types.h>
1128  #include <sys/socket.h>
1129  #include <netdb.h>
1130 -               ],
1131 -               [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1132 -               [ ac_cv_have_struct_addrinfo="yes" ],
1133 -               [ ac_cv_have_struct_addrinfo="no" ]
1134 -       )
1135 +               ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],[ ac_cv_have_struct_addrinfo="yes" ],[ ac_cv_have_struct_addrinfo="no" 
1136 +       ])
1137  ])
1138  if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1139         AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1140  fi
1141  
1142  AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1143 -       AC_TRY_COMPILE(
1144 -               [ #include <sys/time.h> ],
1145 -               [ struct timeval tv; tv.tv_sec = 1;],
1146 -               [ ac_cv_have_struct_timeval="yes" ],
1147 -               [ ac_cv_have_struct_timeval="no" ]
1148 -       )
1149 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], [[ struct timeval tv; tv.tv_sec = 1;]])],[ ac_cv_have_struct_timeval="yes" ],[ ac_cv_have_struct_timeval="no" 
1150 +       ])
1151  ])
1152  if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1153         AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1154 @@ -1749,32 +1610,42 @@
1155         exit 1;
1156  else
1157  dnl test snprintf (broken on SCO w/gcc)
1158 -       AC_TRY_RUN(
1159 -               [
1160 -#include <stdio.h>
1161 -#include <string.h>
1162 -#ifdef HAVE_SNPRINTF
1163 -main()
1164 -{
1165 -       char buf[50];
1166 -       char expected_out[50];
1167 -       int mazsize = 50 ;
1168 -#if (SIZEOF_LONG_INT == 8)
1169 -       long int num = 0x7fffffffffffffff;
1170 -#else
1171 -       long long num = 0x7fffffffffffffffll;
1172 -#endif
1173 -       strcpy(expected_out, "9223372036854775807");
1174 -       snprintf(buf, mazsize, "%lld", num);
1175 -       if(strcmp(buf, expected_out) != 0)
1176 -               exit(1);
1177 -       exit(0);
1178 -}
1179 -#else
1180 -main() { exit(0); }
1181 -#endif
1182 -               ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1183 -       )
1184 +       if test "x$ac_cv_have_broken_snprintf" != "xyes" ; then
1185 +#              no need to test again if we already know its broken :)
1186 +               AC_CACHE_CHECK([whether snprintf is broken],
1187 +               ac_cv_have_broken_snprintf, [
1188 +                       AC_RUN_IFELSE([AC_LANG_SOURCE([[
1189 +               #include <stdio.h>
1190 +               #include <string.h>
1191 +               #ifdef HAVE_SNPRINTF
1192 +               main()
1193 +               {
1194 +                       char buf[50];
1195 +                       char expected_out[50];
1196 +                       int mazsize = 50 ;
1197 +               #if (SIZEOF_LONG_INT == 8)
1198 +                       long int num = 0x7fffffffffffffff;
1199 +               #else
1200 +                       long long num = 0x7fffffffffffffffll;
1201 +               #endif
1202 +                       strcpy(expected_out, "9223372036854775807");
1203 +                       snprintf(buf, mazsize, "%lld", num);
1204 +                       if(strcmp(buf, expected_out) != 0)
1205 +                               exit(1);
1206 +                       exit(0);
1207 +               }
1208 +               #else
1209 +               main() { exit(0); }
1210 +               #endif
1211 +                               ]])],[ true ],[ 
1212 +                                       ac_cv_have_broken_snprintf="yes"
1213 +                                       
1214 +                       ],[])
1215 +               ])
1216 +               if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
1217 +                       AC_DEFINE(BROKEN_SNPRINTF)
1218 +               fi
1219 +       fi
1220  fi
1221  
1222  dnl Checks for structure members
1223 @@ -1800,15 +1671,10 @@
1224  
1225  AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1226                 ac_cv_have_ss_family_in_struct_ss, [
1227 -       AC_TRY_COMPILE(
1228 -               [
1229 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1230  #include <sys/types.h>
1231  #include <sys/socket.h>
1232 -               ],
1233 -               [ struct sockaddr_storage s; s.ss_family = 1; ],
1234 -               [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1235 -               [ ac_cv_have_ss_family_in_struct_ss="no" ],
1236 -       )
1237 +               ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])],[ ac_cv_have_ss_family_in_struct_ss="yes" ],[ ac_cv_have_ss_family_in_struct_ss="no" ])
1238  ])
1239  if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1240         AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1241 @@ -1816,15 +1682,11 @@
1242  
1243  AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1244                 ac_cv_have___ss_family_in_struct_ss, [
1245 -       AC_TRY_COMPILE(
1246 -               [
1247 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1248  #include <sys/types.h>
1249  #include <sys/socket.h>
1250 -               ],
1251 -               [ struct sockaddr_storage s; s.__ss_family = 1; ],
1252 -               [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1253 -               [ ac_cv_have___ss_family_in_struct_ss="no" ]
1254 -       )
1255 +               ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])],[ ac_cv_have___ss_family_in_struct_ss="yes" ],[ ac_cv_have___ss_family_in_struct_ss="no" 
1256 +       ])
1257  ])
1258  if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1259         AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1260 @@ -1832,14 +1694,10 @@
1261  
1262  AC_CACHE_CHECK([for pw_class field in struct passwd],
1263                 ac_cv_have_pw_class_in_struct_passwd, [
1264 -       AC_TRY_COMPILE(
1265 -               [
1266 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1267  #include <pwd.h>
1268 -               ],
1269 -               [ struct passwd p; p.pw_class = 0; ],
1270 -               [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1271 -               [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1272 -       )
1273 +               ]], [[ struct passwd p; p.pw_class = 0; ]])],[ ac_cv_have_pw_class_in_struct_passwd="yes" ],[ ac_cv_have_pw_class_in_struct_passwd="no" 
1274 +       ])
1275  ])
1276  if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1277         AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1278 @@ -1847,14 +1705,10 @@
1279  
1280  AC_CACHE_CHECK([for pw_expire field in struct passwd],
1281                 ac_cv_have_pw_expire_in_struct_passwd, [
1282 -       AC_TRY_COMPILE(
1283 -               [
1284 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1285  #include <pwd.h>
1286 -               ],
1287 -               [ struct passwd p; p.pw_expire = 0; ],
1288 -               [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1289 -               [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1290 -       )
1291 +               ]], [[ struct passwd p; p.pw_expire = 0; ]])],[ ac_cv_have_pw_expire_in_struct_passwd="yes" ],[ ac_cv_have_pw_expire_in_struct_passwd="no" 
1292 +       ])
1293  ])
1294  if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1295         AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1296 @@ -1862,14 +1716,10 @@
1297  
1298  AC_CACHE_CHECK([for pw_change field in struct passwd],
1299                 ac_cv_have_pw_change_in_struct_passwd, [
1300 -       AC_TRY_COMPILE(
1301 -               [
1302 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1303  #include <pwd.h>
1304 -               ],
1305 -               [ struct passwd p; p.pw_change = 0; ],
1306 -               [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1307 -               [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1308 -       )
1309 +               ]], [[ struct passwd p; p.pw_change = 0; ]])],[ ac_cv_have_pw_change_in_struct_passwd="yes" ],[ ac_cv_have_pw_change_in_struct_passwd="no" 
1310 +       ])
1311  ])
1312  if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1313         AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1314 @@ -1878,8 +1728,7 @@
1315  dnl make sure we're using the real structure members and not defines
1316  AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1317                 ac_cv_have_accrights_in_msghdr, [
1318 -       AC_TRY_RUN(
1319 -               [
1320 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
1321  #include <sys/types.h>
1322  #include <sys/socket.h>
1323  #include <sys/uio.h>
1324 @@ -1891,10 +1740,8 @@
1325  m.msg_accrights = 0;
1326  exit(0);
1327  }
1328 -               ],
1329 -               [ ac_cv_have_accrights_in_msghdr="yes" ],
1330 -               [ ac_cv_have_accrights_in_msghdr="no" ]
1331 -       )
1332 +               ]])],[ ac_cv_have_accrights_in_msghdr="yes" ],[ ac_cv_have_accrights_in_msghdr="no" 
1333 +       ],[])
1334  ])
1335  if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1336         AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1337 @@ -1902,8 +1749,7 @@
1338  
1339  AC_CACHE_CHECK([for msg_control field in struct msghdr],
1340                 ac_cv_have_control_in_msghdr, [
1341 -       AC_TRY_RUN(
1342 -               [
1343 +       AC_RUN_IFELSE([AC_LANG_SOURCE([[
1344  #include <sys/types.h>
1345  #include <sys/socket.h>
1346  #include <sys/uio.h>
1347 @@ -1915,47 +1761,36 @@
1348  m.msg_control = 0;
1349  exit(0);
1350  }
1351 -               ],
1352 -               [ ac_cv_have_control_in_msghdr="yes" ],
1353 -               [ ac_cv_have_control_in_msghdr="no" ]
1354 -       )
1355 +               ]])],[ ac_cv_have_control_in_msghdr="yes" ],[ ac_cv_have_control_in_msghdr="no" 
1356 +       ],[])
1357  ])
1358  if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1359         AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1360  fi
1361  
1362  AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1363 -       AC_TRY_LINK([],
1364 -               [ extern char *__progname; printf("%s", __progname); ],
1365 -               [ ac_cv_libc_defines___progname="yes" ],
1366 -               [ ac_cv_libc_defines___progname="no" ]
1367 -       )
1368 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern char *__progname; printf("%s", __progname); ]])],[ ac_cv_libc_defines___progname="yes" ],[ ac_cv_libc_defines___progname="no" 
1369 +       ])
1370  ])
1371  if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1372         AC_DEFINE(HAVE___PROGNAME)
1373  fi
1374  
1375  AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1376 -       AC_TRY_LINK([
1377 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1378  #include <stdio.h>
1379 -],
1380 -               [ printf("%s", __FUNCTION__); ],
1381 -               [ ac_cv_cc_implements___FUNCTION__="yes" ],
1382 -               [ ac_cv_cc_implements___FUNCTION__="no" ]
1383 -       )
1384 +]], [[ printf("%s", __FUNCTION__); ]])],[ ac_cv_cc_implements___FUNCTION__="yes" ],[ ac_cv_cc_implements___FUNCTION__="no" 
1385 +       ])
1386  ])
1387  if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1388         AC_DEFINE(HAVE___FUNCTION__)
1389  fi
1390  
1391  AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1392 -       AC_TRY_LINK([
1393 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1394  #include <stdio.h>
1395 -],
1396 -               [ printf("%s", __func__); ],
1397 -               [ ac_cv_cc_implements___func__="yes" ],
1398 -               [ ac_cv_cc_implements___func__="no" ]
1399 -       )
1400 +]], [[ printf("%s", __func__); ]])],[ ac_cv_cc_implements___func__="yes" ],[ ac_cv_cc_implements___func__="no" 
1401 +       ])
1402  ])
1403  if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1404         AC_DEFINE(HAVE___func__)
1405 @@ -1963,25 +1798,18 @@
1406  
1407  AC_CACHE_CHECK([whether getopt has optreset support],
1408                 ac_cv_have_getopt_optreset, [
1409 -       AC_TRY_LINK(
1410 -               [
1411 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1412  #include <getopt.h>
1413 -               ],
1414 -               [ extern int optreset; optreset = 0; ],
1415 -               [ ac_cv_have_getopt_optreset="yes" ],
1416 -               [ ac_cv_have_getopt_optreset="no" ]
1417 -       )
1418 +               ]], [[ extern int optreset; optreset = 0; ]])],[ ac_cv_have_getopt_optreset="yes" ],[ ac_cv_have_getopt_optreset="no" 
1419 +       ])
1420  ])
1421  if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1422         AC_DEFINE(HAVE_GETOPT_OPTRESET)
1423  fi
1424  
1425  AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1426 -       AC_TRY_LINK([],
1427 -               [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1428 -               [ ac_cv_libc_defines_sys_errlist="yes" ],
1429 -               [ ac_cv_libc_defines_sys_errlist="no" ]
1430 -       )
1431 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])],[ ac_cv_libc_defines_sys_errlist="yes" ],[ ac_cv_libc_defines_sys_errlist="no" 
1432 +       ])
1433  ])
1434  if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1435         AC_DEFINE(HAVE_SYS_ERRLIST)
1436 @@ -1989,17 +1817,14 @@
1437  
1438  
1439  AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1440 -       AC_TRY_LINK([],
1441 -               [ extern int sys_nerr; printf("%i", sys_nerr);],
1442 -               [ ac_cv_libc_defines_sys_nerr="yes" ],
1443 -               [ ac_cv_libc_defines_sys_nerr="no" ]
1444 -       )
1445 +       AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern int sys_nerr; printf("%i", sys_nerr);]])],[ ac_cv_libc_defines_sys_nerr="yes" ],[ ac_cv_libc_defines_sys_nerr="no" 
1446 +       ])
1447  ])
1448  if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1449         AC_DEFINE(HAVE_SYS_NERR)
1450  fi
1451  
1452 -SCARD_MSG="no"
1453 +SCARD_MSG="no" 
1454  # Check whether user wants sectok support
1455  AC_ARG_WITH(sectok,
1456         [  --with-sectok           Enable smartcard support using libsectok],
1457 @@ -2025,15 +1850,14 @@
1458                         fi
1459                         AC_DEFINE(SMARTCARD)
1460                         AC_DEFINE(USE_SECTOK)
1461 -                       SCARD_MSG="yes, using sectok"
1462 +                       SCARD_MSG="yes, using sectok" 
1463                 fi
1464         ]
1465  )
1466  
1467  # Check whether user wants OpenSC support
1468  AC_ARG_WITH(opensc,
1469 -       AC_HELP_STRING([--with-opensc=PFX],
1470 -                      [Enable smartcard support using OpenSC]),
1471 +       AS_HELP_STRING(--with-opensc=PFX,Enable smartcard support using OpenSC),
1472         opensc_config_prefix="$withval", opensc_config_prefix="")
1473  if test x$opensc_config_prefix != x ; then
1474    OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1475 @@ -2045,36 +1869,36 @@
1476      LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1477      AC_DEFINE(SMARTCARD)
1478      AC_DEFINE(USE_OPENSC)
1479 -    SCARD_MSG="yes, using OpenSC"
1480 +    SCARD_MSG="yes, using OpenSC" 
1481    fi
1482  fi
1483  
1484  # Check libraries needed by DNS fingerprint support
1485 -AC_SEARCH_LIBS(getrrsetbyname, resolv,
1486 -       [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1487 -       [
1488 -               # Needed by our getrrsetbyname()
1489 -               AC_SEARCH_LIBS(res_query, resolv)
1490 -               AC_SEARCH_LIBS(dn_expand, resolv)
1491 -               AC_CHECK_FUNCS(_getshort _getlong)
1492 -               AC_CHECK_MEMBER(HEADER.ad,
1493 -                       [AC_DEFINE(HAVE_HEADER_AD)],,
1494 -                       [#include <arpa/nameser.h>])
1495 -       ])
1496 +                       AC_SEARCH_LIBS(getrrsetbyname, resolv, 
1497 +                               [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1498 +                               [
1499 +                                       # Needed by our getrrsetbyname()
1500 +                                       AC_SEARCH_LIBS(res_query, resolv)
1501 +                                       AC_SEARCH_LIBS(dn_expand, resolv)
1502 +                                       AC_CHECK_FUNCS(_getshort _getlong)
1503 +                                       AC_CHECK_MEMBER(HEADER.ad,
1504 +                                               [AC_DEFINE(HAVE_HEADER_AD)],,
1505 +                                               [#include <arpa/nameser.h>])
1506 +                               ])
1507  
1508  # Check whether user wants Kerberos 5 support
1509 -KRB5_MSG="no"
1510 +KRB5_MSG="no" 
1511  AC_ARG_WITH(kerberos5,
1512 -       [  --with-kerberos5=PATH   Enable Kerberos 5 support],
1513 +        [  --with-kerberos5=PATH   Enable Kerberos 5 support],
1514         [ if test "x$withval" != "xno" ; then
1515 -               if test "x$withval" = "xyes" ; then
1516 -                       KRB5ROOT="/usr/local"
1517 -               else
1518 -                       KRB5ROOT=${withval}
1519 -               fi
1520 +                        if test "x$withval" = "xyes" ; then
1521 +                                KRB5ROOT="/usr/local"
1522 +                        else
1523 +                                KRB5ROOT=${withval}
1524 +                        fi
1525  
1526 -               AC_DEFINE(KRB5)
1527 -               KRB5_MSG="yes"
1528 +                        AC_DEFINE(KRB5)
1529 +                       KRB5_MSG="yes"
1530  
1531                 AC_MSG_CHECKING(for krb5-config)
1532                 if test -x  $KRB5ROOT/bin/krb5-config ; then
1533 @@ -2094,27 +1918,21 @@
1534                         K5LIBS="`$KRB5CONF --libs $k5confopts`"
1535                         CPPFLAGS="$CPPFLAGS $K5CFLAGS"
1536                         AC_MSG_CHECKING(whether we are using Heimdal)
1537 -                       AC_TRY_COMPILE([ #include <krb5.h> ],
1538 -                                      [ char *tmp = heimdal_version; ],
1539 -                                      [ AC_MSG_RESULT(yes)
1540 -                                        AC_DEFINE(HEIMDAL) ],
1541 -                                        AC_MSG_RESULT(no)
1542 -                       )
1543 +                       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> ]], [[ char *tmp = heimdal_version; ]])],[ AC_MSG_RESULT(yes)
1544 +                                        AC_DEFINE(HEIMDAL) ],[AC_MSG_RESULT(no)
1545 +                       ])
1546                 else
1547                         AC_MSG_RESULT(no)
1548                         CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1549                         LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1550 -                       AC_MSG_CHECKING(whether we are using Heimdal)
1551 -                       AC_TRY_COMPILE([ #include <krb5.h> ],
1552 -                                      [ char *tmp = heimdal_version; ],
1553 -                                      [ AC_MSG_RESULT(yes)
1554 -                                        AC_DEFINE(HEIMDAL)
1555 -                                        K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1556 -                                      ],
1557 -                                      [ AC_MSG_RESULT(no)
1558 -                                        K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1559 -                                      ]
1560 -                       )
1561 +                        AC_MSG_CHECKING(whether we are using Heimdal)
1562 +                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> ]], [[ char *tmp = heimdal_version; ]])],[ AC_MSG_RESULT(yes)
1563 +                                         AC_DEFINE(HEIMDAL)
1564 +                                         K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1565 +                                       ],[ AC_MSG_RESULT(no)
1566 +                                         K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1567 +                                       
1568 +                        ])
1569                         AC_SEARCH_LIBS(dn_expand, resolv)
1570  
1571                         AC_CHECK_LIB(gssapi,gss_init_sec_context,
1572 @@ -2122,7 +1940,7 @@
1573                                   K5LIBS="-lgssapi $K5LIBS" ],
1574                                 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1575                                         [ AC_DEFINE(GSSAPI)
1576 -                                         K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1577 +                                         K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1578                                         AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1579                                         $K5LIBS)
1580                                 ],
1581 @@ -2130,10 +1948,10 @@
1582                         
1583                         AC_CHECK_HEADER(gssapi.h, ,
1584                                 [ unset ac_cv_header_gssapi_h
1585 -                                 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1586 +                                 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" 
1587                                   AC_CHECK_HEADERS(gssapi.h, ,
1588                                         AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1589 -                                 )
1590 +                                 ) 
1591                                 ]
1592                         )
1593  
1594 @@ -2142,7 +1960,7 @@
1595                         AC_CHECK_HEADER(gssapi_krb5.h, ,
1596                                         [ CPPFLAGS="$oldCPP" ])
1597  
1598 -               fi
1599 +                fi
1600                 if test ! -z "$need_dash_r" ; then
1601                         LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1602                 fi
1603 @@ -2157,7 +1975,7 @@
1604  
1605         LIBS="$LIBS $K5LIBS"
1606         AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
1607 -       ]
1608 +        ]
1609  )
1610  
1611  # Looking for programs, paths and files
1612 @@ -2221,7 +2039,7 @@
1613  
1614  if test -z "$no_dev_ptmx" ; then
1615         if test "x$disable_ptmx_check" != "xyes" ; then
1616 -               AC_CHECK_FILE("/dev/ptmx",
1617 +               AC_CHECK_FILE("/dev/ptmx", 
1618                         [
1619                                 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1620                                 have_dev_ptmx=1
1621 @@ -2229,13 +2047,14 @@
1622                 )
1623         fi
1624  fi
1625 -AC_CHECK_FILE("/dev/ptc",
1626 +if test "$cross_compiling" != yes; then
1627 +AC_CHECK_FILE("/dev/ptc", 
1628         [
1629                 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1630                 have_dev_ptc=1
1631         ]
1632  )
1633 -
1634 +fi
1635  # Options from here on. Some of these are preset by platform above
1636  AC_ARG_WITH(mantype,
1637         [  --with-mantype=man|cat|doc  Set man page type],
1638 @@ -2270,13 +2089,13 @@
1639  AC_SUBST(mansubdir)
1640  
1641  # Check whether to enable MD5 passwords
1642 -MD5_MSG="no"
1643 +MD5_MSG="no" 
1644  AC_ARG_WITH(md5-passwords,
1645         [  --with-md5-passwords    Enable use of MD5 passwords],
1646         [
1647                 if test "x$withval" != "xno" ; then
1648                         AC_DEFINE(HAVE_MD5_PASSWORDS)
1649 -                       MD5_MSG="yes"
1650 +                       MD5_MSG="yes" 
1651                 fi
1652         ]
1653  )
1654 @@ -2294,14 +2113,12 @@
1655  
1656  if test -z "$disable_shadow" ; then
1657         AC_MSG_CHECKING([if the systems has expire shadow information])
1658 -       AC_TRY_COMPILE(
1659 -       [
1660 +       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1661  #include <sys/types.h>
1662  #include <shadow.h>
1663         struct spwd sp;
1664 -       ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1665 -       [ sp_expire_available=yes ], []
1666 -       )
1667 +       ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])],[ sp_expire_available=yes ],[
1668 +       ])
1669  
1670         if test "x$sp_expire_available" = "xyes" ; then
1671                 AC_MSG_RESULT(yes)
1672 @@ -2316,13 +2133,13 @@
1673         DISPLAY_HACK_MSG="yes"
1674         AC_DEFINE(IPADDR_IN_DISPLAY)
1675  else
1676 -       DISPLAY_HACK_MSG="no"
1677 +       DISPLAY_HACK_MSG="no" 
1678         AC_ARG_WITH(ipaddr-display,
1679                 [  --with-ipaddr-display   Use ip address instead of hostname in \$DISPLAY],
1680                 [
1681                         if test "x$withval" != "xno" ; then     
1682                                 AC_DEFINE(IPADDR_IN_DISPLAY)
1683 -                               DISPLAY_HACK_MSG="yes"
1684 +                               DISPLAY_HACK_MSG="yes" 
1685                         fi
1686                 ]
1687         )
1688 @@ -2332,7 +2149,9 @@
1689  AC_ARG_ENABLE(etc-default-login,
1690         [  --disable-etc-default-login       Disable using PATH from /etc/default/login [no]],,
1691  [
1692 +if test "x$cross_compiling" != "xyes"; then
1693  AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
1694 +fi
1695  
1696  if test "x$external_path_file" = "x/etc/default/login"; then
1697         AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
1698 @@ -2346,7 +2165,7 @@
1699  fi
1700  
1701  # Whether to mess with the default path
1702 -SERVER_PATH_MSG="(default)"
1703 +SERVER_PATH_MSG="(default)" 
1704  AC_ARG_WITH(default-path,
1705         [  --with-default-path=    Specify default \$PATH environment for server],
1706         [
1707 @@ -2361,7 +2180,7 @@
1708  $external_path_file .])
1709                         fi
1710                         user_path="$withval"
1711 -                       SERVER_PATH_MSG="$withval"
1712 +                       SERVER_PATH_MSG="$withval" 
1713                 fi
1714         ],
1715         [ if test "x$external_path_file" = "x/etc/login.conf" ; then
1716 @@ -2372,8 +2191,7 @@
1717  If PATH is defined in $external_path_file, ensure the path to scp is included,
1718  otherwise scp will not work.])
1719                 fi
1720 -               AC_TRY_RUN(
1721 -                       [
1722 +               AC_RUN_IFELSE([AC_LANG_SOURCE([[
1723  /* find out what STDPATH is */
1724  #include <stdio.h>
1725  #ifdef HAVE_PATHS_H
1726 @@ -2405,10 +2223,8 @@
1727  
1728         exit(0);
1729  }
1730 -               ], [ user_path=`cat conftest.stdpath` ],
1731 -               [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1732 -               [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1733 -       )
1734 +               ]])],[ user_path=`cat conftest.stdpath` ],[ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],[ user_path="/usr/bin:/bin:/usr/sbin:/sbin" 
1735 +       ])
1736  # make sure $bindir is in USER_PATH so scp will work
1737                 t_bindir=`eval echo ${bindir}`
1738                 case $t_bindir in
1739 @@ -2445,14 +2261,14 @@
1740  
1741  
1742  AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1743 -IPV4_IN6_HACK_MSG="no"
1744 +IPV4_IN6_HACK_MSG="no" 
1745  AC_ARG_WITH(4in6,
1746         [  --with-4in6             Check for and convert IPv4 in IPv6 mapped addresses],
1747         [
1748                 if test "x$withval" != "xno" ; then
1749                         AC_MSG_RESULT(yes)
1750                         AC_DEFINE(IPV4_IN_IPV6)
1751 -                       IPV4_IN6_HACK_MSG="yes"
1752 +                       IPV4_IN6_HACK_MSG="yes" 
1753                 else
1754                         AC_MSG_RESULT(no)
1755                 fi
1756 @@ -2460,7 +2276,7 @@
1757                 if test "x$inet6_default_4in6" = "xyes"; then
1758                         AC_MSG_RESULT([yes (default)])
1759                         AC_DEFINE(IPV4_IN_IPV6)
1760 -                       IPV4_IN6_HACK_MSG="yes"
1761 +                       IPV4_IN6_HACK_MSG="yes" 
1762                 else
1763                         AC_MSG_RESULT([no (default)])
1764                 fi
1765 @@ -2485,7 +2301,7 @@
1766  if test ! -d $piddir ; then    
1767         piddir=`eval echo ${sysconfdir}`
1768         case $piddir in
1769 -               NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1770 +               NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1771         esac
1772  fi
1773  
1774 @@ -2557,7 +2373,7 @@
1775         [  --disable-pututline     disable use of pututline() etc. ([uw]tmp) [no]],
1776         [
1777                 if test "x$enableval" = "xno" ; then
1778 -                       AC_DEFINE(DISABLE_PUTUTLINE)
1779 +                       AC_DEFINE(DISABLE_PUTUTLINE) 
1780                 fi
1781         ]
1782  )
1783 @@ -2588,7 +2404,7 @@
1784  dnl lastlog detection
1785  dnl  NOTE: the code itself will detect if lastlog is a directory
1786  AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1787 -AC_TRY_COMPILE([
1788 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1789  #include <sys/types.h>
1790  #include <utmp.h>
1791  #ifdef HAVE_LASTLOG_H
1792 @@ -2600,13 +2416,10 @@
1793  #ifdef HAVE_LOGIN_H
1794  # include <login.h>
1795  #endif
1796 -       ],
1797 -       [ char *lastlog = LASTLOG_FILE; ],
1798 -       [ AC_MSG_RESULT(yes) ],
1799 -       [
1800 +       ]], [[ char *lastlog = LASTLOG_FILE; ]])],[ AC_MSG_RESULT(yes) ],[
1801                 AC_MSG_RESULT(no)
1802                 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1803 -               AC_TRY_COMPILE([
1804 +               AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1805  #include <sys/types.h>
1806  #include <utmp.h>
1807  #ifdef HAVE_LASTLOG_H
1808 @@ -2615,15 +2428,12 @@
1809  #ifdef HAVE_PATHS_H
1810  #  include <paths.h>
1811  #endif
1812 -               ],
1813 -               [ char *lastlog = _PATH_LASTLOG; ],
1814 -               [ AC_MSG_RESULT(yes) ],
1815 -               [
1816 +               ]], [[ char *lastlog = _PATH_LASTLOG; ]])],[ AC_MSG_RESULT(yes) ],[
1817                         AC_MSG_RESULT(no)
1818                         system_lastlog_path=no
1819                 ])
1820 -       ]
1821 -)
1822 +       
1823 +])
1824  
1825  if test -z "$conf_lastlog_location"; then
1826         if test x"$system_lastlog_path" = x"no" ; then
1827 @@ -2645,18 +2455,15 @@
1828  
1829  dnl utmp detection
1830  AC_MSG_CHECKING([if your system defines UTMP_FILE])
1831 -AC_TRY_COMPILE([
1832 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1833  #include <sys/types.h>
1834  #include <utmp.h>
1835  #ifdef HAVE_PATHS_H
1836  #  include <paths.h>
1837  #endif
1838 -       ],
1839 -       [ char *utmp = UTMP_FILE; ],
1840 -       [ AC_MSG_RESULT(yes) ],
1841 -       [ AC_MSG_RESULT(no)
1842 -         system_utmp_path=no ]
1843 -)
1844 +       ]], [[ char *utmp = UTMP_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1845 +         system_utmp_path=no 
1846 +])
1847  if test -z "$conf_utmp_location"; then
1848         if test x"$system_utmp_path" = x"no" ; then
1849                 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1850 @@ -2675,18 +2482,15 @@
1851  
1852  dnl wtmp detection
1853  AC_MSG_CHECKING([if your system defines WTMP_FILE])
1854 -AC_TRY_COMPILE([
1855 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1856  #include <sys/types.h>
1857  #include <utmp.h>
1858  #ifdef HAVE_PATHS_H
1859  #  include <paths.h>
1860  #endif
1861 -       ],
1862 -       [ char *wtmp = WTMP_FILE; ],
1863 -       [ AC_MSG_RESULT(yes) ],
1864 -       [ AC_MSG_RESULT(no)
1865 -         system_wtmp_path=no ]
1866 -)
1867 +       ]], [[ char *wtmp = WTMP_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1868 +         system_wtmp_path=no 
1869 +])
1870  if test -z "$conf_wtmp_location"; then
1871         if test x"$system_wtmp_path" = x"no" ; then
1872                 for f in /usr/adm/wtmp /var/log/wtmp; do
1873 @@ -2708,7 +2512,7 @@
1874  dnl  utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1875  dnl  there, though.
1876  AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1877 -AC_TRY_COMPILE([
1878 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1879  #include <sys/types.h>
1880  #include <utmp.h>
1881  #ifdef HAVE_UTMPX_H
1882 @@ -2717,12 +2521,9 @@
1883  #ifdef HAVE_PATHS_H
1884  #  include <paths.h>
1885  #endif
1886 -       ],
1887 -       [ char *utmpx = UTMPX_FILE; ],
1888 -       [ AC_MSG_RESULT(yes) ],
1889 -       [ AC_MSG_RESULT(no)
1890 -         system_utmpx_path=no ]
1891 -)
1892 +       ]], [[ char *utmpx = UTMPX_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1893 +         system_utmpx_path=no 
1894 +])
1895  if test -z "$conf_utmpx_location"; then
1896         if test x"$system_utmpx_path" = x"no" ; then
1897                 AC_DEFINE(DISABLE_UTMPX)
1898 @@ -2733,7 +2534,7 @@
1899  
1900  dnl wtmpx detection
1901  AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1902 -AC_TRY_COMPILE([
1903 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1904  #include <sys/types.h>
1905  #include <utmp.h>
1906  #ifdef HAVE_UTMPX_H
1907 @@ -2742,12 +2543,9 @@
1908  #ifdef HAVE_PATHS_H
1909  #  include <paths.h>
1910  #endif
1911 -       ],
1912 -       [ char *wtmpx = WTMPX_FILE; ],
1913 -       [ AC_MSG_RESULT(yes) ],
1914 -       [ AC_MSG_RESULT(no)
1915 -         system_wtmpx_path=no ]
1916 -)
1917 +       ]], [[ char *wtmpx = WTMPX_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1918 +         system_wtmpx_path=no 
1919 +])
1920  if test -z "$conf_wtmpx_location"; then
1921         if test x"$system_wtmpx_path" = x"no" ; then
1922                 AC_DEFINE(DISABLE_WTMPX)
1923 @@ -2839,7 +2637,7 @@
1924  if test "x$PAM_MSG" = "xyes" ; then
1925         echo "PAM is enabled. You may need to install a PAM control file "
1926         echo "for sshd, otherwise password authentication may fail. "
1927 -       echo "Example PAM control files can be found in the contrib/ "
1928 +       echo "Example PAM control files can be found in the contrib/ " 
1929         echo "subdirectory"
1930         echo ""
1931  fi