]> git.donarmstrong.com Git - lilypond.git/commitdiff
* ttftool/util.c:
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 25 Feb 2005 23:33:03 +0000 (23:33 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 25 Feb 2005 23:33:03 +0000 (23:33 +0000)
* ttftool/ttfps.c:
* ttftool/ps.c: #include libc-extension.hh

* flower/include/libc-extension.hh:
* flower/libc-extension.cc (fopencookie)[!HAVE_FOPENCOOKIE]: Add
wrapper using funopen.
(fopencookie, handle_cookie_io_fclose, handle_cookie_io_fprintf,
handle_cookie_io_fprintf): Add wrappers catching Memory_out_stream.

* config.hh.in:
* configure.in (AC_CHECK_FUNCS): Add fopencookie, funopen.
(AC_CHECK_HEADERS): Add libio.h

13 files changed:
ChangeLog
config.hh.in
configure.in
cygwin/mknetrel
flower/include/libc-extension.hh
flower/include/memory-stream.hh
flower/libc-extension.cc
flower/memory-stream.cc
lily/pfb.cc
stepmake/aclocal.m4
ttftool/ps.c
ttftool/ttfps.c
ttftool/util.c

index e4e4436b7d8a42fdd3c1c8835a1d70493e40ad48..0da093db45e5697df89e8460d595b4aad9dbe81e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
-2005-02-25  Jan Nieuwenhuizen  <janneke@gnu.org>
+2005-02-26  Jan Nieuwenhuizen  <janneke@gnu.org>
 
-       * scripts/convert-ly.py: Uniformize, internalize.
+       * ttftool/util.c: 
+       * ttftool/ttfps.c: 
+       * ttftool/ps.c: #include libc-extension.hh
+
+       * flower/include/libc-extension.hh:
+       * flower/libc-extension.cc (fopencookie)[!HAVE_FOPENCOOKIE]: Add
+       wrapper using funopen.
+       (fopencookie, handle_cookie_io_fclose, handle_cookie_io_fprintf,
+       handle_cookie_io_fprintf): Add wrappers catching Memory_out_stream.
+
+       * config.hh.in:
+       * configure.in (AC_CHECK_FUNCS): Add fopencookie, funopen.
+       (AC_CHECK_HEADERS): Add libio.h
+
+       * scripts/convert-ly.py: Uniformize, internationalize.
        (2.5.2): Remove fatal encoding rule.
        (2.5.13): Handle latin1 encoding gracefully.
 
index cb6a64eafe331344ba8e4d6e1aa15315179c6458..e04b6d163e5cd57b6e0ea741cb8ce2eb395fe26c 100644 (file)
 /* default lilypond locale dir */
 #define LOCALEDIR "@LOCALEDIR@"
 
+/* define if you have fopencookie */
+#define HAVE_FOPENCOOKIE 0
+
+/* define if you have funopen */
+#define HAVE_FUNOPEN 0
+
+/* define if you have gettext */
+#define HAVE_GETTEXT 0
+
 /* define if you have memmem */
 #define HAVE_MEMMEM 0
 
@@ -30,9 +39,6 @@
 /* define if you have yyFlexLexer.yy_current_buffer */
 #undef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
 
-/* define if you have gettext */
-#define HAVE_GETTEXT 0
-
 /* define if you have isinf */
 #define HAVE_ISINF 0
 
 #define DIRSEP '@DIRSEP@'
 #define PATHSEP '@PATHSEP@'
 
-/* define if you have assert */
+/* define if you have assert.h */
 #define HAVE_ASSERT_H 0
 
+/* define if you have libio.h */
+#define HAVE_LIBIO_H 0
+
 /* define if you have sys/stat.h */
 #define HAVE_SYS_STAT_H 0
 
index ae9ad055fc7bdf40acf8ecbb73713f9dbecf826b..cf7f73662158c11f6074c8b82724638d7cc76454 100644 (file)
@@ -58,21 +58,17 @@ STEPMAKE_KPATHSEA
 STEPMAKE_MAKEINFO(REQUIRED)
 STEPMAKE_PYTHON_DEVEL(REQUIRED)
 
-# mftrace for generating pfa's, pfb's
 STEPMAKE_PROGS(MFTRACE, mftrace, REQUIRED, 1.1.1)
-
-# mftrace for generating pfa's, pfb's
 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20041208)
 
