unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Claes Wallin <clawa570+gmane@student.liu.se>
Subject: Re: CVS-060720 compilation failure on Solaris 10, patch
Date: Thu, 20 Jul 2006 14:29:14 +0200	[thread overview]
Message-ID: <44BF771A.7080302@student.liu.se> (raw)
In-Reply-To: <44BF7203.6060500@student.liu.se>


[-- Attachment #1.1.1: Type: text/plain, Size: 109 bytes --]

Claes Wallin wrote:
> Updated patch coming up. Thanks again for your guidance.

And here it is.

   /c

[-- Attachment #1.1.2: guile-core-sol10.ChangeLog --]
[-- Type: text/plain, Size: 1996 bytes --]

2006-07-20  Claes Wallin  <clacke+guile@lysator.liu.se>

        Make guile compile om Solaris 10.

        * configure.in:
          Demand C99 for math functions.
          Check for pthread_getattr_np, which only (?) exists on
          glibc platforms.

        * libguile/threads.c:
          include <string.h> (FD_ZERO on Solaris needs this)
          (get_thread_stack_base): Don't try to compile this function
          if pthread_getattr_np doesn't exist.

        * libguile/eval.c:
        * libguile/filesys.c:
          Updated alloca section to latest autoconf standards.

        * libguile/posix.c:
          Declare sethostname on __sun__.

        * libguile/pthreads-threads.h:
          Add missing brackets around PTHREAD_ONCE_INIT on __sun__.

        Some platforms (like Solaris 10) lack the pthread functions to
        get at stack attributes based on thread id. These platforms
        can't support scm_init_guile. Changing tests to using
        scm_boot_guile() to enable testing on these platforms.

        * test-suite/standalone/test-conversion.c:
        * test-suite/standalone/test-gh.c:
        * test-suite/standalone/test-list.c:
        * test-suite/standalone/test-num2integral.c:
        * test-suite/standalone/test-round.c:
          (main): Changed usage of scm_init_guile to scm_boot_guile.

        * test-suite/standalone/test-conversion.c:
        * test-suite/standalone/test-num2integral.c:
          (main): Moved tests to tests() for use with scm_boot_guile().
          (tests): New function

        * test-suite/standalone/test-list.c:
          Make test_scm_list() conform to scm_boot_guile() main_func
          parameter. scm_boot_guile() should really be taking
          void (*main_func)(void *closure, int argc, char **argv),
          but save that for another patch. 

        * test-suite/standalone/test-require-extension:
          "!" not understood by /bin/sh on Solaris 10

[-- Attachment #1.1.3: guile-core-sol10.diff --]
[-- Type: text/plain, Size: 8477 bytes --]

diff -ur ../guile-core/configure.in ./configure.in
--- ../guile-core/configure.in	2006-06-18 01:15:59.000000000 +0200
+++ ./configure.in	2006-07-20 06:16:34.000000000 +0200
@@ -59,6 +59,7 @@
 
 AC_PROG_INSTALL
 AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_CPP
 AC_PROG_AWK
 
@@ -66,8 +67,6 @@
 AC_ISC_POSIX
 AC_MINIX
 
-AM_PROG_CC_STDC
-
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 AC_CHECK_LIB([ltdl], [lt_dlinit], ,
@@ -1006,7 +1006,7 @@
 
     old_CFLAGS="$CFLAGS"
     CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
-    AC_CHECK_FUNCS(pthread_attr_getstack)
+    AC_CHECK_FUNCS([[pthread_attr_getstack pthread_getattr_np]])
     CFLAGS="$old_CFLAGS"
 
     # On Solaris, sched_yield lives in -lrt.
diff -ur ../guile-core/libguile/eval.c ./libguile/eval.c
--- ../guile-core/libguile/eval.c	2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/eval.c	2006-07-20 12:49:17.000000000 +0200
@@ -40,19 +40,24 @@
 /* AIX requires this to be the first thing in the file.  The #pragma
    directive is indented so pre-ANSI compilers will ignore it, rather
    than choke on it.  */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
-#   pragma alloca
-#  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#   endif
-#  endif
+
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef  __cplusplus
+extern "C"
 # endif
+void *alloca (size_t);
 #endif
+
 #if HAVE_MALLOC_H
 #include <malloc.h> /* alloca on mingw */
 #endif
diff -ur ../guile-core/libguile/filesys.c ./libguile/filesys.c
--- ../guile-core/libguile/filesys.c	2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/filesys.c	2006-07-20 12:50:00.000000000 +0200
@@ -32,19 +32,24 @@
 /* AIX requires this to be the first thing in the file.  The #pragma
    directive is indented so pre-ANSI compilers will ignore it, rather
    than choke on it.  */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
-#   pragma alloca
-#  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#   endif
-#  endif
+
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef  __cplusplus
+extern "C"
 # endif
+void *alloca (size_t);
 #endif
+
 #if HAVE_MALLOC_H
 #include <malloc.h> /* alloca on mingw, though its not used on that system */
 #endif
diff -ur ../guile-core/libguile/posix.c ./libguile/posix.c
--- ../guile-core/libguile/posix.c	2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/posix.c	2006-07-20 05:23:30.000000000 +0200
@@ -65,6 +65,10 @@
 #endif
 #endif
 
+#ifdef __sun__
+int sethostname(char *name, int namelen);
+#endif
+
 #ifdef LIBC_H_WITH_UNISTD_H
 #include <libc.h>
 #endif
diff -ur ../guile-core/libguile/pthread-threads.h ./libguile/pthread-threads.h
--- ../guile-core/libguile/pthread-threads.h	2006-04-17 02:05:40.000000000 +0200
+++ ./libguile/pthread-threads.h	2006-07-20 05:20:11.000000000 +0200
@@ -66,9 +66,15 @@
 /* Onces
  */
 #define scm_i_pthread_once_t                pthread_once_t
-#define SCM_I_PTHREAD_ONCE_INIT             PTHREAD_ONCE_INIT
 #define scm_i_pthread_once                  pthread_once
 
+#ifdef __sun__
+/* workaround for broken Solaris 10 headers */
+#define SCM_I_PTHREAD_ONCE_INIT             { PTHREAD_ONCE_INIT }
+#else /* !__sun__ */
+#define SCM_I_PTHREAD_ONCE_INIT             PTHREAD_ONCE_INIT
+#endif /* !__sun__ */
+
 /* Thread specific storage
  */
 #define scm_i_pthread_key_t                 pthread_key_t
diff -ur ../guile-core/libguile/threads.c ./libguile/threads.c
--- ../guile-core/libguile/threads.c	2006-04-17 02:05:42.000000000 +0200
+++ ./libguile/threads.c	2006-07-20 14:15:59.000000000 +0200
@@ -30,6 +30,9 @@
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#if HAVE_STRING_H && defined(__sun__)	/* On Solaris 10, FD_ZERO uses memset */
+#include <string.h>
+#endif
 
 #include "libguile/validate.h"
 #include "libguile/root.h"
@@ -567,6 +570,7 @@
 
 #if SCM_USE_PTHREAD_THREADS
 #ifdef HAVE_PTHREAD_ATTR_GETSTACK
+#ifdef HAVE_PTHREAD_GETATTR_NP
 
 #define HAVE_GET_THREAD_STACK_BASE
 
@@ -600,6 +604,7 @@
     }
 }
 
+#endif /* HAVE_PTHREAD_GETATTR_NP */
 #endif /* HAVE_PTHREAD_ATTR_GETSTACK */
 
 #else /* !SCM_USE_PTHREAD_THREADS */
diff -ur ../guile-core/test-suite/standalone/test-conversion.c ./test-suite/standalone/test-conversion.c
--- ../guile-core/test-suite/standalone/test-conversion.c	2006-04-17 01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-conversion.c	2006-07-20 13:50:21.000000000 +0200
@@ -1010,10 +1010,9 @@
   test_11 ("(string #\\f #\\nul)", NULL, 1, 0);
 }
 
-int
-main (int argc, char *argv[])
+static void
+tests ()
 {
-  scm_init_guile();
   test_is_signed_integer ();
   test_is_unsigned_integer ();
   test_to_signed_integer ();
@@ -1024,5 +1023,11 @@
   test_from_double ();
   test_to_double ();
   test_locale_strings ();
+}
+
+int
+main (int argc, char *argv[])
+{
+  scm_boot_guile(argc, argv, tests, NULL);
   return 0;
 }
diff -ur ../guile-core/test-suite/standalone/test-gh.c ./test-suite/standalone/test-gh.c
--- ../guile-core/test-suite/standalone/test-gh.c	2006-04-17 01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-gh.c	2006-07-20 04:34:28.000000000 +0200
@@ -70,8 +70,7 @@
 int 
 main (int argc, char *argv[])
 {
-  scm_init_guile ();
-  test_gh_set_substr ();
+  scm_boot_guile(argc, argv, test_gh_set_substr, NULL);
   return 0;
 }
 
diff -ur ../guile-core/test-suite/standalone/test-list.c ./test-suite/standalone/test-list.c
--- ../guile-core/test-suite/standalone/test-list.c	2006-02-04 00:34:48.000000000 +0100
+++ ./test-suite/standalone/test-list.c	2006-07-20 04:42:12.000000000 +0200
@@ -26,7 +26,7 @@
 /* pretty trivial, but ensure this entrypoint exists, since it was
    documented in Guile 1.6 and earlier */
 static void
-test_scm_list (void)
+test_scm_list ()
 {
   {
     if (! scm_is_eq (SCM_EOL, scm_list (SCM_EOL)))
@@ -49,7 +49,6 @@
 int
 main (int argc, char **argv)
 {
-  scm_init_guile();
-  test_scm_list ();
+  scm_boot_guile(argc, argv, test_scm_list, NULL);
   return 0;
 }
diff -ur ../guile-core/test-suite/standalone/test-num2integral.c ./test-suite/standalone/test-num2integral.c
--- ../guile-core/test-suite/standalone/test-num2integral.c	2006-04-17 01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-num2integral.c	2006-07-20 13:36:51.000000000 +0200
@@ -141,12 +141,17 @@
 #endif /* SCM_SIZEOF_LONG_LONG != 0 */
 }
 
-int
-main (int argc, char *argv[])
+static void
+tests ()
 {
-  scm_init_guile();
   test_long_long ();
   test_ulong_long ();
+}
+
+int
+main (int argc, char *argv[])
+{
+  scm_boot_guile(argc, argv, tests, NULL);
   return 0;
 }
 
diff -ur ../guile-core/test-suite/standalone/test-require-extension ./test-suite/standalone/test-require-extension
--- ../guile-core/test-suite/standalone/test-require-extension	2005-02-12 07:15:07.000000000 +0100
+++ ./test-suite/standalone/test-require-extension	2006-07-20 04:52:27.000000000 +0200
@@ -2,9 +2,9 @@
 
 set -e
 
-! guile -c '(require-extension 7)' 2> /dev/null
-! guile -c '(require-extension (blarg))' 2> /dev/null
-! guile -c '(require-extension (srfi "foo"))' 2> /dev/null
+guile -c '(require-extension 7)'  2> /dev/null && exit 2
+guile -c '(require-extension (blarg))' 2> /dev/null && exit 2
+guile -c '(require-extension (srfi "foo"))' 2> /dev/null && exit 2
 
 guile -c '(require-extension (srfi 1)) (exit (procedure? take-right))'
 guile -c '(require-extension (srfi))'
diff -ur ../guile-core/test-suite/standalone/test-round.c ./test-suite/standalone/test-round.c
--- ../guile-core/test-suite/standalone/test-round.c	2006-04-17 01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-round.c	2006-07-20 04:39:56.000000000 +0200
@@ -116,7 +116,6 @@
 int
 main (int argc, char *argv[])
 {
-  scm_init_guile();
-  test_scm_c_round ();
+  scm_boot_guile(argc, argv, test_scm_c_round, NULL);
   return 0;
 }

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

[-- Attachment #2: Type: text/plain, Size: 137 bytes --]

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile

  reply	other threads:[~2006-07-20 12:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20  3:48 CVS-060720 compilation failure on Solaris 10, patch Claes Wallin
2006-07-20  7:52 ` Ludovic Courtès
2006-07-20 12:07   ` Claes Wallin
2006-07-20 12:29     ` Claes Wallin [this message]
2006-07-21  0:02       ` Kevin Ryde
2006-07-21  6:32         ` Claes Wallin
2006-07-24  0:46           ` Kevin Ryde
2006-07-24  9:35             ` Claes Wallin
2006-07-24  9:53             ` Claes Wallin
2006-07-21  0:04       ` Kevin Ryde
2006-07-21  6:30         ` Claes Wallin
2006-07-24  1:45           ` Kevin Ryde
2006-07-24  9:53             ` Claes Wallin
2006-07-25  0:46               ` Kevin Ryde
2006-07-21  0:08       ` Kevin Ryde
2006-07-25  0:42       ` Kevin Ryde
2006-07-25  7:33         ` Ludovic Courtès
2006-07-21  0:31   ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44BF771A.7080302@student.liu.se \
    --to=clawa570+gmane@student.liu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).