- (djm) Bug #206 - blibpath isn't always needed for AIX ld, avoid
   sizeof(long long int) == 4 breakage. Patch from Matthew Clarke
   <Matthew_Clarke@mindlink.bc.ca>
diff --git a/ChangeLog b/ChangeLog
index 55bdc84..4195407 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,9 @@
    Reported by Doug Manton <dmanton@emea.att.com>
  - (djm) Bug #222: Fix tests for getaddrinfo on OSF/1. Spotted by
    Robert Urban <urban@spielwiese.de>
+ - (djm) Bug #206 - blibpath isn't always needed for AIX ld, avoid 
+   sizeof(long long int) == 4 breakage. Patch from Matthew Clarke
+   <Matthew_Clarke@mindlink.bc.ca>
  - (djm) Make privsep work with PAM (still experimental)
  - (djm) OpenBSD CVS Sync
    - deraadt@cvs.openbsd.org 2002/04/20 09:02:03
@@ -485,4 +488,4 @@
  - (stevesk) entropy.c: typo in debug message
  - (djm) ssh-keygen -i needs seeded RNG; report from markus@
 
-$Id: ChangeLog,v 1.2076 2002/04/23 13:09:19 djm Exp $
+$Id: ChangeLog,v 1.2077 2002/04/23 13:22:25 djm Exp $
diff --git a/configure.ac b/configure.ac
index f4ec16a..6bf5581 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.50 2002/04/23 13:09:19 djm Exp $
+# $Id: configure.ac,v 1.51 2002/04/23 13:22:25 djm Exp $
 
 AC_INIT
 AC_CONFIG_SRCDIR([ssh.c])
@@ -57,7 +57,18 @@
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS -L/usr/local/lib"
 	if (test "$LD" != "gcc" && test -z "$blibpath"); then
-		blibpath="/usr/lib:/lib:/usr/local/lib"
+		AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
+		saved_LDFLAGS="$LDFLAGS"
+		LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
+		AC_TRY_LINK([],
+			[],
+			[
+				AC_MSG_RESULT(yes)
+				blibpath="/usr/lib:/lib:/usr/local/lib"
+			],
+			[ AC_MSG_RESULT(no) ]
+		)
+		LDFLAGS="$saved_LDFLAGS"
 	fi
 	AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
 	AC_DEFINE(BROKEN_GETADDRINFO)
@@ -1071,6 +1082,11 @@
 AC_CHECK_SIZEOF(long int, 4)
 AC_CHECK_SIZEOF(long long int, 8)
 
+# Sanity check long long for some platforms (AIX)
+if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
+	ac_cv_sizeof_long_long_int=0
+fi
+
 # More checks for data types
 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
 	AC_TRY_COMPILE(