patches/ltrace/0.5.3/100-allow-cross-compile.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:09:43 2011 +0200 (2011-05-19)
branch1.11
changeset 2465 5f98b7a90fbc
permissions -rw-r--r--
complibs/ppl: fix 0.11-0.11.2 to compile with --disable-shared

PPL 0.11 (through 0.11.2) had a small bug where it still tried to build
and test its Java interface even when shared libraries are disabled.
Since that's exactly what ct-ng does, it explodes.

This is the patch from the PPL authors (see final link below).

More information can be found in these messages/threads:

Anthony's initial report and analysis with Yann:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00046.html

Ron Flory hit the same problem:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00054.html

Anthony's report to the ppl-devel list:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017450.html

Roberto's reply with a link to the fix in the PPL git repo:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017455.html

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
(transplanted from 139b85d70b623e51f7585e7c64ecb8c6a6cf4567)
     1 This patch is courtesy of OpenEmbedded, by Khem Raj <raj.khem@gmail.com>
     2 
     3 http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b85b779688f0abc389e3c25d06b54de8b86385c1
     4 
     5 Index: ltrace-0.5.3/common.h
     6 ===================================================================
     7 --- ltrace-0.5.3.orig/common.h	2009-10-23 23:13:45.700282578 -0700
     8 +++ ltrace-0.5.3/common.h	2009-10-23 23:14:13.550371553 -0700
     9 @@ -1,3 +1,5 @@
    10 +#ifndef COMMON_H
    11 +#define COMMON_H
    12  #include <sys/types.h>
    13  #include <sys/time.h>
    14  #include <stdio.h>
    15 @@ -251,3 +253,5 @@ extern void * sym2addr(Process *, struct
    16  #if 0				/* not yet */
    17  extern int umoven(Process * proc, void * addr, int len, void * laddr);
    18  #endif
    19 +#endif
    20 +
    21 Index: ltrace-0.5.3/configure
    22 ===================================================================
    23 --- ltrace-0.5.3.orig/configure	2009-10-23 23:13:45.630316494 -0700
    24 +++ ltrace-0.5.3/configure	2009-10-23 23:13:59.672869527 -0700
    25 @@ -30,7 +30,7 @@ int main () {
    26    return cplus_demangle();
    27  }
    28  EOF
    29 -if gcc conftest.c -liberty 2>/dev/null
    30 +if $CC conftest.c -liberty 2>/dev/null
    31  then
    32    HAVE_LIBIBERTY=1
    33    echo "yes"
    34 @@ -48,7 +48,7 @@ int main () {
    35    return __cxa_demangle();
    36  }
    37  EOF
    38 -if gcc conftest.c -lsupc++ 2>/dev/null
    39 +if $CC conftest.c -lsupc++ 2>/dev/null
    40  then
    41    HAVE_LIBSUPC__=1
    42    echo "yes"
    43 @@ -67,7 +67,7 @@ int main () {
    44    return 0;
    45  }
    46  EOF
    47 -if gcc conftest.c 2>/dev/null
    48 +if $CC conftest.c 2>/dev/null
    49  then
    50    HAVE_ELF_C_READ_MMAP=1
    51    echo "yes"
    52 @@ -77,15 +77,12 @@ else
    53  fi
    54  rm -f conftest.c a.out
    55  
    56 -CC=gcc
    57 -CPPFLAGS=' -I /usr/include/libelf'
    58  CFLAGS='-g -O2'
    59  LIBS='-lelf -lsupc++ -liberty '
    60 -INSTALL='/usr/bin/install -c'
    61 +INSTALL='install -c'
    62  iquote='-iquote '
    63  iquoteend=''
    64  
    65 -prefix=/usr/local
    66  sysconfdir='${prefix}/etc'
    67  bindir='${prefix}/bin'
    68  mandir='${prefix}/share/man'
    69 Index: ltrace-0.5.3/debug.h
    70 ===================================================================
    71 --- ltrace-0.5.3.orig/debug.h	2009-10-23 23:13:45.670276809 -0700
    72 +++ ltrace-0.5.3/debug.h	2009-10-23 23:14:26.440319785 -0700
    73 @@ -1,3 +1,5 @@
    74 +#ifndef DEBUG_H
    75 +#define DEBUG_H
    76  #include <features.h>
    77  
    78  /* debug levels:
    79 @@ -14,4 +16,4 @@ void debug_(int level, const char *file,
    80  int xinfdump(long, void *, int);
    81  
    82  # define debug(level, expr...) debug_(level, __FILE__, __LINE__, expr)
    83 -
    84 +#endif