From 0c063fad74495afa5f79e51585915dbb71081873 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 24 Oct 2008 15:40:58 +0000 Subject: Make ltrace finally build: - copy sources to build directory, as it does not build out-of-tree - add a patch to make it build for non *-linux-gnu host tuples - add a patch to make it cross-build correctly /trunk/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch | 26 26 0 0 +++ /trunk/patches/ltrace/0.4/110-allow-cross-compile.patch | 89 89 0 0 ++++++++++ /trunk/scripts/build/debug/400-ltrace.sh | 5 3 2 0 + 3 files changed, 118 insertions(+), 2 deletions(-) diff --git a/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch b/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch new file mode 100644 index 0000000..eba117a --- /dev/null +++ b/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch @@ -0,0 +1,26 @@ +diff -durN ltrace-0.4.orig/configure ltrace-0.4/configure +--- ltrace-0.4.orig/configure 2008-10-23 23:19:38.000000000 +0200 ++++ ltrace-0.4/configure 2008-10-23 23:19:06.000000000 +0200 +@@ -1392,6 +1392,9 @@ + + + HOST_OS="$host_os" ++case "${HOST_OS}" in ++ linux-*) HOST_OS=linux-gnu;; ++esac + + + ac_ext=c +diff -durN ltrace-0.4.orig/configure.ac ltrace-0.4/configure.ac +--- ltrace-0.4.orig/configure.ac 2008-10-23 23:19:43.000000000 +0200 ++++ ltrace-0.4/configure.ac 2008-10-23 23:18:44.000000000 +0200 +@@ -7,6 +7,9 @@ + dnl Check host system type + AC_CANONICAL_HOST + HOST_OS="$host_os" ++case "${HOST_OS}" in ++ linux-*) HOST_OS=linux-gnu;; ++esac + AC_SUBST(HOST_OS) + + dnl Checks for programs. diff --git a/patches/ltrace/0.4/110-allow-cross-compile.patch b/patches/ltrace/0.4/110-allow-cross-compile.patch new file mode 100644 index 0000000..a83f7f3 --- /dev/null +++ b/patches/ltrace/0.4/110-allow-cross-compile.patch @@ -0,0 +1,89 @@ +diff -durN ltrace-0.4.orig/Makefile.in ltrace-0.4/Makefile.in +--- ltrace-0.4.orig/Makefile.in 2006-03-05 23:21:07.000000000 +0100 ++++ ltrace-0.4/Makefile.in 2008-10-24 10:31:51.000000000 +0200 +@@ -2,8 +2,14 @@ + # ltrace's Makefile.in + # + +-#OS := $(shell uname -s) + OS := @HOST_OS@ ++ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \ ++ -e s/sun4u/sparc64/ \ ++ -e s/arm.*/arm/ \ ++ -e s/sa110/arm/ \ ++ -e s/ppc64/ppc/ \ ++ -e s/s390x/s390/) ++export ARCH + + TOPDIR = $(shell pwd) + +@@ -20,10 +26,10 @@ + LIBS = @LIBS@ + + INSTALL = @INSTALL@ +-INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +-INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +-INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +-INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 ++INSTALL_FILE = $(INSTALL) -p -m 644 ++INSTALL_PROGRAM = $(INSTALL) -p -m 755 ++INSTALL_SCRIPT = $(INSTALL) -p -m 755 ++INSTALL_DIR = $(INSTALL) -p -d -m 755 + + OBJ = ltrace.o options.o elf.o output.o read_config_file.o \ + execute_program.o wait_for_something.o process_event.o \ +diff -durN ltrace-0.4.orig/configure ltrace-0.4/configure +--- ltrace-0.4.orig/configure 2008-10-23 23:35:39.000000000 +0200 ++++ ltrace-0.4/configure 2008-10-24 10:27:20.000000000 +0200 +@@ -311,7 +311,7 @@ + # include + #endif" + +-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS' ++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_ARCH HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS' + ac_subst_files='' + + # Initialize some variables set by options. +@@ -1390,7 +1390,7 @@ + host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +- ++HOST_ARCH="$host_cpu" + HOST_OS="$host_os" + case "${HOST_OS}" in + linux-*) HOST_OS=linux-gnu;; +@@ -4818,6 +4818,7 @@ + s,@host_cpu@,$host_cpu,;t t + s,@host_vendor@,$host_vendor,;t t + s,@host_os@,$host_os,;t t ++s,@HOST_ARCH@,$HOST_ARCH,;t t + s,@HOST_OS@,$HOST_OS,;t t + s,@CC@,$CC,;t t + s,@CFLAGS@,$CFLAGS,;t t +diff -durN ltrace-0.4.orig/configure.ac ltrace-0.4/configure.ac +--- ltrace-0.4.orig/configure.ac 2008-10-23 23:35:39.000000000 +0200 ++++ ltrace-0.4/configure.ac 2008-10-24 10:19:47.000000000 +0200 +@@ -6,10 +6,12 @@ + + dnl Check host system type + AC_CANONICAL_HOST ++HOST_ARCH="$host_cpu" + HOST_OS="$host_os" + case "${HOST_OS}" in + linux-*) HOST_OS=linux-gnu;; + esac ++AC_SUBST(HOST_ARCH) + AC_SUBST(HOST_OS) + + dnl Checks for programs. +diff -durN ltrace-0.4.orig/sysdeps/linux-gnu/Makefile ltrace-0.4/sysdeps/linux-gnu/Makefile +--- ltrace-0.4.orig/sysdeps/linux-gnu/Makefile 2006-02-20 22:44:45.000000000 +0100 ++++ ltrace-0.4/sysdeps/linux-gnu/Makefile 2008-10-24 10:24:41.000000000 +0200 +@@ -1,6 +1,3 @@ +-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ +- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/) +- + CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH) + + OBJ = trace.o proc.o breakpoint.o diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh index 32e11ea..eac384a 100644 --- a/scripts/build/debug/400-ltrace.sh +++ b/scripts/build/debug/400-ltrace.sh @@ -21,9 +21,10 @@ do_debug_ltrace_build() { mkdir -p "${CT_BUILD_DIR}/build-ltrace" CT_Pushd "${CT_BUILD_DIR}/build-ltrace" + CT_DoLog EXTRA "Copying sources to build dir" + (cd "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}"; tar cf - .)| tar xvf - |CT_DoLog ALL + CT_DoLog EXTRA "Configuring ltrace" -# CFLAGS="-I${CT_SYSROOT_DIR}/usr/include" \ -# LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure" \ --build=${CT_BUILD} \ -- cgit v0.10.2-6-g49f6