--- configure.ac	16 Jun 2009 17:10:36 -0000	1.1.1.2
+++ configure.ac	18 Jun 2009 15:53:26 -0000	1.2
@@ -295,20 +295,26 @@
 dnl Checks for libraries.
 AC_CHECK_LIB([gcrypt], [gcry_md_open], [have_gcrypt=yes], [have_gcrypt=no])
 if test "x${have_gcrypt}" = "xno"; then
-   AC_MSG_ERROR([libgcrypt required to build libfreeipmi])
+   AC_MSG_WARN([libgcrypt not found, libfreeipmi built without it])
    AC_MSG_NOTICE([Note: libgpg-error required for libgcrypt])
+   GCRYPT_LIBS=
+else
+   GCRYPT_LIBS=-lgcrypt
 fi
-AC_CHECK_HEADER([gcrypt.h], [have_gcrypte_header=yes], [have_gcrypt_header=no])
+AC_CHECK_HEADER([gcrypt.h], [have_gcrypt_header=yes], [have_gcrypt_header=no])
 if test "x${have_gcrypt_header}" = "xno"; then
-   AC_MSG_ERROR([gcrypt.h not found])
+   AC_MSG_WARN([gcrypt.h not found])
+   GCRYPT_LIBS=
 fi
 AC_CHECK_DECL([GCRYCTL_SET_THREAD_CBS], 
               [have_gcrypt_threads=yes],
               [have_gcrypt_threads=no],
               [#include <gcrypt.h>])
 if test "x${have_gcrypt_threads}" = "xno"; then
-   AC_MSG_ERROR([libgcrypt with threads support required for libfreeipmi])
+   AC_MSG_WARN([libgcrypt with threads not found, libfreeipmi build without it])
+   GCRYPT_LIBS=
 fi
+AC_SUBST(GCRYPT_LIBS)
 
 dnl FreeBSD < 5 has getopt_long in a separate gnugetopt library
 AC_CHECK_FUNC([getopt_long], [have_getopt_long=yes],
@@ -362,6 +368,7 @@
 AC_CHECK_FUNCS([flockfile fputs_unlocked fwrite_unlocked])
 AC_CHECK_FUNCS([iopl])
 AC_CHECK_FUNCS([asprintf])
+AC_CHECK_FUNCS([cbrt])
 
 # At least on freebsd, putc_unlocked is a macro, so the standard
 # AC_CHECK_FUNCS doesn't work well.
--- libfreeipmi/src/libcommon/Makefile.am	17 Sep 2008 22:56:04 -0000	1.1.1.1
+++ libfreeipmi/src/libcommon/Makefile.am	18 Jun 2009 15:53:32 -0000	1.2
@@ -8,7 +8,7 @@
 
 noinst_LTLIBRARIES = libcommon.la
 
-libcommon_la_LDFLAGS = -lgcrypt
+libcommon_la_LDFLAGS = @GCRYPT_LIBS@
 
 libcommon_la_CPPFLAGS = \
 	-I$(top_srcdir)/common/src/portability \
--- common/src/portability/freeipmi-portability.h	4 Jul 2008 02:07:35 -0000	1.1.1.1
+++ common/src/portability/freeipmi-portability.h	18 Jun 2009 15:52:05 -0000	1.2
@@ -89,6 +89,10 @@
 #ifndef HAVE_EXP2
 #define exp2(x)		(pow(2.0, (x)))
 #endif
+/* uClibc may not have cbrt() */
+#ifndef HAVE_CBRT
+#define cbrt(x)		(pow((x), -3.0))
+#endif
 
 /* FreeBSD don't have strdupa */
 #ifndef strdupa
--- common/src/toolcommon/tool-cmdline-common.c	8 Apr 2009 21:12:36 -0000	1.1.1.1
+++ common/src/toolcommon/tool-cmdline-common.c	18 Jun 2009 15:50:26 -0000	1.2
@@ -670,7 +670,7 @@
 
   if (cmd_args->driver_device)
     {
-      if (access (cmd_args->driver_device, R_OK|W_OK|X_OK) != 0)
+      if (access (cmd_args->driver_device, R_OK|W_OK) != 0)
         {
           fprintf (stderr, "insufficient permission on driver device '%s'\n",
                    cmd_args->driver_device);
Index: libfreeipmi/src/libcommon/ipmi-crypt.c
===================================================================
RCS file: /home/conf/tnp/gcm/software/external/freeipmi/freeipmi/libfreeipmi/src/libcommon/ipmi-crypt.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- libfreeipmi/src/libcommon/ipmi-crypt.c	28 Mar 2008 00:15:02 -0000	1.1.1.1
+++ libfreeipmi/src/libcommon/ipmi-crypt.c	18 Jun 2009 15:53:32 -0000	1.2
@@ -29,8 +29,6 @@
 #if HAVE_PTHREAD_H
 #include <pthread.h>
 #endif /* HAVE_PTHREAD_H */
-#include <gcrypt.h>
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
 
 #include "ipmi-crypt.h"
 
@@ -38,6 +36,11 @@
 
 #include "freeipmi-portability.h"
 
+#ifdef HAVE_GCRYPT_H
+
+#include <gcrypt.h>
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+
 static int ipmi_crypt_initialized = 0;
 
 int8_t
@@ -296,3 +299,85 @@
 {
   return _ipmi_crypt_cipher_info(cipher_algorithm, IPMI_CRYPT_CIPHER_INFO_BLOCK_LENGTH);
 }
+
+#else
+
+
+int8_t
+ipmi_crypt_init(void)
+{
+  return (0);
+}
+
+int32_t
+ipmi_crypt_hash(int hash_algorithm,
+                int hash_flags,
+                uint8_t *key,
+                uint32_t key_len,
+                uint8_t *hash_data,
+                uint32_t hash_data_len,
+                uint8_t *digest,
+                uint32_t digest_len)
+{
+  ERR (1);
+
+  return -1;
+}
+
+int32_t
+ipmi_crypt_hash_digest_len(int hash_algorithm)
+{
+  ERR (1);
+
+  return -1;
+}
+
+int32_t
+ipmi_crypt_cipher_encrypt(int cipher_algorithm,
+                          int cipher_mode,
+                          uint8_t *key,
+                          uint32_t key_len,
+                          uint8_t *iv,
+                          uint32_t iv_len,
+                          uint8_t *data,
+                          uint32_t data_len)
+{
+  ERR (1);
+
+  return -1;
+}
+
+int32_t
+ipmi_crypt_cipher_decrypt(int cipher_algorithm,
+                          int cipher_mode,
+                          uint8_t *key,
+                          uint32_t key_len,
+                          uint8_t *iv,
+                          uint32_t iv_len,
+                          uint8_t *data,
+                          uint32_t data_len)
+{
+  ERR (1);
+
+  return -1;
+}
+
+int32_t
+ipmi_crypt_cipher_key_len(int cipher_algorithm)
+{
+  ERR (1);
+
+  return -1;
+}
+
+int32_t 
+ipmi_crypt_cipher_block_len(int cipher_algorithm)
+{
+  ERR (1);
+
+  return -1;
+}
+
+
+#endif
+
--- libfreeipmi/src/util/ipmi-util.c	21 Jun 2008 14:34:18 -0000	1.1.1.1
+++ libfreeipmi/src/util/ipmi-util.c	18 Jun 2009 15:53:33 -0000	1.2
@@ -44,7 +44,9 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
+#if HAVE_GCRYPT_H
 #include <gcrypt.h>
+#endif
 
 #include "freeipmi/util/ipmi-util.h"
 #include "freeipmi/fiid/fiid.h"
@@ -147,7 +149,11 @@
 #endif /* !(HAVE_DEVURANDOM || HAVE_DEVRANDOM) */
 
  gcrypt_rand:
+#if HAVE_GCRYPT
   gcry_randomize((unsigned char *)buf, buflen, GCRY_STRONG_RANDOM);
+#else  /* !HAVE_GCRYPT */
+  return -1;
+#endif /* !HAVE_GCRYPT */
   return buflen;
 }
 
