unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Auto(conf|make) style questions
@ 2003-03-19 17:21 tomas
  2003-03-19 17:39 ` Rob Browning
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: tomas @ 2003-03-19 17:21 UTC (permalink / raw)
  Cc: rm

Hi,

it's me again. I have some (kind of) working code and would like
to hear some comments.

My problem seems fairly generic; thus I'm surprised I haven't found
a ready-made one (I won't dismiss the possibility I'm blind. The
Enlightened may help me then ;-)

The Problem:

We're trying to build a library (call it guile-neon) which links to
an existing one (call it guile), and would like to inter-operate
with different versions. If an older version doesn't provide some
function, we'll have to do it ourselves. Kind of what AC_REPLACE_FUNCS
does at the libc level.

This is what I've come up with so far:
(from configure.in)

  +------------------------------------------------------------------------------------------
  | # Grrr. I'd like to use AC_REPLACE_FUNCS here.
  | AC_CACHE_CHECK([whether your Guile has scm_c_string2str() (around version > 1.6.xx)],
  |                [guile_neon_cv_has_string2str],
  |                [guile_neon_save_CFLAGS=$CCFLAGS; CFLAGS="$CCFLAGS `guile-config compile`"
  |                 guile_neon_save_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS `guile-config link`"
  |                 AC_TRY_LINK([#include <libguile.h>],
  |                             [int len; char *foo=scm_c_string2str(NULL, NULL, &len);],
  |                             [guile_neon_cv_has_string2str=yes],
  |                             [guile_neon_cv_has_string2str=no])
  |                 LDFLAGS=$guile_neon_save_LDFLAGS
  |                 CFLAGS=$guile_neon_save_CFLAGS
  |                ])
  | 
  | if test "$guile_neon_cv_has_string2str" = "no"; then
  |   echo "Including scm_c_string2str.c in object files"
  |   AC_LIBOBJ(scm_c_string2str)
  | fi
  +------------------------------------------------------------------------------------------

And this is in Makefile.am:

  +------------------------------------------------------------------------------------------
  | libguile_neon_neon_la_SOURCES = $(BUILT_SOURCES) neon.c neon.h
  | libguile_neon_neon_la_LDFLAGS = -version-info 0:0 -export-dynamic $(NEON_LIBS)
  | libguile_neon_neon_la_LIBADD = $(LIBOBJS)
  +------------------------------------------------------------------------------------------

Now my questions:

  - Is this the right way to do things?
  - AC_LIBOBJ passes the extra objects through $(LIBOBJS). That means that I can
    only do it globally, not for a specific binary. Is there another way?

Regards
-- tomas




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

end of thread, other threads:[~2003-04-26  8:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-19 17:21 Auto(conf|make) style questions tomas
2003-03-19 17:39 ` Rob Browning
2003-03-20  7:56   ` tomas
2003-03-19 17:46 ` Mikael Djurfeldt
2003-03-19 19:26 ` Alexandre Duret-Lutz
2003-03-20  8:04   ` tomas
2003-03-21 20:17     ` Alexandre Duret-Lutz
2003-03-22  8:32       ` tomas
     [not found] ` <878yvbi6ih.fsf@alice.rotty.yi.org>
2003-03-20 10:48   ` tomas
2003-04-26  8:17     ` Neil Jerram

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