-
-AC_CHECK_HEADERS([assert.h sys/stat.h])
+AC_CHECK_HEADERS([assert.h libio.h sys/stat.h])
 AC_LANG_PUSH(C++)
 AC_CHECK_HEADERS([sstream])
 AC_LANG_POP(C++)
 AC_HEADER_STAT
 AC_FUNC_MEMCMP
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([gettext isinf memmem snprintf vsnprintf gettext])
+AC_CHECK_FUNCS([fopencookie funopen gettext isinf memmem snprintf vsnprintf])
 
 AC_MSG_CHECKING([for ec-fonts-mftraced])
 ecb10=`kpsewhich ecb10.pfa 2>/dev/null`
index 826f27ee87c95f567870b2502a21e0c0542e9aec..c2889a92cdb9a12d94b59988b0c7eedc315bca26 100644 (file)
@@ -90,13 +90,13 @@ preconfig () {
     if ! iscygwin; then
        cd $build || exit 1
        GUILE=1.6.5
-       cat > guile-config <<EOF
-[ "\$1" == "--version" ] && echo "guile-config - Guile version $GUILE"
+       cat > i686-cygwin-guile-config <<EOF
+[ "\$1" == "--version" ] && echo "i686-cygwin-guile-config - Guile version $GUILE"
 [ "\$1" == "compile" ] && echo "-I$cygwin_root/usr/include"
 [ "\$1" == "link" ] && echo "-L$cygwin_root/usr/lib -lguile"
 exit 0
 EOF
-       chmod 755 guile-config
+       chmod 755 i686-cygwin-guile-config
        PATH=$(pwd):$PATH
     fi
 }
index 05dfe6ccb4f2eef305f3bc3ae308883ff62e45b3..b77b7b7da7ba808e5c1d8d4ff098da341268b9e4 100644 (file)
@@ -9,39 +9,90 @@
 #ifndef LIBC_EXTENSION_HH
 #define LIBC_EXTENSION_HH
 
-#include <cstddef>
-#include <cstdarg>
+#include <stddef.h>
+#include <stdarg.h>
 
 #include "config.hh"
-#include "flower-proto.hh"
 
-char* strnlwr (char* start ,int n);
-char* strnupr (char* start, int n);
+char *strnlwr (char *start, int n);
+char *strnupr (char *start, int n);
 
-#if !HAVE_MEMMEM               // GNU extension.
-void *memmem (void const * haystack, int haystack_len,
-            void const *needle, int needle_len);
+#if ! HAVE_MEMMEM              /* GNU extension. */
+void *memmem (void const* haystack, int haystack_len,
+             void const *needle, int needle_len);
 #endif /* HAVE_MEMMEM */
 
-#if !HAVE_SNPRINTF             // GNU extension.
+#if ! HAVE_SNPRINTF            /* GNU extension. */
 int snprintf (char *str, size_t n, char const *format, ...);
 #endif
 
-#if !HAVE_VSNPRINTF            // GNU extension.
+#if ! HAVE_VSNPRINTF           /* GNU extension. */
 int vsnprintf (char *str, size_t, char const *format, va_list args);
 #endif
 
 #ifndef isinf
-#if !HAVE_ISINF                        // BSD extension 
+#if ! HAVE_ISINF               /* BSD extension. */
 int isinf (double x);
 #endif
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if ! HAVE_FOPENCOOKIE          /* GNU extension. */
+
+#include <stdio.h>
+#include <unistd.h>
+
+#if (! defined (__off64_t) && ! defined (__off64_t_defined)) || ! defined (__cplusplus)
+#define off64_t unsigned long long
+#endif
+
+#if HAVE_LIBIO_H
+#include <libio.h>
+#else
+
+#define cookie_io_functions_t le_cookie_io_functions_t 
+  typedef struct
+  {
+    ssize_t (*read) (void *, char *, size_t);
+    ssize_t (*write) (void *, char const *, size_t);
+    int (*seek) (void *, off64_t *, int);
+    int (*close) (void *);
+  } cookie_io_functions_t;
+
+#endif /* ! HAVE_LIBIO_H */
 
