diff mbox

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

Message ID 20170707161627.17524-1-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff July 7, 2017, 4:16 p.m. UTC
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>
---
v1->v2: Remove file name from directory added to DPDK_INCLUDE.
  Use spaces instead of tabs. 

 acinclude.m4 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Darrell Ball July 7, 2017, 4:49 p.m. UTC | #1
I tested my version yesterday, which your version seems to be in sync with today.

Acked-by: Darrell Ball <dlu998@gmail.com>


On 7/7/17, 9:16 AM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:

    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://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_pipermail_ovs-2Ddev_2017-2DMarch_329994.html&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=06Y2r-g-Xtp7GyR-NWubjvPLqKRmofGRVv7dQCxuhUw&s=PdoY4Q8E_c2HluBH1h9t9fjEUS0LVN2ZRmfAK1dyYSE&e= 
    Signed-off-by: Ben Pfaff <blp@ovn.org>
    ---
    v1->v2: Remove file name from directory added to DPDK_INCLUDE.
      Use spaces instead of tabs. 
    
     acinclude.m4 | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/acinclude.m4 b/acinclude.m4
    index 7d7b6832bc2e..82af5ccef2d9 100644
    --- a/acinclude.m4
    +++ b/acinclude.m4
    @@ -206,9 +206,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
    +        fi
             DPDK_LIB_DIR="$with_dpdk/lib"
             ;;
         esac
    -- 
    2.10.2
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=06Y2r-g-Xtp7GyR-NWubjvPLqKRmofGRVv7dQCxuhUw&s=8d2VH-GOcsgNXEVNd-rUWKZYSfYYHk2UMdocMm2W1Tw&e=
Ben Pfaff July 7, 2017, 6:09 p.m. UTC | #2
Thanks.  I applied this to master and branch-2.7.

On Fri, Jul 07, 2017 at 04:49:41PM +0000, Darrell Ball wrote:
> I tested my version yesterday, which your version seems to be in sync with today.
> 
> Acked-by: Darrell Ball <dlu998@gmail.com>
> 
> 
> On 7/7/17, 9:16 AM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:
> 
>     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://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_pipermail_ovs-2Ddev_2017-2DMarch_329994.html&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=06Y2r-g-Xtp7GyR-NWubjvPLqKRmofGRVv7dQCxuhUw&s=PdoY4Q8E_c2HluBH1h9t9fjEUS0LVN2ZRmfAK1dyYSE&e= 
>     Signed-off-by: Ben Pfaff <blp@ovn.org>
>     ---
>     v1->v2: Remove file name from directory added to DPDK_INCLUDE.
>       Use spaces instead of tabs. 
>     
>      acinclude.m4 | 7 ++++---
>      1 file changed, 4 insertions(+), 3 deletions(-)
>     
>     diff --git a/acinclude.m4 b/acinclude.m4
>     index 7d7b6832bc2e..82af5ccef2d9 100644
>     --- a/acinclude.m4
>     +++ b/acinclude.m4
>     @@ -206,9 +206,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
>     +        fi
>              DPDK_LIB_DIR="$with_dpdk/lib"
>              ;;
>          esac
>     -- 
>     2.10.2
>     
>     _______________________________________________
>     dev mailing list
>     dev@openvswitch.org
>     https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=06Y2r-g-Xtp7GyR-NWubjvPLqKRmofGRVv7dQCxuhUw&s=8d2VH-GOcsgNXEVNd-rUWKZYSfYYHk2UMdocMm2W1Tw&e= 
>     
>
diff mbox

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 7d7b6832bc2e..82af5ccef2d9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -206,9 +206,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
+        fi
         DPDK_LIB_DIR="$with_dpdk/lib"
         ;;
     esac