[Pool-dev] Error while cross-compiling ntp using buildroot for MIPS

Dave Hart hart at ntp.org
Fri Mar 16 17:42:13 UTC 2012


On Thu, Mar 15, 2012 at 05:22, Raj Kumar <raj_kumar_sh at yahoo.com> wrote:
> I am trying to cross compile ntp-4.2.6p3  using  buildroot-2009.02
> (mipsel-linux-gcc) for MIPS processor.

You might be best served bringing this up on mailing lists populated
by buildroot maintainers.  I'm curious why you're using 4.2.6p3
instead of 4.2.6p5 as well.

> On linux-2.6.32-21 based machine ntp package cross compiles fine.
> But  I  am getting error while cross compiling the same package using the
> same version of  buildroot on 2.6.35-28 based PC.
>
>
> Case 1  (Everything works fine)
> ---------
> Build root version :- buildroot-2009.02 (mipsel-linux-gcc)
> Build Machine Linux version :-  2.6.32-21-generic #32-Ubuntu SMP
> Target Linux version :-  linux-2.6.29.2
>
> NTP version :-  ntp-4.2.6p3
> automake (GNU automake) 1.11.1
> aclocal (GNU automake) 1.11.1
>
>
> Case 2  (  gives compilation error  )
> --------------------------------------
> Build root version :- buildroot-2009.02 (mipsel-linux-gcc)
> Build Machine Linux version :-   2.6.35-28-generic #50-Ubuntu SMP
> Target Linux version :-  linux-2.6.29.2
>
> NTP version :-  ntp-4.2.6p3
> automake (GNU automake) 1.11.1
> aclocal (GNU automake) 1.11.1
> libtoolize (GNU libtool) 2.2.6b
>
> Just for testing i compiled ntp using gcc, on the same machine and the
> package compiles fine.
>
> So problem happens only when cross compiling using buildroot.
>
> When i cross-compiled first time i got following error
> ---------------------------------------------------------------------------------
> make[2]: Entering directory
> `/home/ws/mint_ubuws2/test-depot/test/main/src/external/ntp-4.2.6p3'
> CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh
> /home/ws/mint_ubuws2/test-depot/test/main/src/external/ntp-4.2.6p3/missing
> --run aclocal-1.11 -I m4 -I sntp/libopts/m4
>  cd . && /bin/sh
> /home/ws/mint_ubuws2/test-depot/test/main/src/external/ntp-4.2.6p3/missing
> --run automake-1.11 --foreign
> ElectricFence/Makefile.am:11: library used but `RANLIB' is undefined
> ElectricFence/Makefile.am:11:   The usual way to define `RANLIB' is to add
> `AC_PROG_RANLIB'
> ElectricFence/Makefile.am:11:   to `configure.ac' and run `autoconf' again.
> libntp/Makefile.am:7: library used but `RANLIB' is undefined
> libntp/Makefile.am:7:   The usual way to define `RANLIB' is to add
> `AC_PROG_RANLIB'
> libntp/Makefile.am:7:   to `configure.ac' and run `autoconf' again.
> libparse/Makefile.am:6: library used but `RANLIB' is undefined
> libparse/Makefile.am:6:   The usual way to define `RANLIB' is to add
> `AC_PROG_RANLIB'
> libparse/Makefile.am:6:   to `configure.ac' and run `autoconf' again.
> ntpd/Makefile.am:10: library used but `RANLIB' is undefined
> ntpd/Makefile.am:10:   The usual way to define `RANLIB' is to add
> `AC_PROG_RANLIB'
> ntpd/Makefile.am:10:   to `configure.ac' and run `autoconf' again.
> ntpq/Makefile.am:18: library used but `RANLIB' is undefined
> ntpq/Makefile.am:18:   The usual way to define `RANLIB' is to add
> `AC_PROG_RANLIB'
> ntpq/Makefile.am:18:   to `configure.ac' and run `autoconf' again.
> --------------------------------------------------------------------------------------
>
> Then i added  AC_PROG_RANLIB in configure.ac and recompiled the package .

It might be worthwhile to file a bug at http://bugs.ntp.org asking for
AC_PROG_RANLIB to be added to the stock configure scripts.  For
non-cross builds, I'm not aware of it ever being needed, but I notice
buildroot is setting RANLIB in the configure invocation, and your
experience suggests it can help in that case.

> Then i hit the following error
>
> ----------------------------------------------------------------------------------------
> libopts/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
> libopts/Makefile.am:4:   The usual way to define `LIBTOOL' is to add
> `AC_PROG_LIBTOOL'
> libopts/Makefile.am:4:   to `configure.ac' and run `aclocal' and `autoconf'
> again.
> libopts/Makefile.am:4:   If `AC_PROG_LIBTOOL' is in `configure.ac', make
> sure
> libopts/Makefile.am:4:   its definition is in aclocal's search path.
> ---------------------------------------------------------------------------------------
> I have added AC_PROG_LIBTOOL in configure.ac and recompiled but gave the
> same error.

I think you'll find AC_PROG_LIBTOOL or equivalent is already being
invoked, and the real problem is you don't have the libtool *.m4 files
where aclocal can find them.  From your attached log:

./configure: line 4815: AC_DISABLE_SHARED: command not found
./configure: line 7922: AC_PROG_LIBTOOL: command not found

Those macros should have been expanded in configure.  The fact they
remain to trigger errors validates the theory that your libtool *.m4
files are not being found by autotools.

Good luck,
Dave Hart


More information about the pool-dev mailing list