From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6744 invoked by alias); 20 Dec 2007 08:57:39 -0000 Received: (qmail 6726 invoked by uid 22791); 20 Dec 2007 08:57:37 -0000 X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Dec 2007 08:57:30 +0000 Received: from dijkstra.wildebeest.org ([192.168.1.29]) by gnu.wildebeest.org with esmtp (Exim 4.63) (envelope-from ) id 1J5HDY-0001Rj-St for frysk@sourceware.org; Thu, 20 Dec 2007 09:57:27 +0100 Subject: Add libunwind-* arch symlinks and use "normal" recursive configure From: Mark Wielaard To: frysk@sourceware.org Content-Type: multipart/mixed; boundary="=-zo9viey070sZzfgLmEPO" Date: Thu, 20 Dec 2007 08:57:00 -0000 Message-Id: <1198141044.3071.20.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 (2.12.2-2.fc8) X-Spam-Score: -4.4 (----) 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-q4/txt/msg00228.txt.bz2 --=-zo9viey070sZzfgLmEPO Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1713 Hi, We used to have a some configure hacks to get libunwind configured and build for the different architectures we support. This patch adds some different configure magic so we can use "normal" recursive configure. Which has as advantage that you can just pass top level configure options (--enable-debug is really handy when hacking on libunwind stuff). And it makes sure that we use the same options for all target builds (previously the 'native' target would be build without UNW_REMOTE_ONLY, but all 'secondary' targets would be build with it.) It works because git allows symlinks in the repository. So no more tricks to get the right directories created, .keep_me files. frysk-imports/ChangeLog 2007-12-20 Mark Wielaard * .gitignore: Remove libunwind-*. * Makefile.am (LIBUNWIND_DIR): Set to either empty or canonical libunwind dir. (LIBUNWIND_ARCH_DIRS): Define. (LIBUNWIND_OTHER_DIRS): Removed. (CHECK_SUBDIRS): Include LIBUNWIND_DIR (if defined). (SUBDIRS): Include LIBUNWIND_ARCH_DIRS. * bootstrap.sh: Don't create libunwind-* dirs. * configure.ac: Don't create and configure libunwind-* dirs explicitly. (AC_CONFIG_SUBDIRS): Add libunwind-* dirs. frysk-imports/libunwind/ChangeLog 2007-12-20 Mark Wielaard * configure.in (is_local_frysk_build): New function. (frysk_local_target_cpu): New function. Define target_cpu, target_alias and UNW_REMOTE_ONLY based on new functions. Tested with several builds on x86_64, x86, with and without --enable-debug and --enable-check-libunwind and TestRunner -arch 32 on the 64bit system. Cheers, Mark --=-zo9viey070sZzfgLmEPO Content-Disposition: inline; filename=unwind-configure.patch Content-Type: text/x-patch; name=unwind-configure.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 7714 diff --git a/frysk-imports/.gitignore b/frysk-imports/.gitignore index aea9805..2655ccd 100644 --- a/frysk-imports/.gitignore +++ b/frysk-imports/.gitignore @@ -10,7 +10,3 @@ depcomp files.list install-sh missing -libunwind-i386 -libunwind-x86_64 -libunwind-ppc32 -libunwind-ppc64 diff --git a/frysk-imports/ChangeLog b/frysk-imports/ChangeLog index 0cd00e3..41be628 100644 --- a/frysk-imports/ChangeLog +++ b/frysk-imports/ChangeLog @@ -1,3 +1,17 @@ +2007-12-20 Mark Wielaard + + * .gitignore: Remove libunwind-*. + * Makefile.am (LIBUNWIND_DIR): Set to either empty or canonical + libunwind dir. + (LIBUNWIND_ARCH_DIRS): Define. + (LIBUNWIND_OTHER_DIRS): Removed. + (CHECK_SUBDIRS): Include LIBUNWIND_DIR (if defined). + (SUBDIRS): Include LIBUNWIND_ARCH_DIRS. + * bootstrap.sh: Don't create libunwind-* dirs. + * configure.ac: Don't create and configure libunwind-* dirs + explicitly. + (AC_CONFIG_SUBDIRS): Add libunwind-* dirs. + 2007-10-13 Mark Wielaard * .cvsignore: Add libunwind-ppc32. diff --git a/frysk-imports/Makefile.am b/frysk-imports/Makefile.am index c6602a4..d241705 100644 --- a/frysk-imports/Makefile.am +++ b/frysk-imports/Makefile.am @@ -44,26 +44,11 @@ include Makefile.gen # See the comment above CHECK_SUBDIRS, only add libunwind to the tests # if explicitly configured to do so. if CHECK_LIBUNWIND -if ARCH_X86 - LIBUNWIND_ARCH_DIR = libunwind-i386 - LIBUNWIND_OTHER_DIRS = libunwind-x86_64 libunwind-ppc32 libunwind-ppc64 -endif # ARCH_X86 -if ARCH_X86_64 - LIBUNWIND_ARCH_DIR = libunwind-x86_64 - LIBUNWIND_OTHER_DIRS = libunwind-i386 libunwind-ppc32 libunwind-ppc64 -endif # ARCH_X86_64 -if ARCH_PPC32 - LIBUNWIND_ARCH_DIR = libunwind-ppc32 - LIBUNWIND_OTHER_DIRS = libunwind-i386 libunwind-x86_64 libunwind-ppc64 -endif # ARCH_PPC32 -if ARCH_PPC64 - LIBUNWIND_ARCH_DIR = libunwind-ppc64 - LIBUNWIND_OTHER_DIRS = libunwind-i386 libunwind-x86_64 libunwind-ppc32 -endif # ARCH_PPC64 + LIBUNWIND_DIR = libunwind else - LIBUNWIND_ARCH_DIR = - LIBUNWIND_OTHER_DIRS = libunwind-i386 libunwind-x86_64 libunwind-ppc32 libunwind-ppc64 + LIBUNWIND_DIR = endif # CHECK_LIBUNWIND +LIBUNWIND_ARCH_DIRS = libunwind-i386 libunwind-x86_64 libunwind-ppc32 libunwind-ppc64 # List of directories that should both be included in the distro and # included in a recursive "make check". Only the native architecture @@ -77,13 +62,13 @@ CHECK_SUBDIRS = \ elfutils \ getopt \ tests \ - $(LIBUNWIND_ARCH_DIR) + $(LIBUNWIND_DIR) check-recursive: SUBDIRS = $(CHECK_SUBDIRS) # List of directories to build. This does not include "libunwind" but # does include the unwind cross libraries. -SUBDIRS = $(CHECK_SUBDIRS) $(LIBUNWIND_OTHER_DIRS) +SUBDIRS = $(CHECK_SUBDIRS) $(LIBUNWIND_ARCH_DIRS) # List of directories to install, put simply, only install frysk # stuff. Will eventually need to change this so that it installs diff --git a/frysk-imports/bootstrap.sh b/frysk-imports/bootstrap.sh index d8e1949..5a734c4 100755 --- a/frysk-imports/bootstrap.sh +++ b/frysk-imports/bootstrap.sh @@ -69,13 +69,6 @@ FILE_LIST="\ autoconf -Werror -f ) -for isa in i386 x86_64 ppc32 ppc64 -do - mkdir -p libunwind-$isa - # Something to include in EXTRA_DIST that these directories are - # included in the distro. - touch libunwind-$isa/.keep_me -done ( cd libunwind mkdir -p config diff --git a/frysk-imports/configure.ac b/frysk-imports/configure.ac index f9fc51a..5a127f1 100644 --- a/frysk-imports/configure.ac +++ b/frysk-imports/configure.ac @@ -58,24 +58,10 @@ AC_CONFIG_FILES([ cdtparser/Makefile junit/Makefile]) -for isa in i386 x86_64 ppc32 ppc64 -do - AC_MSG_NOTICE([configuring libunwind-$isa]) - mkdir -p libunwind-$isa - confdir=`cd "$srcdir";pwd` - # FIXME - This is wrong since it discards any configure flags given - # except those explicitly passed on... - ( cd libunwind-$isa ; $confdir/libunwind/configure \ - --target=$isa-unknown-linux-gnu \ - --build=${build} \ - --host=${host} \ - --prefix=${prefix} ) || exit $? -done - # Even though "libunwind" is not built, it is still included in the # list of configured subdirectories so that it can be included in # "make dist" (or the recursive "make distdir"). -AC_CONFIG_SUBDIRS([elfutils libunwind]) +AC_CONFIG_SUBDIRS([elfutils libunwind libunwind-i386 libunwind-x86_64 libunwind-ppc32 libunwind-ppc64]) AC_OUTPUT diff --git a/frysk-imports/libunwind-i386 b/frysk-imports/libunwind-i386 new file mode 120000 index 0000000..afad516 --- /dev/null +++ b/frysk-imports/libunwind-i386 @@ -0,0 +1 @@ +libunwind \ No newline at end of file diff --git a/frysk-imports/libunwind-ppc32 b/frysk-imports/libunwind-ppc32 new file mode 120000 index 0000000..afad516 --- /dev/null +++ b/frysk-imports/libunwind-ppc32 @@ -0,0 +1 @@ +libunwind \ No newline at end of file diff --git a/frysk-imports/libunwind-ppc64 b/frysk-imports/libunwind-ppc64 new file mode 120000 index 0000000..afad516 --- /dev/null +++ b/frysk-imports/libunwind-ppc64 @@ -0,0 +1 @@ +libunwind \ No newline at end of file diff --git a/frysk-imports/libunwind-x86_64 b/frysk-imports/libunwind-x86_64 new file mode 120000 index 0000000..afad516 --- /dev/null +++ b/frysk-imports/libunwind-x86_64 @@ -0,0 +1 @@ +libunwind \ No newline at end of file diff --git a/frysk-imports/libunwind/ChangeLog b/frysk-imports/libunwind/ChangeLog index 04d85ee..e09422a 100644 --- a/frysk-imports/libunwind/ChangeLog +++ b/frysk-imports/libunwind/ChangeLog @@ -1,3 +1,10 @@ +2007-12-20 Mark Wielaard + + * configure.in (is_local_frysk_build): New function. + (frysk_local_target_cpu): New function. + Define target_cpu, target_alias and UNW_REMOTE_ONLY based on new + functions. + 2007-12-11 Andrew Cagney * src/x86/Gregs.c (linux_scratch_loc): Add XMM registers. diff --git a/frysk-imports/libunwind/configure.in b/frysk-imports/libunwind/configure.in index 0cd1376..28ed2b2 100644 --- a/frysk-imports/libunwind/configure.in +++ b/frysk-imports/libunwind/configure.in @@ -7,6 +7,30 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(libunwind, mkvers(pkg_major, pkg_minor, pkg_extra), pkg_maintainer) AC_CONFIG_SRCDIR(src/mi/backtrace.c) AC_CONFIG_AUX_DIR(config) + +# Returns "yes" or "no" based on dirname starting with libunwind-. +is_local_frysk_build() { + if (echo $1 | grep ^libunwind- > /dev/null); then + echo "yes" + else + echo "no" + fi +} + +# Returns the encoded build cpu in the local frysk build dir name +frysk_local_target_cpu() { + echo $1 | cut -f2 -d- +} + +# We will trick the target to be the same as the name of the dir +# for frysk local builds. +fbdir=$(basename `cd "$builddir";pwd`) +frysk_local=`is_local_frysk_build $fbdir` +if test x$frysk_local = xyes; then + target_cpu=`frysk_local_target_cpu $fbdir` + target_alias=${target_cpu}-unknown-linux-gnu +fi + AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE([1.6 subdir-objects]) AM_CONFIG_HEADER(include/config.h) @@ -84,7 +108,7 @@ get_arch() { build_arch=`get_arch $build_cpu` target_arch=`get_arch $target_cpu` -AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$build_arch) +AM_CONDITIONAL(REMOTE_ONLY, test x$frysk_local = xyes) AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64) AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa) AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86) @@ -100,7 +124,7 @@ if test x$target_arch = xppc64; then AC_SUBST([libdir]) fi -if test x$target_arch != x$build_arch; then +if test x$frysk_local = xyes; then CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY" fi AC_CONFIG_LINKS(include/libunwind.h:include/libunwind-$target_arch.h --=-zo9viey070sZzfgLmEPO--