patches/duma/2_5_1/100-cross-compile.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jul 12 08:47:15 2007 +0000 (2007-07-12)
changeset 236 42650dc4e95e
child 369 9258a7c3b84f
permissions -rw-r--r--
Add D.U.M.A., the Electric Fence successor.
     1 diff -dur duma_2_5_1/Makefile duma_2_5_1.orig/Makefile
     2 --- duma_2_5_1/Makefile	2006-06-18 06:02:13.000000000 +0200
     3 +++ duma_2_5_1.orig/Makefile	2007-07-11 17:49:43.000000000 +0200
     4 @@ -98,10 +98,6 @@
     5    LIBS=-lpthread
     6  endif
     7  
     8 -
     9 -CC=gcc
    10 -CXX=g++
    11 -AR=ar
    12  INSTALL=install
    13  
    14  ############################################################
    15 @@ -169,31 +165,31 @@
    16  
    17  createconf: createconf.o
    18  	- rm -f createconf
    19 -	$(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf
    20 +	$(HOSTCC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf
    21  
    22  tstheap: libduma.a tstheap.o
    23  	- rm -f tstheap
    24 -	$(CC) $(CFLAGS) tstheap.o libduma.a -o tstheap $(LIBS)
    25 +	$(HOSTCC) $(CFLAGS) tstheap.o libduma.a -o tstheap $(LIBS)
    26  
    27  dumatest: libduma.a dumatest.o
    28  	- rm -f dumatest
    29 -	$(CC) $(CFLAGS) dumatest.o libduma.a -o dumatest $(LIBS)
    30 +	$(HOSTCC) $(CFLAGS) dumatest.o libduma.a -o dumatest $(LIBS)
    31  
    32  dumatestpp: libduma.a dumatestpp.o dumapp.h
    33  	- rm -f dumatestpp
    34 -	$(CXX) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp $(LIBS)
    35 +	$(HOSTCXX) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp $(LIBS)
    36  
    37  testoperators: libduma.a testoperators.o dumapp.h
    38  	- rm -f testoperators
    39 -	$(CXX) $(CPPFLAGS) testoperators.o libduma.a -o testoperators $(LIBS)
    40 +	$(HOSTCXX) $(CPPFLAGS) testoperators.o libduma.a -o testoperators $(LIBS)
    41  
    42  tstheap_so: tstheap_so.o
    43  	- rm -f tstheap_so
    44 -	$(CC) $(CFLAGS) tstheap_so.o -o tstheap_so $(LIBS)
    45 +	$(HOSTCC) $(CFLAGS) tstheap_so.o -o tstheap_so $(LIBS)
    46  
    47  dumatestpp_so: dumatestpp_so.o
    48  	- rm -f dumatestpp_so
    49 -	$(CXX) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so $(LIBS)
    50 +	$(HOSTCXX) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so $(LIBS)
    51  
    52  
    53  $(OBJECTS) tstheap.o dumatest.o dumatestpp.o: duma.h
    54 @@ -211,7 +207,7 @@
    55  # define rules how to build objects for createconf
    56  #
    57  createconf.o:
    58 -	$(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
    59 +	$(HOSTCC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
    60  
    61  
    62  #
    63 @@ -230,13 +226,6 @@
    64  print_so.o:	print.c print.h
    65  	$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c print.c -o $@
    66  
    67 -# DUMA_SO_OPTIONS needed cause duma.h is included explicitly
    68 -tstheap_so.o:
    69 -	$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tstheap.c -o $@
    70 -
    71 -dumatestpp_so.o:
    72 -	$(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumatestpp.cpp -o $@
    73 -
    74  #
    75  # define rules how to build objects for static library
    76  #
    77 @@ -259,17 +248,23 @@
    78  #
    79  
    80  dumatest.o:	dumatest.c duma.h duma_config.h
    81 -	$(CC) $(CFLAGS) -c dumatest.c -o $@
    82 +	$(HOSTCC) $(CFLAGS) -c dumatest.c -o $@
    83  
    84  dumatestpp.o:	dumatestpp.cpp duma.h dumapp.h duma_config.h
    85 -	$(CXX) $(CPPFLAGS) -c dumatestpp.cpp -o $@
    86 +	$(HOSTCXX) $(CPPFLAGS) -c dumatestpp.cpp -o $@
    87  
    88  tstheap.o:	tstheap.c duma.h duma_config.h
    89 -	$(CC) $(CFLAGS) -c tstheap.c -o $@
    90 +	$(HOSTCC) $(CFLAGS) -c tstheap.c -o $@
    91  
    92  testoperators.o:	testoperators.cpp duma.h dumapp.h duma_config.h
    93 -	$(CXX) $(CPPFLAGS) -c testoperators.cpp -o $@
    94 +	$(HOSTCXX) $(CPPFLAGS) -c testoperators.cpp -o $@
    95 +
    96 +# DUMA_SO_OPTIONS needed cause duma.h is included explicitly
    97 +tstheap_so.o:
    98 +	$(HOSTCC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tstheap.c -o $@
    99  
   100 +dumatestpp_so.o:
   101 +	$(HOSTCXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumatestpp.cpp -o $@
   102  
   103  #
   104  # default rules
   105 @@ -280,5 +275,3 @@
   106  #.cpp.o:
   107  #	$(CXX) $(CPPFLAGS) -c $< -o $@
   108  #
   109 -
   110 -