[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Auto(conf|make) style questions

From: tomas
Subject: Auto(conf|make) style questions
Date: Wed, 19 Mar 2003 18:21:04 +0100
User-agent: Mutt/1.3.28i


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:

  | # Grrr. I'd like to use AC_REPLACE_FUNCS here.
  | AC_CACHE_CHECK([whether your Guile has scm_c_string2str() (around version > 
  |                [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

  | libguile_neon_neon_la_SOURCES = $(BUILT_SOURCES) neon.c neon.h
  | libguile_neon_neon_la_LDFLAGS = -version-info 0:0 -export-dynamic 
  | 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?

-- tomas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]