unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: bug-guile@gnu.org
Cc: guile-devel@gnu.org
Subject: Re: Guile with win32 cross compiling
Date: Sun, 24 Apr 2011 22:22:25 +0200	[thread overview]
Message-ID: <87r58rpfge.fsf@gnu.org> (raw)
In-Reply-To: m3y63fiuwp.fsf@unquote.localdomain

Hi,

Andy Wingo <wingo@pobox.com> writes:

> From b03f8337ea62091208680fab901606c9af360a5d Mon Sep 17 00:00:00 2001
> From: Andy Wingo <wingo@pobox.com>
> Date: Tue, 12 Apr 2011 13:12:56 +0200
> Subject: [PATCH] check for iconveh values at configure-time
>
> * configure.ac: Check for the iconveh values here, instead of relying on
>   gen-scmconfig to know them.  That doesn't work in general because
>   gen-scmconfig runs on the build machine, not the target machine.
>
> * libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Revert rule to the
>   revision before 533d8212.
>
> * libguile/gen-scmconfig.h.in (SCM_I_GSC_ICONVEH_ERROR):
>   (SCM_I_GSC_ICONVEH_QUESTION_MARK):
>   (SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE):
> * libguile/gen-scmconfig.c: Use configure-time substitutions to set
>   SCM_ICONVEH_ERROR_HANDLER et al.

Nice!

>  #--------------------------------------------------------------------
>  #
> +# What values do the iconv error handlers have?
> +#
> +# The only place that we need iconv in our public interfaces is for
> +# the error handlers, which are just ints.  So we weaken our
> +# dependency by looking up those values at configure-time.
> +#--------------------------------------------------------------------
> +SCM_I_GSC_ICONVEH_ERROR=0
> +SCM_I_GSC_ICONVEH_QUESTION_MARK=1
> +SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE=2
> +AC_MSG_CHECKING([for iconveh_error])
> +AC_RUN_IFELSE([AC_LANG_SOURCE(
> +[AC_INCLUDES_DEFAULT
> +#include <uniconv.h>
> +int
> +main (int argc, char *argv[])
> +{
> +  if (argc > 1)
> +    printf ("%d\n", (int)iconveh_error);
> +  return 0;
> +}])],
> +	       [SCM_I_GSC_ICONVEH_ERROR=`./conftest$EXEEXT pretty-please`
> +                AC_MSG_RESULT([$SCM_I_GSC_ICONVEH_ERROR])],
> +	       [AC_MSG_FAILURE([failed to get iconveh_error])],
> +	       [AC_MSG_WARN([assuming $SCM_I_GSC_ICONVEH_ERROR for cross-compilation])])
> +
> +AC_MSG_CHECKING([for iconveh_question_mark])
> +AC_RUN_IFELSE([AC_LANG_SOURCE(
> +[AC_INCLUDES_DEFAULT
> +#include <uniconv.h>
> +int
> +main (int argc, char *argv[])
> +{
> +  if (argc > 1)
> +    printf ("%d\n", (int)iconveh_question_mark);
> +  return 0;
> +}])],
> +	       [SCM_I_GSC_ICONVEH_QUESTION_MARK=`./conftest$EXEEXT pretty-please`
> +                AC_MSG_RESULT([$SCM_I_GSC_ICONVEH_QUESTION_MARK])],
> +	       [AC_MSG_FAILURE([failed to get iconveh_question_mark])],
> +	       [AC_MSG_WARN([assuming $SCM_I_GSC_ICONVEH_QUESTION_MARK for cross-compilation])])

Looks good to me.  Could you factor it into an M4 macro, use
AC_CACHE_CHECK, and move that to acinclude.m4?

Thanks!

Ludo’.




  parent reply	other threads:[~2011-04-24 20:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 22:06 Guile with win32 cross compiling Volker Grabsch
2011-04-01 10:38 ` Andy Wingo
2011-04-01 18:50   ` Volker Grabsch
2011-04-12 11:14     ` Andy Wingo
2011-04-23 16:10       ` Volker Grabsch
2011-04-24 10:42         ` Andy Wingo
2011-05-16 23:01           ` Volker Grabsch
2011-05-20 10:32             ` Andy Wingo
2011-05-20 12:25               ` Volker Grabsch
2011-05-20 12:48                 ` Jan Nieuwenhuizen
2011-05-20 13:25                   ` Andy Wingo
2011-05-20 22:19                   ` Volker Grabsch
2011-06-17  9:03                     ` Andy Wingo
2011-07-01 13:52                       ` Andy Wingo
2011-04-24 20:22       ` Ludovic Courtès [this message]
2011-04-28 21:03         ` Andy Wingo
2011-06-19 14:42           ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2011-04-05 19:43 Mike Gran
2011-04-06  1:38 ` Volker Grabsch
2011-04-06 12:46   ` Ludovic Courtès
2011-03-26 22:04 Volker Grabsch

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=87r58rpfge.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guile@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).