patches/PDCurses/3.4/mingw32_cross_compile.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
branch1.11
changeset 2464 4b844234d214
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
(transplanted from ec30b191f0e3fe9bc73199f0bcb8d789db17aa92)
     1 --- PDCurses-3.4.orig/win32/mingwin32.mak	2009-11-02 13:50:11.000000000 +0100
     2 +++ PDCurses-3.4/win32/mingwin32.mak	2009-11-02 13:53:43.000000000 +0100
     3 @@ -18,7 +18,7 @@
     4 
     5  PDCURSES_WIN_H	= $(osdir)/pdcwin.h
     6 
     7 -CC		= gcc
     8 +CC		= $(CROSS_COMPILE)gcc
     9 
    10  ifeq ($(DEBUG),Y)
    11  	CFLAGS  = -g -Wall -DPDCDEBUG
    12 @@ -30,8 +30,8 @@
    13 
    14  CFLAGS += -I$(PDCURSES_SRCDIR)
    15 
    16 -BASEDEF		= $(PDCURSES_SRCDIR)\exp-base.def
    17 -WIDEDEF		= $(PDCURSES_SRCDIR)\exp-wide.def
    18 +BASEDEF		= $(PDCURSES_SRCDIR)/exp-base.def
    19 +WIDEDEF		= $(PDCURSES_SRCDIR)/exp-wide.def
    20 
    21  DEFDEPS		= $(BASEDEF)
    22 
    23 @@ -46,17 +46,17 @@
    24 
    25  DEFFILE		= pdcurses.def
    26 
    27 -LINK		= gcc
    28 +LINK		= $(CROSS_COMPILE)gcc
    29 
    30  ifeq ($(DLL),Y)
    31  	CFLAGS += -DPDC_DLL_BUILD
    32 -	LIBEXE = gcc $(DEFFILE)
    33 +	LIBEXE = $(CROSS_COMPILE)gcc $(DEFFILE)
    34  	LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
    35  	LIBCURSES = pdcurses.dll
    36  	LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE)
    37  	CLEAN = $(LIBCURSES) *.a $(DEFFILE)
    38  else
    39 -	LIBEXE = ar
    40 +	LIBEXE = $(CROSS_COMPILE)ar
    41  	LIBFLAGS = rcv
    42  	LIBCURSES = pdcurses.a
    43  	LIBDEPS = $(LIBOBJS) $(PDCOBJS)
    44 @@ -70,24 +70,24 @@
    45  libs:	$(LIBCURSES)
    46 
    47  clean:
    48 -	-del *.o
    49 -	-del *.exe
    50 -	-del $(CLEAN)
    51 +	-rm *.o
    52 +	-rm *.exe
    53 +	-rm $(CLEAN)
    54 
    55  demos:	$(DEMOS)
    56 -	strip *.exe
    57 +	$(CROSS_COMPILE)strip *.exe
    58 
    59  $(DEFFILE): $(DEFDEPS)
    60  	echo LIBRARY pdcurses > $@
    61  	echo EXPORTS >> $@
    62 -	type $(BASEDEF) >> $@
    63 +	cat $(BASEDEF) >> $@
    64  ifeq ($(WIDE),Y)
    65 -	type $(WIDEDEF) >> $@
    66 +	cat $(WIDEDEF) >> $@
    67  endif
    68 
    69  $(LIBCURSES) : $(LIBDEPS)
    70  	$(LIBEXE) $(LIBFLAGS) $@ $?
    71 -	-copy pdcurses.a panel.a
    72 +	-cp pdcurses.a panel.a
    73 
    74  $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
    75  $(PDCOBJS) : $(PDCURSES_WIN_H)
    76 --- PDCurses-3.4.orig/curses.h	2009-11-03 14:12:18.000000000 +0100
    77 +++ PDCurses-3.4./curses.h	2009-11-03 14:14:09.000000000 +0100
    78 @@ -82,7 +82,9 @@
    79   *
    80   */
    81 
    82 +#ifndef __bool_true_false_are_defined
    83  typedef unsigned char bool;    /* PDCurses Boolean type */
    84 +#endif
    85 
    86  #ifdef CHTYPE_LONG
    87  # if _LP64