diff options
author | Mingrui <972931182@qq.com> | 2021-11-04 09:07:23 +0800 |
---|---|---|
committer | Mingrui <972931182@qq.com> | 2021-11-04 09:07:23 +0800 |
commit | cb0099044b507aa6a537443ab79384e2ea5bdc94 (patch) | |
tree | 1aadfa95231ba712eb3d4116e4a2470acca93d85 | |
parent | d3eb92550ac24e4fce8bea3b8ea47d2bef08dbda (diff) | |
download | tcpdump-cb0099044b507aa6a537443ab79384e2ea5bdc94.tar.gz |
[bugfix]configure: fix error when cross-compile
While cross-compile, ./configure --host=xxx will output:
"checking whether printf(3) supports the z length modifier...
configure: error: in `/${path_to_tcpdump}/tcpdump':"
That is casued by AC_RUN_IFELSE, as describe in
"https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Runtime.html"
, if AC_RUN_IFELSE do not have cross-compile option, configure prints an error message and exits.
Signed-off-by: Mingrui Ren jiladahe1997@gmail.com
-rwxr-xr-x | configure | 10 | ||||
-rw-r--r-- | configure.ac | 3 |
2 files changed, 8 insertions, 5 deletions
@@ -5189,10 +5189,11 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf(3) supports the z length modifier" >&5 $as_echo_n "checking whether printf(3) supports the z length modifier... " >&6; } if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not while cross-compiling" >&5 +$as_echo "not while cross-compiling" >&6; } + + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5223,7 +5224,6 @@ $as_echo "no" >&6; } $as_echo "#define HAVE_NO_PRINTF_Z 1" >>confdefs.h - fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext diff --git a/configure.ac b/configure.ac index 3e6e47e1..12d81294 100644 --- a/configure.ac +++ b/configure.ac @@ -423,6 +423,9 @@ int main() AC_MSG_RESULT(no) AC_DEFINE(HAVE_NO_PRINTF_Z, 1, [Define to 1 if printf(3) does not support the z length modifier.]) + ], + [ + AC_MSG_RESULT(not while cross-compiling) ] ) |