aboutsummaryrefslogtreecommitdiff
blob: 63e37f553e02cd96bae317b822a35ac6c1a060dc (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -86,6 +86,7 @@ SANITIZER_LDFLAGS = @lto_ldflags@ @ubsan_ldflags@ @addrsan_ldflags@ @threadsan_l
 
 CC = @CC@
 BUILD_CC = @BUILD_CC@
+BUILD_CFLAGS = @BUILD_CFLAGS@
 CFLAGS = @CFLAGS@
 CFLAGS_SHLIB = @CFLAGS_SHLIB@
 CFLAGS_STLIB = @CFLAGS_STLIB@
--- a/configure
+++ b/configure
@@ -12398,14 +12398,12 @@ $as_echo "$as_me: WARNING:
     esac
 fi
 
-
-# See if we need a separate native compiler.
-if test $cross_compiling = no; then
-  BUILD_CC="$CC"
-
-else
-  for ac_prog in gcc cc
-do
+if test "${BUILD_CC+set}" != "set"; then
+    if test $cross_compiling = no; then
+      BUILD_CC="$CC"
+    else
+      for ac_prog in gcc cc
+  do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -12446,6 +12444,16 @@ fi
   test -n "$BUILD_CC" && break
 done
 
+    fi
+fi
+
+if test "${BUILD_CFLAGS+set}" != "set"; then
+    if test $cross_compiling = no; then
+      BUILD_CFLAGS="$CFLAGS"
+    else
+      BUILD_CFLAGS="-g -O2"
+    fi
+
 fi
 for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	attr/xattr.h 	linux/falloc.h 	linux/fd.h 	linux/fsmap.h 	linux/major.h 	linux/loop.h 	linux/types.h 	net/if_dl.h 	netinet/in.h 	sys/acl.h 	sys/disklabel.h 	sys/disk.h 	sys/file.h 	sys/ioctl.h 	sys/key.h 	sys/mkdev.h 	sys/mman.h 	sys/mount.h 	sys/prctl.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysctl.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h 	sys/xattr.h
 do :
--- a/configure.ac
+++ b/configure.ac
@@ -910,13 +910,24 @@ else
 fi
 AC_SUBST(MAKEINFO)
 AC_PROG_INSTALL
-# See if we need a separate native compiler.
-if test $cross_compiling = no; then
-  BUILD_CC="$CC"
-  AC_SUBST(BUILD_CC)
-else
-  AC_CHECK_PROGS(BUILD_CC, gcc cc)
+
+AC_ARG_VAR(BUILD_CC, [C compiler for build tools])
+if test "${BUILD_CC+set}" != "set"; then
+    if test $cross_compiling = no; then
+      BUILD_CC="$CC"
+    else
+      AC_CHECK_PROGS(BUILD_CC, gcc cc)
+    fi
+fi
+AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools])
+if test "${BUILD_CFLAGS+set}" != "set"; then
+    if test $cross_compiling = no; then
+      BUILD_CFLAGS="$CFLAGS"
+    else
+      BUILD_CFLAGS="-g -O2"
+    fi
 fi
+
 AC_CHECK_HEADERS(m4_flatten([
 	dirent.h
 	errno.h