From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7419 invoked by alias); 16 Apr 2007 19:29:48 -0000 Received: (qmail 7409 invoked by uid 22791); 16 Apr 2007 19:29:46 -0000 X-Spam-Status: No, hits=2.3 required=5.0 tests=AWL,BAYES_20,BOTNET,HK_OBFDOM X-Spam-Check-By: sourceware.org Received: from ppp1053.in.ipex.cz (HELO ppp1053.in.ipex.cz) (212.71.160.53) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Apr 2007 20:29:40 +0100 Received: from ppp1053.in.ipex.cz (localhost.localdomain [127.0.0.1]) by ppp1053.in.ipex.cz (8.13.4/8.13.4) with ESMTP id l3GJLcnL020826 for ; Mon, 16 Apr 2007 21:21:38 +0200 Received: (from kasal@localhost) by ppp1053.in.ipex.cz (8.13.4/8.13.4/Submit) id l3GJLc8m020825 for frysk@sourceware.org; Mon, 16 Apr 2007 21:21:38 +0200 Date: Mon, 16 Apr 2007 19:29:00 -0000 From: Stepan Kasal To: frysk@sourceware.org Subject: Libunwind autoconfigury Message-ID: <20070416192138.GA20763@camelia.ucw.cz> Mail-Followup-To: frysk@sourceware.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Organization: <>< X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00057.txt.bz2 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 529 Hello, I tried to improve the autoconfigury in frysk-imports, which calls libunwind/configure several times. I decided to stick with documented interface of autoconf, so I worked hard to avoid using the ac_configure_args variable in frysk-imports/configure.ac. I decided to use wrapper scripts around libunwind/configure. But the result does not look as nice as I expected. In any case, I was not able to finish it so far. The current version of the patch is attached below, in case you are interested. Sorry, Stepan --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="frysk-libunwind-config2.patch" Content-length: 6443 Index: Makefile.am =================================================================== RCS file: /cvs/frysk/frysk-imports/Makefile.am,v retrieving revision 1.83 diff -u -r1.83 Makefile.am --- Makefile.am 16 Apr 2007 18:46:23 -0000 1.83 +++ Makefile.am 16 Apr 2007 19:16:24 -0000 @@ -49,12 +49,11 @@ junit \ elfutils \ getopt -# Leave out the libunwind-$arch subdirectories from dist: -DIST_SUBDIRS = $(CHECK_SUBDIRS) libunwind -SUBDIRS = $(DIST_SUBDIRS) libunwind-i386 +SUBDIRS = $(CHECK_SUBDIRS) libunwind $(LIBUNWIND_ARCH_SUBDIRS) check-recursive: SUBDIRS = $(CHECK_SUBDIRS) EXTRA_DIST += \ + $(LIBUNWIND_ARCH_CONFIGURES) \ frysk/ChangeLog \ frysk/junit/ChangeLog \ inua/ChangeLog \ Index: bootstrap.sh =================================================================== RCS file: /cvs/frysk/frysk-imports/bootstrap.sh,v retrieving revision 1.22 diff -u -r1.22 bootstrap.sh --- bootstrap.sh 4 Apr 2007 14:47:36 -0000 1.22 +++ bootstrap.sh 16 Apr 2007 19:16:24 -0000 @@ -95,3 +95,23 @@ echo "Running autoconf ... for libunwind" autoconf -f cd .. + +# Create subdirs for more libunind cross-builds +libunwind_archs="i386" +for arch in $libunwind_archs; do + test -d libunwind-$arch || mkdir libunwind-$arch + cat > libunwind-$arch/configure <<-\EOF + #!/bin/sh + case $0 in + */libunwind-*) + wrapperdir=`expr "X$0" : 'X\(.*\)/libunwind-[^/]*/configure$'` ;; + ./configure) + wrapperdir=.. ;; + *) + echo "Error: this wrapper cannot handle this case" >&2 + exit 1 ;; + esac + . "$wrapperdir"/config.wrapper + EOF + chmod +x libunwind-$arch/configure +done Index: config.wrapper =================================================================== RCS file: config.wrapper diff -N config.wrapper --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config.wrapper 16 Apr 2007 19:16:25 -0000 @@ -0,0 +1,75 @@ +#!/bin/sh + +# This file is part of the program FRYSK. +# +# Copyright 2005, 2006, 2007, Red Hat Inc. +# +# FRYSK is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# FRYSK is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FRYSK; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the +# additional right to link the code of FRYSK with code not covered +# under the GNU General Public License ("Non-GPL Code") and to +# distribute linked combinations including the two, subject to the +# limitations in this paragraph. Non-GPL Code permitted under this +# exception must only link to the code of FRYSK through those well +# defined interfaces identified in the file named EXCEPTION found in +# the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline +# functions from the Approved Interfaces without causing the +# resulting work to be covered by the GNU General Public +# License. Only Red Hat, Inc. may make changes or additions to the +# list of Approved Interfaces. You must obey the GNU General Public +# License in all respects for all of the FRYSK code and other code +# used in conjunction with FRYSK except the Non-GPL Code covered by +# this exception. If you modify this file, you may extend this +# exception to your version of the file, but you are not obligated to +# do so. If you do not wish to provide this exception without +# modification, you must delete this exception statement from your +# version and license this file solely under the GPL without +# exception. + +# A wrapper which calls the libunwind configure with the additional +# parameters from config-extra-args. +# It relies on the fact that the sub-configures are always called with +# --srcdir=... + +if test -f config-extra-args; then + . ./config-extra-args +else + echo "Error: config-extra-params not found." >&2 + exit 1 +fi + +for arg +do + case $arg in + --srcdir=*) + srcdir=`expr "x$arg" : 'x[^=]*=\(.*\)'` + ;; + *) + case $arg in + *\'*) arg=`echo "$arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + configure_args="$configure_args '$arg'" + esac +done + +case $srcdir in +"") + echo "No --srcdir=* option given." >&2 + exit 1 ;; +*) + eval exec "\"\$srcdir/../libunwind/configure\" $configure_args $extra_args" + ;; +esac Index: configure.ac =================================================================== RCS file: /cvs/frysk/frysk-imports/configure.ac,v retrieving revision 1.68 diff -u -r1.68 configure.ac --- configure.ac 16 Apr 2007 15:45:35 -0000 1.68 +++ configure.ac 16 Apr 2007 19:16:25 -0000 @@ -58,20 +58,31 @@ cdtparser/Makefile junit/Makefile]) +AC_CONFIG_SUBDIRS([elfutils]) -test -d libunwind-i386 || mkdir libunwind-i386 -( - confdir=`(cd "$srcdir";pwd)` - cd libunwind-i386 - # Make sure the inplace build does not break with "already configured" - # message; the file is going to regenerated, anyway. - # FIXME - This is wrong since it discards any configure flags given - # except those explicitly passed on... - rm -f $confdir/libunwind/config.status - $confdir/libunwind/configure --target=i386-unknown-linux-gnu \ - --build=${build} --host=${host} --prefix=${prefix} -) +###################### +# Configure libunwind for cross builds, too: -AC_CONFIG_SUBDIRS([elfutils libunwind-i386 libunwind]) +AC_CONFIG_SUBDIRS([libunwind-i386]) +# To enable in-place builds, we have to put the native libunwind last, +# and the previous config.status has to be rebuilt. +AC_CONFIG_SUBDIRS([libunwind]) +if test "$no_recursion" != yes; then + rm -f $srcdir/libunwind/config.status +fi + +libunwind_archs="i386" + +if test "$target_vendor" = "" || test "$target_os" = ""; then + AC_MSG_ERROR([Canonical target not set.]) +fi + +for arch in $libunwind_archs; do + LIBUNWIND_ARCH_SUBDIRS="$LIBUNWIND_ARCH_SUBDIRS libunwind-$arch" + LIBUNWIND_ARCH_CONFIGURES="$LIBUNWIND_ARCH_SUBDIRS libunwind-$arch/configure" + mkdir libunwind-$arch + echo "extra_args='--target=$arch-$target_vendor-$target_os'" \ + >libunwind-$arch/config-extra-args +done AC_OUTPUT --HcAYCG3uE/tztfnV--