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
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), and
similar for CPPFLAGS and LDFLAGS.
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}])
176
194
AC_RUN_IFELSE(
177
-
[AC_LANG_PROGRAM([], [return 0])],
195
+
[AC_LANG_PROGRAM([], [])],
178
196
[working_native_cc=yes],
179
197
[working_native_cc=no],[dnl])
180
-
CC="$TEMP_CC"
198
+
199
+
CFLAGS_FOR_BUILD="$CFLAGS"
200
+
201
+
# Restore the environment
181
202
cross_compiling=$save_cross_compiling
203
+
CC="$SAVE_CC"
204
+
CFLAGS="$SAVE_CFLAGS"
205
+
CPPFLAGS="$SAVE_CPPFLAGS"
206
+
LDFLAGS="$SAVE_LDFLAGS"
182
207
183
208
if test x"$working_native_cc" = x"no"; then
209
+
AC_MSG_RESULT([no])
184
210
set_precomp=no
211
+
m4_define([please_set_for_build], [Please set CC_FOR_BUILD, CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD.])
185
212
if test x"$use_ecmult_static_precomputation" = x"yes"; then
186
-
AC_MSG_ERROR([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])
213
+
AC_MSG_ERROR([native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
187
214
else
188
-
AC_MSG_RESULT([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])
215
+
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