]> The Tcpdump Group git mirrors - tcpdump/commitdiff
[bugfix]configure: fix error when cross-compile 954/head
authorMingrui <[email protected]>
Thu, 4 Nov 2021 01:07:23 +0000 (09:07 +0800)
committerMingrui <[email protected]>
Thu, 4 Nov 2021 01:07:23 +0000 (09:07 +0800)
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 [email protected]
configure
configure.ac

index 9650b89aed3ad3bacfb9579f3bb7af1c62141e36..ccc44d534cf4581d9dcce589895a78433c51b85b 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index 3e6e47e148e987b21a2ec3588238415fc3243f30..12d812941ef00c969bd28fa6c8df3217fb2b7ba6 100644 (file)
@@ -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)
     ]
 )