[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] configure check for crypt()
From: |
Andreas Voegele |
Subject: |
[PATCH] configure check for crypt() |
Date: |
Sun, 15 Feb 2004 20:48:50 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) |
Guile's configure script checks for the crypt library with
AC_CHECK_LIB(crypt, crypt). On HP-UX 11, crypt() is included in the C
library. libcrypt.a is an empty dummy library provided for
compatibility with old software. The check for crypt() succeeds since
the test program is linked against the empty crypt library as well as
the C library. As a consequence -lcrypt is added to the list of
required libraries. The problem is that libtool does not create a
shared libguile since there is only a static crypt library.
I think that configure should first check whether the C library
provides crypt() before it checks for the crypt library.
Here's a patch that replaces AC_CHECK_LIB with AC_SEARCH_LIBS and
HAVE_LIBCRYPT with HAVE_CRYPT. I've tested this patch under HP-UX and
GNU/Linux.
Index: configure.in
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/configure.in,v
retrieving revision 1.230
diff -u -u -r1.230 configure.in
--- configure.in 25 Jan 2004 13:02:21 -0000 1.230
+++ configure.in 15 Feb 2004 19:40:03 -0000
@@ -588,7 +588,7 @@
AC_CHECK_HEADERS(crypt.h sys/resource.h sys/file.h)
AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass
sethostname gethostname)
-AC_CHECK_LIB(crypt, crypt)
+AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [Define if you have the
crypt function.]))
dnl GMP tests
AC_CHECK_LIB([gmp], [__gmpz_init], ,
Index: libguile/posix.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v
retrieving revision 1.120
diff -u -u -r1.120 posix.c
--- libguile/posix.c 15 Sep 2003 12:36:57 -0000 1.120
+++ libguile/posix.c 15 Feb 2004 19:40:04 -0000
@@ -110,7 +110,7 @@
#include <locale.h>
#endif
-#if HAVE_LIBCRYPT && HAVE_CRYPT_H
+#if HAVE_CRYPT && HAVE_CRYPT_H
# include <crypt.h>
#endif
@@ -1400,7 +1400,7 @@
#undef FUNC_NAME
#endif /* HAVE_SYNC */
-#if HAVE_LIBCRYPT && HAVE_CRYPT_H
+#if HAVE_CRYPT && HAVE_CRYPT_H
SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0,
(SCM key, SCM salt),
"Encrypt @var{key} using @var{salt} as the salt value to the\n"
@@ -1416,7 +1416,7 @@
return scm_makfrom0str (p);
}
#undef FUNC_NAME
-#endif /* HAVE_LIBCRYPT && HAVE_CRYPT_H */
+#endif /* HAVE_CRYPT && HAVE_CRYPT_H */
#if HAVE_CHROOT
SCM_DEFINE (scm_chroot, "chroot", 1, 0, 0,
- [PATCH] configure check for crypt(),
Andreas Voegele <=