From dce50cd6c9d53b18449b0aa44400c0ca03d7645b Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sat, 21 Feb 2004 21:17:40 +0000 Subject: [PATCH] (crypt): Test with AC_SEARCH_LIBS, for the benefit of HP-UX. Define HAVE_CRYPT rather than HAVE_LIBCRYPT. Reported by Andreas Voegele. --- configure.in | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 8150bff71..799ebb0ee 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl configuration script for Guile dnl Process this file with autoconf to produce configure. dnl -dnl Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +dnl Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. dnl dnl This file is part of GUILE dnl @@ -270,7 +270,23 @@ AC_CHECK_FUNCS(ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mkno 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) + +# crypt() may or may not be available, for instance in some countries there +# are restrictions on cryptography. +# +# crypt() might be in libc (eg. OpenBSD), or it might be in a separate +# -lcrypt library (eg. Debian GNU/Linux). +# +# On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a. We must +# be careful to avoid -lcrypt in this case, since libtool will see there's +# only a static libcrypt and decide to build only a static libguile. +# +# AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the +# libraries already in that list. +# +AC_SEARCH_LIBS(crypt, crypt, + [AC_DEFINE(HAVE_CRYPT,1, + [Define to 1 if you have the `crypt' function.])]) ### Some systems don't declare some functions. On such systems, we ### need to at least provide our own K&R-style declarations.