From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: linking with libguile-2.0, rpath Date: Sun, 20 Feb 2011 11:58:37 +0100 Message-ID: References: <1e640654.925f.12e338022b5.Coremail.lispor@163.com> <201102191630.16597.bruno@clisp.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298199228 31080 80.91.229.12 (20 Feb 2011 10:53:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Feb 2011 10:53:48 +0000 (UTC) Cc: Guile bug , Fu-Gangqiang , Mark To: Bruno Haible Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Feb 20 11:53:44 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pr6v7-0003DN-Qk for guile-bugs@m.gmane.org; Sun, 20 Feb 2011 11:53:43 +0100 Original-Received: from localhost ([127.0.0.1]:51329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pr6v6-0001sZ-KL for guile-bugs@m.gmane.org; Sun, 20 Feb 2011 05:53:40 -0500 Original-Received: from [140.186.70.92] (port=43649 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pr6v0-0001rm-U2 for bug-guile@gnu.org; Sun, 20 Feb 2011 05:53:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pr6uy-0002lM-Pk for bug-guile@gnu.org; Sun, 20 Feb 2011 05:53:34 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:34076 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pr6uy-0002lI-M7 for bug-guile@gnu.org; Sun, 20 Feb 2011 05:53:32 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 3271F288E; Sun, 20 Feb 2011 05:54:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ECW0scVBerXXAucg50vgD1pp0Gk=; b=KqCFqH y07JVkiAmp2FH3WkXyrFsVvNggjfAN6sfUJ7KA4ukyZabdFZ6RRnje0UpxSVnWZz j4PQNyT9GwqtffxRM8X4Y4NN+7nGC+LWGNZlJT/FT99myQiyq6SZBeZBhdzYHY7E hXxxhGZnvBUSNo/s/Dbcajmk8XJKPWSFJTClY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=KTTFRVz75GW45AqlBffS2O/VGOw+8IfQ bQdybIGt4WOhKIfiJA1QZaH5fmuWacaC9SiUtk2qf7qb2CJM0Y2EYWWAabZPV5/y +HGmXyHjd3iDPZ4WCwyCeC389b3+NsRwIytotllEW9DoXB5akEXMKnx8CvOUEmXj Kx3MFTRJg0g= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 01490288D; Sun, 20 Feb 2011 05:54:37 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id E5BDB2889; Sun, 20 Feb 2011 05:54:32 -0500 (EST) In-Reply-To: <201102191630.16597.bruno@clisp.org> (Bruno Haible's message of "Sat, 19 Feb 2011 16:30:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: CF9CDD1C-3CDF-11E0-9D65-AF401E47CF6F-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5192 Archived-At: Hi Bruno, Thanks for looking into this matter. On Sat 19 Feb 2011 16:30, Bruno Haible writes: > First of all, the macro GUILE_FLAGS in guile.m4 needs to be extended. > Find attached a patch that does 3 things: Thanks! Applied. > Second, about the documentation. A command line > > $ gcc -o simple-guile simple-guile.c `pkg-config --cflags --libs guile-2.0` > > cannot work in general, because the list of directories to use in the -rpath > option(s) comes from pkg-config, but it needs to be presented in a syntax that > depends on the compiler (think of Solaris, where the option for gcc is > -Wl,-rpath and the option for cc is -R), and pkg-config does not know about the > compiler. > > That's also the reason why I propose to add this logic to the GUILE_FLAGS macro > and not to the 'guile-config' program. I don't know how I was unaware of this for so long; libtool-induced bliss (!) I guess. > So, for the documentation, I only see an ad-hoc approach: > > # Define a function that transform -L options to rpath options. This definition > # works with gcc on glibc systems. On other platforms, the details are different. > $ transform_L_options_to_rpath_options () > { > sed -e 's/^/ /' | sed -e 's/ -l *[^ ]*//g' -e 's/ -L */ -Wl,-rpath -Wl,/g' > } > > With this, the command line becomes > > $ gcc -o simple-guile simple-guile.c > `pkg-config --cflags --libs guile-2.0` > `pkg-config --libs guile-2.0 | transform_L_options_to_rpath_options` Food for thought. Thanks for the suggestion. Cheers, Andy -- http://wingolog.org/