-Byte *memrchr (Byte const * p, int n, char c);
-Byte *strrev (Byte* byte, int length_i);
+  FILE *fopencookie (void *cookie, char const *modes,
+                    cookie_io_functions_t io_funcs);
+
+#if ! HAVE_FUNOPEN
+
+  int handle_cookie_io_fclose (FILE *);
+  int handle_cookie_io_fprintf (FILE *file, char const *format, ...);
+  int handle_cookie_io_putc (int c, FILE *file);
+
+/* FIXME: ttftool uses fclose fopencookie fprintf and putc only... */
+#define fclose handle_cookie_io_fclose
+#define fprintf handle_cookie_io_fprintf
+#ifdef putc
+#define std_putc putc
+#undef putc
+#endif
+#define putc handle_cookie_io_putc
+
+#endif /* ! HAVE_FUNOPEN */
+
+#endif /* ! HAVE_FOPENCOOKIE */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
 
+unsigned char *memrchr (unsigned char const *p, int n, char c);
+unsigned char *strrev (unsigned char *byte, int length_i);
 
 double my_round (double);
 
-#endif // LIBC_EXTENSION_HH
+#endif /* LIBC_EXTENSION_HH */
index e5077ffc4302460bc81eee31bc965e4b9fb4fb5c..f01c5f4d43043b3e0d304602bbc0925bd2b5bcad 100644 (file)
@@ -13,6 +13,8 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include "libc-extension.hh"
+
 class Memory_out_stream
 {
   char *buffer_;
@@ -23,17 +25,16 @@ class Memory_out_stream
   static cookie_io_functions_t functions_;
   static const int block_size_;
 
-  static ssize_t reader (void*, char*,  size_t);
-  static ssize_t writer (void*, const char*,  size_t);
-  static int seeker (void*, off64_t *, int whence);
-  static int cleaner (void*);
-
-
 public:
-  ~Memory_out_stream ();
+  static ssize_t reader (void *, char *, size_t);
+  static ssize_t writer (void *, char const *, size_t);
+  static int seeker (void *, off64_t *, int);
+  static int cleaner (void *);
+
   Memory_out_stream ();
+  ~Memory_out_stream ();
   FILE *get_file () const;
-  char const *get_string() const;
+  char const *get_string () const;
   ssize_t get_length () const;
 };
 
index efa544be6364b45fdd610a7c37a9308f58457d20..8ced60f22ca70556df9d670416f57114c81df90c 100644 (file)
@@ -5,16 +5,16 @@
   source file of the flowerlib
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-         Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "libc-extension.hh"
-
 #include <cmath>
 #include <cstdio>
 #include <cstring>
 #include <cctype>
 
