patches/ltrace/0.5/110-allow-cross-compile.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
yann@1036
     1
diff -durN ltrace-0.5.orig/Makefile.in ltrace-0.5/Makefile.in
yann@1036
     2
--- ltrace-0.5.orig/Makefile.in	2006-03-14 00:12:01.000000000 +0100
yann@1036
     3
+++ ltrace-0.5/Makefile.in	2008-11-04 19:23:05.000000000 +0100
yann@1036
     4
@@ -2,8 +2,14 @@
yann@1036
     5
 # ltrace's Makefile.in
yann@1036
     6
 #
yann@1036
     7
 
yann@1036
     8
-#OS		:= $(shell uname -s)
yann@1036
     9
 OS		:= @HOST_OS@
yann@1036
    10
+ARCH		:= $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/      \
yann@1036
    11
+						   -e s/sun4u/sparc64/  \
yann@1036
    12
+						   -e s/arm.*/arm/      \
yann@1036
    13
+						   -e s/sa110/arm/      \
yann@1036
    14
+						   -e s/ppc64/ppc/      \
yann@1036
    15
+						   -e s/s390x/s390/)
yann@1036
    16
+export ARCH
yann@1036
    17
 
yann@1036
    18
 TOPDIR		= $(shell pwd)
yann@1036
    19
 
yann@1036
    20
@@ -20,10 +26,10 @@
yann@1036
    21
 LIBS		=	@LIBS@
yann@1036
    22
 
yann@1036
    23
 INSTALL		=	@INSTALL@
yann@1036
    24
-INSTALL_FILE	=	$(INSTALL) -p    -o root -g root  -m  644
yann@1036
    25
-INSTALL_PROGRAM	=	$(INSTALL) -p    -o root -g root  -m  755
yann@1036
    26
-INSTALL_SCRIPT	=	$(INSTALL) -p    -o root -g root  -m  755
yann@1036
    27
-INSTALL_DIR	=	$(INSTALL) -p -d -o root -g root  -m  755
yann@1036
    28
+INSTALL_FILE	=	$(INSTALL) -p    -m  644
yann@1036
    29
+INSTALL_PROGRAM	=	$(INSTALL) -p    -m  755
yann@1036
    30
+INSTALL_SCRIPT	=	$(INSTALL) -p    -m  755
yann@1036
    31
+INSTALL_DIR	=	$(INSTALL) -p -d -m  755
yann@1036
    32
 
yann@1036
    33
 OBJ	=	ltrace.o options.o elf.o output.o read_config_file.o	\
yann@1036
    34
 		execute_program.o wait_for_something.o process_event.o	\
yann@1036
    35
diff -durN ltrace-0.5.orig/configure ltrace-0.5/configure
yann@1036
    36
--- ltrace-0.5.orig/configure	2008-11-04 19:23:00.000000000 +0100
yann@1036
    37
+++ ltrace-0.5/configure	2008-11-04 19:23:05.000000000 +0100
yann@1036
    38
@@ -311,7 +311,7 @@
yann@1036
    39
 # include <unistd.h>
yann@1036
    40
 #endif"
yann@1036
    41
 
yann@1036
    42
-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'
yann@1036
    43
+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'
yann@1036
    44
 ac_subst_files=''
yann@1036
    45
 
yann@1036
    46
 # Initialize some variables set by options.
yann@1036
    47
@@ -1390,7 +1390,7 @@
yann@1036
    48
 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
yann@1036
    49
 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
yann@1036
    50
 
yann@1036
    51
-
yann@1036
    52
+HOST_ARCH="$host_cpu"
yann@1036
    53
 HOST_OS="$host_os"
yann@1036
    54
 case "${HOST_OS}" in
yann@1036
    55
   linux-*) HOST_OS=linux-gnu;;
yann@1036
    56
@@ -4846,6 +4846,7 @@
yann@1036
    57
 s,@host_cpu@,$host_cpu,;t t
yann@1036
    58
 s,@host_vendor@,$host_vendor,;t t
yann@1036
    59
 s,@host_os@,$host_os,;t t
yann@1036
    60
+s,@HOST_ARCH@,$HOST_ARCH,;t t
yann@1036
    61
 s,@HOST_OS@,$HOST_OS,;t t
yann@1036
    62
 s,@CC@,$CC,;t t
yann@1036
    63
 s,@CFLAGS@,$CFLAGS,;t t
yann@1036
    64
diff -durN ltrace-0.5.orig/configure.ac ltrace-0.5/configure.ac
yann@1036
    65
--- ltrace-0.5.orig/configure.ac	2008-11-04 19:23:00.000000000 +0100
yann@1036
    66
+++ ltrace-0.5/configure.ac	2008-11-04 19:23:05.000000000 +0100
yann@1036
    67
@@ -6,10 +6,12 @@
yann@1036
    68
 
yann@1036
    69
 dnl Check host system type
yann@1036
    70
 AC_CANONICAL_HOST
yann@1036
    71
+HOST_ARCH="$host_cpu"
yann@1036
    72
 HOST_OS="$host_os"
yann@1036
    73
 case "${HOST_OS}" in
yann@1036
    74
   linux-*) HOST_OS=linux-gnu;;
yann@1036
    75
 esac
yann@1036
    76
+AC_SUBST(HOST_ARCH)
yann@1036
    77
 AC_SUBST(HOST_OS)
yann@1036
    78
 
yann@1036
    79
 dnl Checks for programs.
yann@1036
    80
diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/Makefile ltrace-0.5/sysdeps/linux-gnu/Makefile
yann@1036
    81
--- ltrace-0.5.orig/sysdeps/linux-gnu/Makefile	2006-02-20 22:44:45.000000000 +0100
yann@1036
    82
+++ ltrace-0.5/sysdeps/linux-gnu/Makefile	2008-11-04 19:23:05.000000000 +0100
yann@1036
    83
@@ -1,6 +1,3 @@
yann@1036
    84
-ARCH		:=	$(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
yann@1036
    85
-			-e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
yann@1036
    86
-
yann@1036
    87
 CPPFLAGS	+=	-I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
yann@1036
    88
 
yann@1036
    89
 OBJ		=	trace.o proc.o breakpoint.o