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

* Re: [PATCH] configure check for crypt()
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Voegele @ 2004-02-19 10:27 UTC (permalink / raw)


Andreas Voegele writes:

> 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.

It seems that my patch is also useful for OpenBSD.  At least, I found
the following statement on the web: "With version 2.1 of OpenBSD, the
crypt library doesn't even exist; it is included in the standard
library for the system."

Can anyone apply the patch, which is attached to my previous mail, to
guile-core/configure.in and guile-core/libguile/posix.c?

Here are changelog entries for guile-core/configure.in and
guile-core/libguile/configure.in respectively:

2004-02-19  Andreas Voegele  <voegelas@gmx.net>

	* configure.in: Use AC_SEARCH_LIBS to search for crypt().  Define
	HAVE_CRYPT instead of HAVE_LIBCRYPT.

2004-02-19  Andreas Voegele  <voegelas@gmx.net>

	* posix.c (s_scm_crypt): Use HAVE_CRYPT instead of HAVE_LIBCRYPT.


_______________________________________________
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

* Re: [PATCH] configure check for crypt()
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Kevin Ryde @ 2004-02-20 23:17 UTC (permalink / raw)
  Cc: guile-devel

Andreas Voegele <voegelas@gmx.net> writes:
>
> Can anyone apply the patch, which is attached to my previous mail, to
> guile-core/configure.in and guile-core/libguile/posix.c?

Thanks, I made changes along those lines.

Is this for the guile 1.6 branch too?  I'd expect so, if guile 1.6
works at all on hpux (which I haven't tried).


_______________________________________________
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

* Re: [PATCH] configure check for crypt()
  2004-02-20 23:17   ` Kevin Ryde
@ 2004-02-21  0:52     ` Rob Browning
  2004-02-21  7:30     ` Andreas Voegele
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Browning @ 2004-02-21  0:52 UTC (permalink / raw)
  Cc: guile-devel

Kevin Ryde <user42@zip.com.au> writes:

> Andreas Voegele <voegelas@gmx.net> writes:
>>
>> Can anyone apply the patch, which is attached to my previous mail, to
>> guile-core/configure.in and guile-core/libguile/posix.c?
>
> Thanks, I made changes along those lines.
>
> Is this for the guile 1.6 branch too?  I'd expect so, if guile 1.6
> works at all on hpux (which I haven't tried).

Looks good to me.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
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

* Re: [PATCH] configure check for crypt()
  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
  1 sibling, 2 replies; 7+ messages in thread
From: Andreas Voegele @ 2004-02-21  7:30 UTC (permalink / raw)


Kevin Ryde writes:

> Andreas Voegele <voegelas@gmx.net> writes:
>>
>> Can anyone apply the patch, which is attached to my previous mail, to
>> guile-core/configure.in and guile-core/libguile/posix.c?
>
> Thanks, I made changes along those lines.
>
> Is this for the guile 1.6 branch too?  I'd expect so, if guile 1.6
> works at all on hpux (which I haven't tried).

I've built Guile 1.6.4 with the mentioned changes under HP-UX 11.00,
32-Bit.  I have yet to build the CVS version.

I've noticed that HP-UX unsets the environment variable HOME when I
change to the root account.  Thus the following expression in
readline.scm fails when the readline module is loaded by root.

(define history-file (string-append (getenv "HOME") "/.guile_history"))

guile> (use-modules (ice-9 readline))
ERROR: In procedure string-append:
ERROR: Wrong type argument (expecting STRINGP): #f
ABORT: (wrong-type-arg)

The following expression could be used to get the home directory, but
it requires the procedures getpwuid und cuserid which might not be
available on all systems supported by Guile.  I'd probably rather tell
the super user to set HOME or GUILE_HISTORY before using readline :-)

(or (getenv "HOME") (passwd:dir (getpwuid (cuserid))))

Here's the output of make test:

Running alist.test
Running bit-operations.test
Running c-api.test
Running chars.test
Running common-list.test
Running environments.test
UNRESOLVED: environments.test: leaf-environments: observe-weak: weak observer gets collected
UNRESOLVED: environments.test: leaf-environment based eval-environments: observe-weak: weak observer gets collected
Running eval.test
Running exceptions.test
Running format.test
Running gc.test
Running getopt-long.test
Running goops.test
Running guardians.test
Running hooks.test
Running import.test
Running interp.test
Running list.test
Running load.test
Running numbers.test
Running optargs.test
Running ports.test
Running r4rs.test
Running reader.test
Running regexp.test
Running srfi-10.test
Running srfi-13.test
Running srfi-14.test
Running srfi-19.test
FAIL: srfi-19.test: SRFI date/time library: #<procedure time-utc->date (time . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure time-tai->date (time . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure time-monotonic->date (time . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure julian-day->date (jdn . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure modified-julian-day->date (jdn . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: string->date respects local DST if no time zone is read
Running srfi-4.test
Running srfi-9.test
Running strings.test
Running symbols.test
Running syncase.test
Running syntax.test
Running time.test
Running version.test
Running weaks.test

Totals for this test run:
passes:                 2225
failures:               6
unexpected passes:      0
expected failures:      18
unresolved test cases:  2
untested test cases:    0
unsupported test cases: 9
errors:                 0

FAIL: check-guile
===================
1 of 1 tests failed
===================


_______________________________________________
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

* Re: [PATCH] configure check for crypt()
  2004-02-21  7:30     ` Andreas Voegele
@ 2004-02-21 21:00       ` Kevin Ryde
  2004-02-21 21:41       ` Kevin Ryde
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Ryde @ 2004-02-21 21:00 UTC (permalink / raw)
  Cc: guile-devel

Andreas Voegele <voegelas@gmx.net> writes:
>
> The following expression could be used to get the home directory, but
> it requires the procedures getpwuid und cuserid which might not be
> available on all systems supported by Guile.

load-user-init in boot-9.scm has it with false-if-exception.

> I'd probably rather tell
> the super user to set HOME or GUILE_HISTORY before using readline :-)

It shouldn't bomb.

I see slib.scm home-vicinity could probably be helped with passwd too.

> FAIL: srfi-19.test: SRFI date/time library: #<procedure time-utc->date (time . tz-offset)> respects local DST if no TZ-OFFSET given

You might have to trace through that to see where it goes wrong.

The test looks like it relies on the system understanding TZ=CET.  Or
maybe LOCALTIME_CACHE should be set, if the configure test didn't
recognise that.  Or something.


_______________________________________________
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

* Re: [PATCH] configure check for crypt()
  2004-02-21  7:30     ` Andreas Voegele
  2004-02-21 21:00       ` Kevin Ryde
@ 2004-02-21 21:41       ` Kevin Ryde
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Ryde @ 2004-02-21 21:41 UTC (permalink / raw)
  Cc: guile-devel

Andreas Voegele <voegelas@gmx.net> writes:
>
> (passwd:dir (getpwuid (cuserid)))

Incidentally, I see the glibc manual and the gnu/linux man page advise
against cuserid, suggesting either LOGNAME or geteuid.  Looks like
glib g_get_home_dir uses the latter.  Maybe a little define (just for
internal use) for guile to collect up this nonsense in one place.


_______________________________________________
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).