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