aboutsummaryrefslogtreecommitdiff
blob: 1c1b8f27b2336848bf98c00c5e55dfa805347aa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -ruN libatasmart-0.17/Makefile.am libatasmart-0.17.new/Makefile.am
--- libatasmart-0.17/Makefile.am	2009-10-26 19:26:55.000000000 -0700
+++ libatasmart-0.17.new/Makefile.am	2010-05-02 19:56:01.000000000 -0700
@@ -89,8 +89,8 @@
 libatasmart_la_CFLAGS = \
 	$(LIBUDEV_CFLAGS)
 
-strpool_SOURCES = \
-	strpool.c
+strpool: strpool.c
+	$(CC_FOR_BUILD) strpool.c -o $(top_builddir)/strpool
 
 BUILT_SOURCES = \
 	atasmart.strpool.c
diff -ruN libatasmart-0.17/configure.ac libatasmart-0.17.new/configure.ac
--- libatasmart-0.17/configure.ac	2009-10-26 19:12:03.000000000 -0700
+++ libatasmart-0.17.new/configure.ac	2010-05-02 19:55:21.000000000 -0700
@@ -55,6 +55,19 @@
 AC_PROG_CXX
 
 # GCC flags
+dnl Get the host compiler if cross-compiling
+dnl
+AM_CONDITIONAL(CROSS_COMPILING, [ test $cross_compiling = yes ])
+AC_MSG_CHECKING([for CC_FOR_BUILD])
+if test "x${CC_FOR_BUILD+set}" != "xset" ; then
+  if test "x$cross_compiling" = "xyes" ; then
+    CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
+  else
+    CC_FOR_BUILD=${CC}
+  fi
+fi
+AC_MSG_RESULT([$CC_FOR_BUILD])
+AC_SUBST(CC_FOR_BUILD)
 
 test_gcc_flag() {
     AC_LANG_CONFTEST([int main(int argc, char*argv[]) {}])