From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Voegele Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] configure check for crypt() Date: Sun, 15 Feb 2004 20:48:50 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87eksw6s4d.fsf@ID-28718.user.uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076874595 25965 80.91.224.253 (15 Feb 2004 19:49:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2004 19:49:55 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 15 20:49:50 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsSH0-0003aL-00 for ; Sun, 15 Feb 2004 20:49:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsSGn-0008S6-Lg for guile-devel@m.gmane.org; Sun, 15 Feb 2004 14:49:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AsSGd-0008Rs-NW for guile-devel@gnu.org; Sun, 15 Feb 2004 14:49:27 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AsSG7-0008N7-N8 for guile-devel@gnu.org; Sun, 15 Feb 2004 14:49:26 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.24) id 1AsSG7-0008Lf-6j for guile-devel@gnu.org; Sun, 15 Feb 2004 14:48:55 -0500 Original-Received: (qmail 12862 invoked by uid 65534); 15 Feb 2004 19:48:51 -0000 Original-Received: from pD9E6125A.dip.t-dialin.net (EHLO hermes.voegele.dyndns.org) (217.230.18.90) by mail.gmx.net (mp008) with SMTP; 15 Feb 2004 20:48:51 +0100 X-Authenticated: #14729429 Original-Received: by hermes.voegele.dyndns.org (Postfix, from userid 1000) id 1766D2E1C0; Sun, 15 Feb 2004 20:48:50 +0100 (CET) Original-To: guile-devel@gnu.org X-Request-PGP: http://pgp.mit.edu:11371/pks/lookup?search=0x12C21DCA&op=index X-PGP-KeyID: 12C21DCA User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3379 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3379 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 #endif -#if HAVE_LIBCRYPT && HAVE_CRYPT_H +#if HAVE_CRYPT && HAVE_CRYPT_H # include #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