This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cross compiling snort using ptxdist results in INADDR_NONE configure error

Hello,

I am not sure whether this is a right but I thought to give it a go as I am cross compiling snort for an ARM-based system. 

I am very new to cross-compilation using ptxdist tool. I am using ptxdist version 2013.03.0 and trying to build snort 2.9.11.1 for arm cortex with linux kernel 4.9.47. However, when I run the ptxdist prepare snort command, it fails with the following error:

checking for strlcat... no
checking for strerror... yes
checking for vswprintf... yes
checking for wprintf... yes
checking for snprintf... yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long int... 4
checking size of long long int... 8
checking size of unsigned int... 4
checking size of unsigned long int... 4
checking size of unsigned long long int... 8
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for u_int64_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for boolean... no
checking for INADDR_NONE... configure: error: in `/home/user/snort-2.9.11.1':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.


I have checked the configure.in file. It tries to test the inet_addr() function with INADDR_NONE but fails. Following are the contents of snort's configure.in file:

# In case INADDR_NONE is not defined (like on Solaris)
have_inaddr_none="no"
AC_MSG_CHECKING([for INADDR_NONE])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
]],
[[
**if (inet_addr("10,5,2") == INADDR_NONE);**
return 0;
]])],
[have_inaddr_none="yes"],
[have_inaddr_none="no"])
AC_MSG_RESULT($have_inaddr_none)
if test "x$have_inaddr_none" = "xno"; then
AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition])
fi


Is this the case of missing linux kernel headers in the cross-compilation toolkit or configure settings? I searched for the definition of INADDR_NONE in linux 4.9.47 source code and found it in

...linux.4.9.47/include/uapi/linux/in.h

Can anyone help me get around this error?

Any help would be appreciated.

Parents
  • checking for INADDR_NONE... configure: error: in `/home/user/snort-2.9.11.1':
    > configure: error: cannot run test program while cross compiling
    > See `config.log' for more details.

    What is the information in your "config.log"? It looks more likely to be a pure software configuration issue, not a Arm architecture specific issue.

Reply
  • checking for INADDR_NONE... configure: error: in `/home/user/snort-2.9.11.1':
    > configure: error: cannot run test program while cross compiling
    > See `config.log' for more details.

    What is the information in your "config.log"? It looks more likely to be a pure software configuration issue, not a Arm architecture specific issue.

Children
No data