unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] configure check for crypt()
@ 2004-02-15 19:48 Andreas Voegele
  2004-02-19 10:27 ` Andreas Voegele
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Voegele @ 2004-02-15 19:48 UTC (permalink / raw)


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, 


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-02-21 21:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-15 19:48 [PATCH] configure check for crypt() Andreas Voegele
2004-02-19 10:27 ` Andreas Voegele
2004-02-20 23:17   ` Kevin Ryde
2004-02-21  0:52     ` Rob Browning
2004-02-21  7:30     ` Andreas Voegele
2004-02-21 21:00       ` Kevin Ryde
2004-02-21 21:41       ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).