4e2098e
diff --git a/config.h.in b/config.h.in
2ac37f7
index e1364dd921..1dc65cfb21 100644
4e2098e
--- a/config.h.in
4e2098e
+++ b/config.h.in
2ac37f7
@@ -588,7 +588,7 @@ int sigwait(const unsigned int *set, int *sig);
4fa9972
 #undef PREFER_GOSTASN1
a013398
 
a013398
 /* The size of `void *', as computed by sizeof. */
a013398
-#undef SIZEOF_VOID_P
a013398
+/* #undef SIZEOF_VOID_P */
a013398
 
a013398
 /* Define to 1 if you have the ANSI C header files. */
a013398
 #undef STDC_HEADERS
4e2098e
diff --git a/configure.in b/configure.in
2ac37f7
index 73b1c8ccbb..129fc3f311 100644
4e2098e
--- a/configure.in
4e2098e
+++ b/configure.in
2ac37f7
@@ -3523,14 +3523,14 @@ AC_TRY_COMPILE([
2ac37f7
 #include <sys/socket.h>
2ac37f7
 #include <netdb.h>
2ac37f7
 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2ac37f7
-		socklen_t, char *, socklen_t, unsigned int);],
2ac37f7
+		socklen_t, char *, socklen_t, int);],
a013398
 [ return (0);],
2ac37f7
-	[AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
2ac37f7
+	[AC_MSG_RESULT(socklen_t for buflen; int for flags)
2ac37f7
 	 AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t,
2ac37f7
 		   [Define to the sockaddr length type used by getnameinfo(3).])
2ac37f7
 	 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
2ac37f7
 		   [Define to the buffer length type used by getnameinfo(3).])
2ac37f7
-	 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
2ac37f7
+	 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int,
2ac37f7
 		   [Define to the flags type used by getnameinfo(3).])],
2ac37f7
 [AC_TRY_COMPILE([
2ac37f7
 #include <sys/types.h>
2ac37f7
@@ -3557,7 +3557,7 @@ int getnameinfo(const struct sockaddr *, size_t, char *,
a013398
 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
4e2098e
 AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
2ac37f7
 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
2ac37f7
-AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])])
2ac37f7
+AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int)])])])
2ac37f7
 
2ac37f7
 #
2ac37f7
 # ...and same for gai_strerror().
4e2098e
diff --git a/isc-config.sh.in b/isc-config.sh.in
2ac37f7
index a8a0a89e88..b5e94ed13e 100644
4e2098e
--- a/isc-config.sh.in
4e2098e
+++ b/isc-config.sh.in
2ac37f7
@@ -13,7 +13,18 @@ prefix=@prefix@
a013398
 exec_prefix=@exec_prefix@
a013398
 exec_prefix_set=
a013398
 includedir=@includedir@
60039a5
-libdir=@libdir@
a013398
+arch=$(uname -m)
a013398
+
a013398
+case $arch in
a013398
+	x86_64 | amd64 | sparc64 | s390x | ppc64)
a013398
+		libdir=/usr/lib64
a013398
+		sec_libdir=/usr/lib
a013398
+		;;
a013398
+	* )
a013398
+		libdir=/usr/lib
a013398
+		sec_libdir=/usr/lib64
a013398
+		;;
a013398
+esac
a013398
 
a013398
 usage()
a013398
 {
2ac37f7
@@ -132,6 +143,16 @@ if test x"$echo_libs" = x"true"; then
60039a5
 	if test x"${exec_prefix_set}" = x"true"; then
a3771ce
 		libs="-L${exec_prefix}/lib"
60039a5
 	else
60039a5
+		if [ ! -x $libdir/libisc.so ] ; then
60039a5
+			if [ ! -x $sec_libdir/libisc.so ] ; then
60039a5
+				echo "Error: ISC libs not found in $libdir"
60039a5
+				if [ -d $sec_libdir ] ; then
60039a5
+					echo "Error: ISC libs not found in $sec_libdir"
60039a5
+				fi
60039a5
+				exit 1
a013398
+			fi
60039a5
+			libdir=$sec_libdir
a013398
+		fi
60039a5
 		libs="-L${libdir}"
60039a5
 	fi
a3771ce
 	if test x"$libirs" = x"true" ; then