unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* How to replace a function
@ 2003-03-07 12:37 tomas
  2003-03-07 16:38 ` Rob Browning
  2003-03-07 16:44 ` Rob Browning
  0 siblings, 2 replies; 5+ messages in thread
From: tomas @ 2003-03-07 12:37 UTC (permalink / raw)
  Cc: rm

Hi, lists

we are trying to build a guile extension which should link
smoothly against 1.6 and 1.7. If possible, we would like
to use The Blessed Function (it's scm_c_string2str(), for
the record). But alas, 1.6 hasn't got that. It seems that
AC_REPLACE_FUNCS is the right macro (first do AC_CHECK_LIB,
right?).

The problem is that AC_REPLACE_FUNCS will find one version
of the Guile library, whereas the version I'm going to link
against is the one returned by `guile-config link' or whatever.

My question: Is there a canonical way to solve this? I.e.
is there a way to tell AC_REPLACE_FUNCS *which* library to
look into? Or is it just meant to cope with ``standard system
libraries'' and am I to re-invent the wheel and do a
tentative compile?

Thanks for any hints

-- tomas




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to replace a function
  2003-03-07 12:37 How to replace a function tomas
@ 2003-03-07 16:38 ` Rob Browning
  2003-03-10 12:21   ` tomas
  2003-03-07 16:44 ` Rob Browning
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Browning @ 2003-03-07 16:38 UTC (permalink / raw)
  Cc: guile-devel

tomas@fabula.de writes:

> The problem is that AC_REPLACE_FUNCS will find one version
> of the Guile library, whereas the version I'm going to link
> against is the one returned by `guile-config link' or whatever.
>
> My question: Is there a canonical way to solve this? I.e.
> is there a way to tell AC_REPLACE_FUNCS *which* library to
> look into? Or is it just meant to cope with ``standard system
> libraries'' and am I to re-invent the wheel and do a
> tentative compile?

If I understand what you're doing right, you might be able to just
make sure that you have the right -L and -l args in LDFLAGS and LIBS
before you call AC_REPLACE_FUNCS.  However, even if this does work in
the normal case, depending on how AC_REPLACE_FUNCs works, this may or
may not work when cross-compiling.  I don't really have any experience
with AC_REPLACE_FUNCS in particular, so I'm just guessing here.

Hope this helps

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to replace a function
  2003-03-07 12:37 How to replace a function tomas
  2003-03-07 16:38 ` Rob Browning
@ 2003-03-07 16:44 ` Rob Browning
  2003-03-10 12:25   ` tomas
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Browning @ 2003-03-07 16:44 UTC (permalink / raw)
  Cc: guile-devel

tomas@fabula.de writes:

> we are trying to build a guile extension which should link
> smoothly against 1.6 and 1.7. If possible, we would like
> to use The Blessed Function (it's scm_c_string2str(), for
> the record). But alas, 1.6 hasn't got that. It seems that
> AC_REPLACE_FUNCS is the right macro (first do AC_CHECK_LIB,
> right?).

One other option.  Could you you use something like this in a C file
instead?

  #ifdef SCM_MAJOR_VERSION \
    && (SCM_MAJOR_VERSION == 1) \
    && (SCM_MINOR_VERSION == 6)
  # include "augment-1.6.c"
  #endif

and add something similar in the header(s) for the missing prototypes?

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to replace a function
  2003-03-07 16:38 ` Rob Browning
@ 2003-03-10 12:21   ` tomas
  0 siblings, 0 replies; 5+ messages in thread
From: tomas @ 2003-03-10 12:21 UTC (permalink / raw)
  Cc: guile-devel

On Fri, Mar 07, 2003 at 10:38:33AM -0600, Rob Browning wrote:
> tomas@fabula.de writes:
> 

[...]

> If I understand what you're doing right, you might be able to just
> make sure that you have the right -L and -l args in LDFLAGS and LIBS
> before you call AC_REPLACE_FUNCS.  However, even if this does work in
> the normal case, depending on how AC_REPLACE_FUNCs works, this may or
> may not work when cross-compiling.

Thanks -- I'm going to try this (AC_REPLACE_FUNC is based on AC_TRY_LINK,
and this should work with cross-compiling, since you must be able to link
on your host system). But first I'm trying to get the ``straight boring
way'' to work (Autoconf is full of surprises for me: for example it now
complains it doesn't find an `strcasecmp.c'. OK, there is an AC_REPLACE_FUNC
hidden somewhere down in aclocal.m4, but why it gets triggered now and
not before just escapes my small imagination).

Regards
-- tomas


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to replace a function
  2003-03-07 16:44 ` Rob Browning
@ 2003-03-10 12:25   ` tomas
  0 siblings, 0 replies; 5+ messages in thread
From: tomas @ 2003-03-10 12:25 UTC (permalink / raw)
  Cc: guile-devel

On Fri, Mar 07, 2003 at 10:44:34AM -0600, Rob Browning wrote:
> tomas@fabula.de writes:
> 

[About being compatible to two Guile versions]

> One other option.  Could you you use something like this in a C file
> instead?
> 
>   #ifdef SCM_MAJOR_VERSION \
>     && (SCM_MAJOR_VERSION == 1) \
>     && (SCM_MINOR_VERSION == 6)
>   # include "augment-1.6.c"
>   #endif
> 
> and add something similar in the header(s) for the missing prototypes?

Hmmm... It's tempting to skirt the Automonster this way, ain't it ;-)

But somehow a `feature test' seems to me the right thing here (and maybe
useful to others on this list). What do you think?

Thanks
-- tomas




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-10 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-07 12:37 How to replace a function tomas
2003-03-07 16:38 ` Rob Browning
2003-03-10 12:21   ` tomas
2003-03-07 16:44 ` Rob Browning
2003-03-10 12:25   ` tomas

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