+#include "libc-extension.hh"
+
 char* 
 strnlwr (char* start ,int n)
 {
@@ -39,7 +39,7 @@ strnupr (char* start, int n)
 
 /*
   There are some strange problems with round() on early glibcs.
- */
+*/
 double
 my_round (double x)
 {
@@ -59,32 +59,32 @@ isinf (double x)
 #if !HAVE_MEMMEM
 
 /** locate a substring. #memmem# finds the first occurrence of
-  #needle# in #haystack#.  This is not ANSI-C.
+    #needle# in #haystack#.  This is not ANSI-C.
 
-  The prototype is not in accordance with the Linux Programmer's
-  Manual v1.15, but it is with /usr/include/string.h   */
+    The prototype is not in accordance with the Linux Programmer's
+    Manual v1.15, but it is with /usr/include/string.h   */
 
-Byte *
-_memmem (Byte const *haystack, int haystack_len,
-       Byte const *needle,int needle_len)
+unsigned char *
+_memmem (unsigned char const *haystack, int haystack_len,
+        unsigned char const *needle,int needle_len)
 {
-  Byte const * end_haystack = haystack + haystack_len - needle_len + 1;
-  Byte const * end_needle = needle + needle_len ;
+  unsigned char const * end_haystack = haystack + haystack_len - needle_len + 1;
+  unsigned char const * end_needle = needle + needle_len ;
 
   /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
      is the spice of life */
   while (haystack < end_haystack) 
     {
-      Byte const *subneedle = needle;
-      Byte const *subhaystack = haystack;
+      unsigned char const *subneedle = needle;
+      unsigned char const *subhaystack = haystack;
       while (subneedle < end_needle) 
         if (*subneedle++ != *subhaystack++)
          goto next;
        
       /* Completed the needle.  Gotcha.  */
-      return (Byte *) haystack;
-      next:
-       haystack++;
+      return (unsigned char *) haystack;
+    next:
+      haystack++;
     }
   return 0;
 }
@@ -93,21 +93,21 @@ void *
 memmem (void const *haystack, int haystack_len,
        void const *needle,int needle_len)
 {
-  Byte const* haystack_byte_c = (Byte const*)haystack;
-  Byte const* needle_byte_c = (Byte const*)needle;
+  unsigned char const* haystack_byte_c = (unsigned char const*)haystack;
+  unsigned char const* needle_byte_c = (unsigned char const*)needle;
   return _memmem (haystack_byte_c, haystack_len, needle_byte_c, needle_len);
 }
 
 #endif
 
-Byte *
-memrchr (Byte const * p, int n, char c)
+unsigned char *
+memrchr (unsigned char const *p, int n, char c)
 {
-  const    Byte * q = p+n;
+  const unsigned char *q = p + n;
   while (q > p) 
     {
       if (*--q == c)
-       return (Byte*)q;
+       return (unsigned char*)q;
     }
   return 0;
 }
@@ -122,18 +122,15 @@ my_swap (T &t1, T &t2, T &tmp)
   t2 = tmp;
 }
 
-Byte*
-strrev (Byte* byte, int length_i)
+unsigned char *
+strrev (unsigned char *byte, int length)
 {
-  Byte tmp_byte;
-  
-  Byte* left = byte;
-  Byte* right = byte + length_i;
+  unsigned char tmp_byte;
+  unsigned char *left = byte;
+  unsigned char *right = byte + length;
 
   while (right > left) 
-    {
-      my_swap (*right-- , *left++ , tmp_byte);
-    }
+    my_swap (*right--, *left++ , tmp_byte);
   return byte;
 }
 
@@ -157,3 +154,90 @@ vsnprintf (char *str, size_t, char const *format, va_list args)
   return i;
 }
 #endif
+
+#include <assert.h>
+
+extern "C" {
+  
+#if ! HAVE_FOPENCOOKIE
+#if HAVE_FUNOPEN
+  
+  FILE *
+  fopencookie (void *cookie, char const *mode, cookie_io_functions_t *fun)
+  {
+    return funopen (cookie, fun->read, fun->write, fun->seek, fun->close);
+  }
+
+#else /* ! HAVE_FUNOPEN */
+
+#include <cstdio>
+#include "memory-stream.hh"
+
+  static bool
+  is_memory_stream (void *foo)
+  {
+    Memory_out_stream* cookie = (Memory_out_stream*) foo;
+    return dynamic_cast<Memory_out_stream*> (cookie);
+  }
+
+  FILE *
+  fopencookie (void *cookie, char const *modes, cookie_io_functions_t io_funcs)
+  {
+    (void) cookie;
+    (void) modes;
+    (void) io_funcs;
+    if (is_memory_stream (cookie))
+      return (FILE*) cookie;
+    assert (false);
+    return 0;
+  }
+
+#undef fclose
+  int 
+  handle_cookie_io_fclose (FILE *file)
+  {
+    if (is_memory_stream (file))
+      return Memory_out_stream::cleaner (file);
+    return fclose (file);
+  }
+
+#undef fprintf
+  int 
+  handle_cookie_io_fprintf (FILE *file, char const *format, ...)
+  {
+    va_list ap;
+    va_start (ap, format);
+    if (is_memory_stream (file))
+      {
+       static char buf[1024];
+       int i = vsnprintf (buf, sizeof (buf), format, ap);
+       if (i == -1)
+         assert (false);
+       return Memory_out_stream::writer (file, buf, i);
+      }
+    int i = vfprintf (file, format, ap);
+    va_end (ap);
+    return i;
+  }
+
+#ifdef std_putc
+#define putc std_putc
+#else
+#undef putc
+#endif
+  int 
+  handle_cookie_io_putc (int c, FILE *file)
+  {
+    if (is_memory_stream (file))
+      {
+       char buf[1];
+       buf[0] = (char) c;
+       return Memory_out_stream::writer (file, buf, 1);
+      }
+    return putc (c, file);
+  }
+  
+#endif /* ! HAVE_FUNOPEN */
+#endif /* ! HAVE_FOPENCOOKIE */
+
+} /* extern C */
index 9a9fbd4351829abd466a1639d906ff8480ca2f90..e33ed449e36c3bfbc04c73d45e8b196c15e20974 100644 (file)
@@ -39,12 +39,13 @@ Memory_out_stream::cleaner (void *cookie)
 Memory_out_stream::Memory_out_stream ()
 {
   size_ = 0;
-  buffer_ = 0; 
+  buffer_ = 0;
   buffer_blocks_ = 0;
   file_ = fopencookie ((void*) this, "w", functions_);
 }
 
