[ovs-dev] configure: Fix check for rte_config.h to handle cross-compilation.

Submitted by Ben Pfaff on April 15, 2017, 4:14 a.m.

Details

Message ID 20170415041455.4680-1-blp@ovn.org
State New
Headers show

Commit Message

Ben Pfaff April 15, 2017, 4:14 a.m.
The check for rte_config.h in acinclude.m4 used AC_CHECK_FILE, but this
macro is intended to check for a file on the host system, not the build
system, which means that it fails unconditionally in a cross-compilation
environment.  However, the intended check here is for a header file,
which is part of the build system.  To check for part of the build system,
we can just use "test", so this commit makes that change.

Reported-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329994.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 acinclude.m4 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/acinclude.m4 b/acinclude.m4
index 744d8f89525c..842469455914 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -180,9 +180,10 @@  AC_DEFUN([OVS_CHECK_DPDK], [
         DPDK_INCLUDE="$with_dpdk/include"
         # If 'with_dpdk' is passed install directory, point to headers
         # installed in $DESTDIR/$prefix/include/dpdk
-        AC_CHECK_FILE([$DPDK_INCLUDE/rte_config.h], [],
-                      [AC_CHECK_FILE([$DPDK_INCLUDE/dpdk/rte_config.h],
-                                     [DPDK_INCLUDE=$DPDK_INCLUDE/dpdk], [])])
+	if test ! -e "$DPDK_INCLUDE/rte_config.h" && \
+	   test -e "$DPDK_INCLUDE/dpdk/rte_config.h"; then
+	   DPDK_INCLUDE=$DPDK_INCLUDE/dpdk/rte_config.h
+	fi
         DPDK_LIB_DIR="$with_dpdk/lib"
         ;;
     esac