stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.46k stars 1.75k forks source link

configuring for ARM cross-compiler #297

Closed slyt closed 8 years ago

slyt commented 8 years ago

I'm attempting to configure and make the libmodbus library statically using arm-linux-gnueabi-gcc cross-compiler from Linaro. My target has an ARMv7 Processor rev 7 (v7l).

When I execute the following: $ sudo ./configure --host arm-linux-gnueabi-gcc --enable-static

I get the following error: ... checking build system type... x86_64-unknown-linux-gnu checking host system type... Invalid configuration 'arm-linux-gnueabi-gcc': machine 'arm-linux-gnueabi' not recognized configure: error: /bin/bash ./config.sub arm-linux-gnueabi-gcc failed

Is this how I properly specify the host (by specifying my cross-compiler)?

I'm fairly new to cross-compiling especially linking in external libraries so any hints are much appreciated. I've used this as my example to get this far.

murzz commented 8 years ago

This is how I've done it for linaro:

CC=${CMAKE_C_COMPILER} ./autogen.sh &&
CC=${CMAKE_C_COMPILER} ./configure
ac_cv_func_malloc_0_nonnull=yes # fix for undefined reference to `rpl_malloc'
--host=arm
--enable-static
--without-documentation

where CMAKE_C_COMPILER is full path to linaro gcc.

stephane commented 8 years ago

The issue isn't related to libmodbus, The libmodbus mailing list is a better place to discuss it.