-Memory_out_stream::~Memory_out_stream()
+#undef fclose
+Memory_out_stream::~Memory_out_stream ()
 {
   if (file_)
     fclose (file_);
@@ -52,7 +53,7 @@ Memory_out_stream::~Memory_out_stream()
   free (buffer_);
 }
 
-FILE*
+FILE *
 Memory_out_stream::get_file () const
 {
   return file_;
@@ -70,14 +71,13 @@ Memory_out_stream::get_string () const
   return buffer_;
 }
 
-
 ssize_t
 Memory_out_stream::writer (void *cookie,
                           const char *buffer,
                           size_t size)
 {
-  Memory_out_stream * stream = (Memory_out_stream*) cookie;
-  
+  Memory_out_stream *stream = (Memory_out_stream*) cookie;
+
   ssize_t newsize = stream->size_ + size;
 
   bool change = false;
@@ -89,7 +89,8 @@ Memory_out_stream::writer (void *cookie,
     }
 
   if (change)
-    stream->buffer_ = (char*) realloc (stream->buffer_, stream->buffer_blocks_ * block_size_);
+    stream->buffer_ = (char*) realloc (stream->buffer_,
+                                      stream->buffer_blocks_ * block_size_);
 
   memcpy (stream->buffer_ + stream->size_, buffer, size);
   stream->size_ = newsize;
@@ -97,7 +98,6 @@ Memory_out_stream::writer (void *cookie,
   return size;
 }
 
-
 ssize_t
 Memory_out_stream::reader (void *cookie,
                           char *buffer,
@@ -106,15 +106,16 @@ Memory_out_stream::reader (void *cookie,
   (void) cookie;
   (void) buffer;
   (void) size;
-  
+
   assert (false);
+  return 0;
 }
 
-
 int
-Memory_out_stream::seeker (void*, off64_t *, int whence)
+Memory_out_stream::seeker (void *, off64_t *, int whence)
 {
+  (void) whence;
+
   assert (false);
-  (void)whence;
   return 0;
 }
index 5ca2341a119200bfb3d9ce3416c74437d0bc5925..0be331868ad109f19ef864903d88dbe4d0529930 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   pfb.cc --  implement pfb conversion.
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include <cstdlib>
 #include "ttftool.h"
 
 char *
-pfb2pfa (Byte const * pfb, int length)
+pfb2pfa (Byte const *pfb, int length)
 {
-  char * out = new char[1];
+  char *out = new char[1];
   int olen = 0;
-  
-  Byte const * p = pfb;
-  while (p  < pfb + length)  
+
+  Byte const *p = pfb;
+  while (p < pfb + length)
     {
-      if (*p++ != 128) 
+      if (*p++ != 128)
        break;
 
       Byte type = *p++;
@@ -39,18 +38,18 @@ pfb2pfa (Byte const * pfb, int length)
       if (type == 1)
        {
          out = (char*)realloc (out, olen + seglen + 1);
-         charoutp = out + olen ;
+         char *outp = out + olen ;
          memcpy (outp, p, seglen);
-         olen += seglen; 
+         olen += seglen;
          p += seglen;
        }
       else if (type == 2)
        {
-         unsigned outlength =  (seglen * 2) + (seglen / 32) + 2;
+         unsigned outlength = (seglen * 2) + (seglen / 32) + 2;
 
          out = (char*)realloc (out, olen + outlength + 1);
 
-         char * outp = out + olen;
+         char *outp = out + olen;
          for (int i = seglen; i--;)
            {
              sprintf (outp, "%02x", *p++);
@@ -63,51 +62,47 @@ pfb2pfa (Byte const * pfb, int length)
 
          olen = outp - out;
        }
-      
+
     }
   out[olen] = 0;
 
   return out;
 }
 
-LY_DEFINE(ly_pfb_to_pfa, "ly:pfb->pfa",
-         1, 0, 0, (SCM pfb_path),
-         "Convert the contents of a PFB file to PFA."
-         )
+LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
+          1, 0, 0, (SCM pfb_file_name),
+          "Convert the contents of a PFB file to PFA."
+          )
 {
-  SCM_ASSERT_TYPE(scm_is_string (pfb_path), pfb_path,
-                 SCM_ARG1, __FUNCTION__, "string");
+  SCM_ASSERT_TYPE (scm_is_string (pfb_file_name), pfb_file_name,
+                  SCM_ARG1, __FUNCTION__, "string");
 
-  String path = ly_scm2string (pfb_path);
-  int len ; 
-  char *str = gulp_file (path, &len);
+  String file_name = ly_scm2string (pfb_file_name);
+  int len;
+  char *str = gulp_file (file_name, &len);
   char *pfa = pfb2pfa ((Byte*)str, len);
-  
-  SCM pfa_scm = scm_makfrom0str(pfa);
+
+  SCM pfa_scm = scm_makfrom0str (pfa);
   free (pfa);
   delete str;
   return pfa_scm;
 }
 
-
-LY_DEFINE(ly_ttf_to_pfa, "ly:ttf->pfa",
-         1, 0, 0, (SCM ttf_path),
-         "Convert the contents of a TTF file to Type42 PFA, returning it as "
-         " a string."
-         )
+LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa",
+          1, 0, 0, (SCM ttf_file_name),
+          "Convert the contents of a TTF file to Type42 PFA, returning it as "
+          " a string."
+          )
 {
-  SCM_ASSERT_TYPE(scm_is_string (ttf_path), ttf_path,
-                 SCM_ARG1, __FUNCTION__, "string");
-
-  String path = ly_scm2string (ttf_path);
+  SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
+                  SCM_ARG1, __FUNCTION__, "string");
+  
+  String file_name = ly_scm2string (ttf_file_name);
 
   Memory_out_stream stream;
-  create_type42(path.to_str0 (),
-               stream.get_file());
+  create_type42 (file_name.to_str0 (), stream.get_file ());
   SCM asscm = scm_from_locale_stringn (stream.get_string (),
                                       stream.get_length ());
 
   return asscm;
 }
