From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tomas@fabula.de Newsgroups: gmane.comp.sysutils.autoconf.general,gmane.lisp.guile.devel Subject: Auto(conf|make) style questions Date: Wed, 19 Mar 2003 18:21:04 +0100 Sender: autoconf-bounces+gnu-autoconf=m.gmane.org@gnu.org Message-ID: <20030319172104.GA6109@www> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048093989 28463 80.91.224.249 (19 Mar 2003 17:13:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2003 17:13:09 +0000 (UTC) Cc: rm@fabula.de Original-X-From: autoconf-bounces+gnu-autoconf=m.gmane.org@gnu.org Wed Mar 19 18:13:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18vh7j-0007Ok-00 for ; Wed, 19 Mar 2003 18:13:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vh65-0000rb-06 for gnu-autoconf@m.gmane.org; Wed, 19 Mar 2003 12:11:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18vh5I-0000mm-00 for autoconf@gnu.org; Wed, 19 Mar 2003 12:10:36 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18vh5A-0000hV-00 for autoconf@gnu.org; Wed, 19 Mar 2003 12:10:29 -0500 Original-Received: from [217.22.192.104] (helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vgvs-0007Rn-00; Wed, 19 Mar 2003 12:00:52 -0500 Original-Received: by www.elogos.de (Postfix, from userid 5002) id BA37F14080; Wed, 19 Mar 2003 18:21:04 +0100 (CET) Original-To: guile-devel@gnu.org, autoconf@gnu.org Content-Disposition: inline User-Agent: Mutt/1.3.28i X-BeenThere: autoconf@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Discussion list for the autoconf build system List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: autoconf-bounces+gnu-autoconf=m.gmane.org@gnu.org Xref: main.gmane.org gmane.comp.sysutils.autoconf.general:2372 gmane.lisp.guile.devel:2088 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2088 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 ], | [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