You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bitcoin-core/secp256k1#584
configure: Use CFLAGS_FOR_BUILD when checking native compiler
This fixes a bug where configure would fail or disable static
ecmult tables because it wrongly checks the native compiler using
the target CFLAGS (instead of the native CFLAGS_FOR_BUILD).
Moreover, this commit adds tests to figure out whether the native
compiler supports the warning flags passed during the build, and it
contains a few minor improvements to the code that checks the native
compiler.
AC_MSG_CHECKING([for working native compiler: ${CC_FOR_BUILD}])
227
245
AC_RUN_IFELSE(
228
-
[AC_LANG_PROGRAM([], [return 0])],
246
+
[AC_LANG_PROGRAM([], [])],
229
247
[working_native_cc=yes],
230
248
[working_native_cc=no],[dnl])
231
-
CC="$TEMP_CC"
249
+
250
+
CFLAGS_FOR_BUILD="$CFLAGS"
251
+
252
+
# Restore the environment
232
253
cross_compiling=$save_cross_compiling
254
+
CC="$SAVE_CC"
255
+
CFLAGS="$SAVE_CFLAGS"
256
+
CPPFLAGS="$SAVE_CPPFLAGS"
257
+
LDFLAGS="$SAVE_LDFLAGS"
233
258
234
259
if test x"$working_native_cc" = x"no"; then
260
+
AC_MSG_RESULT([no])
235
261
set_precomp=no
262
+
m4_define([please_set_for_build], [Please set CC_FOR_BUILD, CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD.])
236
263
if test x"$use_ecmult_static_precomputation" = x"yes"; then
237
-
AC_MSG_ERROR([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])
264
+
AC_MSG_ERROR([native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
238
265
else
239
-
AC_MSG_RESULT([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])
266
+
AC_MSG_WARN([Disabling statically generated ecmult table because the native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
0 commit comments