-         
-
index 694d68ee1db3adbc5d3e49c5e5dbdc204d75b24f..958b3a6e9adbd84380ff9f24c482424dbdc7a97d 100644 (file)
@@ -491,8 +491,10 @@ AC_DEFUN([STEPMAKE_GUILE_FLAGS], [
 
 AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
     ## First, let's just see if we can find Guile at all.
+    test -n "$target_alias" && target_guile_config=$target_alias-guile-config
+    test -n "$host_alias" && host_guile_config=$host_alias-guile-config
     AC_MSG_CHECKING([for guile-config])
-    for guile_config in $GUILE_CONFIG guile-config $target-guile-config $build-guile-config; do
+    for guile_config in $GUILE_CONFIG $target_guile_config $host_guile_config $build_guile_config guile-config; do
        AC_MSG_RESULT([$guile_config])
        if ! $guile_config --version > /dev/null 2>&1 ; then
            AC_MSG_WARN([cannot execute $guile_config])
index 3d8e786c74c5148bd8c7415b837dea658f787c5a..6d75bbb40a60b7a1548625ae22f923c4ba8e0900 100644 (file)
@@ -7,6 +7,8 @@
 #include "types.h"
 #include "proto.h"
 
+#include "libc-extension.hh"
+
 #define CHUNKSIZE 65534
 
 #define NAMEOF(i) \
index 88c6cff93f15d77040fff825d22eb10c6e74478c..6e8a0add7325a0fec4ba3ea5ecb1d22d291e5f4e 100644 (file)
@@ -8,6 +8,8 @@
 #include "types.h"
 #include "proto.h"
 
+#include "libc-extension.hh"
+
 static void endianness_test (void);
 static void usage (char *);
 
index 45244213a02775931a4aebd62639ffe457cb3a5d..355d2b762fe2b475f7d2d2480f7a4ffbbf705763 100644 (file)
@@ -9,6 +9,8 @@
 #include "types.h"
 #include "proto.h"
 
+#include "libc-extension.hh"
+
 void *
 mymalloc (size_t size)
 {