Cross-compilation how-to

To run the configure script for cross-compilation:

Launch the configure script as follows:

CC=${CROSS_COMPILER_PATH}/bin/gcc ./configure --prefix=/tmp/123 --host=<ARCH>
where <ARCH> is the target architecture, e.g. arm-linux-gnueabihf.

Alternatively, edit configure and find this line:

cross_compiling=no
Change no to yes. Note that in the configure script, one can also find the following code snippet:
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi
Anyway, make sure cross_compiling is set to no.

Autoconf creation how-to

Commands to create configure and Makefile.in:
  1. $ aclocal
    From configure.in and Makefile.am, it generates aclocal.m4.
  2. $ autoconf -v -f
    It generates configure script.
  3. $ touch AUTHORS NEWS README ChangeLog
  4. Above files must be present or automake will complain.
  5. $ libtoolize -v -f
  6. This copies/links a few support scripts, including ltmain.sh
  7. $ autoheader -v -f
  8. This creates acconfig.h.in
  9. $ automake -a -f
  10. This creates Makefile.in
All done!

Another simpler way to create configure and Makefile.in

$ autoreconf -vif