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... nochecking for strerror... yeschecking for vswprintf... yeschecking for wprintf... yeschecking for snprintf... yeschecking size of char... 1checking size of short... 2checking size of int... 4checking size of long int... 4checking size of long long int... 8checking size of unsigned int... 4checking size of unsigned long int... 4checking size of unsigned long long int... 8checking for u_int8_t... yeschecking for u_int16_t... yeschecking for u_int32_t... yeschecking for u_int64_t... yeschecking for uint8_t... yeschecking for uint16_t... yeschecking for uint32_t... yeschecking for uint64_t... yeschecking for int8_t... yeschecking for int16_t... yeschecking for int32_t... yeschecking for int64_t... yeschecking for boolean... nochecking for INADDR_NONE... configure: error: in `/home/user/snort-2.9.11.1':configure: error: cannot run test program while cross compilingSee `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"; thenAC_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.
> 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.