patches/PDCurses/3.4/mingw32_cross_compile.patch
author Michael Hope <michael.hope@linaro.org>
Thu Sep 29 12:40:42 2011 +1300 (2011-09-29)
changeset 2695 f2495884ca3e
permissions -rw-r--r--
config: add a 'auto' value for the number of parallel jobs

When CT_PARALLEL_JOBS is -1, set the number of parallel jobs to the
number of online CPUs + 1. Update documentation to match.

I find this useful when building in the cloud. You can use the same
.config file and have the build adapt to the number of processors
available. Limited testing shows that NCPUS+1 is faster than NCPUS+0
or NCPUS+2.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
     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