Bug 6598 - Yocto Project ADT Autotools: autogen.sh fails with parameters
Summary: Yocto Project ADT Autotools: autogen.sh fails with parameters
Status: VERIFIED FIXED
Alias: None
Product: Eclipse Plugin
Classification: Yocto Project Subprojects
Component: eclipse-plugin (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9
Assignee: Todor Minchev
QA Contact: Valentin Hangan
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-07-29 13:32 UTC by Peter Saunderson
Modified: 2015-10-26 12:24 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Saunderson 2014-07-29 13:32:28 UTC
I use eclipse with the Yocto Daisy release
I also build the software from the command prompt using autogen.sh

Building from the command prompt with autogen.sh fails because of a bug in autogen.sh described below.

A suggestion for addition to the documentation http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html#autotools-based-projects

In Eclipse Properties->Autotools->Configure Settings shows the command parameters needed to run autogen.sh from the command prompt.

./autogen.sh CFLAGS=" -g -O0  -I~/Yocto/build --sysroot=~/local/poky/sysroots/armv7at2hf-vfp-neon-poky-linux-gnueabi" CXXFLAGS=" -g -O0  --sysroot=~/local/poky/sysroots/armv7at2hf-vfp-neon-poky-linux-gnueabi" LDFLAGS=" --sysroot=~/local/poky/sysroots/armv7at2hf-vfp-neon-poky-linux-gnueabi" CPPFLAGS=" --sysroot=~/local/poky/sysroots/armv7at2hf-vfp-neon-poky-linux-gnueabi" configure --with-libtool-sysroot=~/local/poky/sysroots/armv7at2hf-vfp-neon-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --target=arm-poky-linux-gnueabi

The above command fails because autogen.sh does not pass the $CONFIGURE_FLAGS correctly to ./configure.  The parameters ($@) should be surrounded by double quotes ("$@") - ie autogen.sh should contain:
#! /bin/sh
[ -e config.cache ] && rm -f config.cache

libtoolize --automake
aclocal ${OECORE_ACLOCAL_OPTS}
autoconf
autoheader
automake -a
./configure "$@"
exit

The README file created in the project folder contains instructions that are not complete:
-----------------------------------------------------------------------------
 Build
-----------------------------------------------------------------------------
$ ./autogen.sh $CONFIGURE_FLAGS
$ make

This template README file should include details of how to get the $CONFIGURE_FLAGS (from Eclipse Properties->Autotools->Configure Settings) or could include the $CONFIGURE_FLAGS that are already auto included in the eclipse setup.

The documentation at http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html should be updated to include these details.  The documentation does not describe what $CONFIGURE_FLAGS are.
Comment 1 Jessica 2014-12-04 00:14:48 UTC
Hi Randy,

Can you work with Scott on updating the doc?

Thanks,
Jessica
Comment 2 Randy Witt 2015-07-22 19:53:16 UTC
Todor, this is the bug I spoke to you about. I believe the user hadn't source the setup  script. But I wasn't sure if there was command line access in Eclipse that should work in this scenario.
Comment 3 Todor Minchev 2015-08-03 20:49:45 UTC
In order to build from the command line you will need to setup your environment first by sourcing the environment setup script. This can be found in the directory where the toolchain was extracted. The script will be called environment-setup-XXX-poky-linux where XXX is the architecture of your target.

Please check the documentation here (chapter 5.1)
http://www.yoctoproject.org/docs/1.6/adt-manual/adt-manual.html
Comment 4 Valentin Hangan 2015-10-26 12:24:05 UTC
Check in  Eclipse Properties->Autotools->Configure Settings  the command parameters needed to run autogen.sh from the command prompt.
I source the environment setup script and i run autogen.sh with specific parameters for QEMU:
./autogen.sh CFLAGS=" -g -O0  --sysroot=/home/valentin/test-yocto/qemux86" CXXFLAGS=" -g -O0  --sysroot=/home/valentin/test-yocto/qemux86" LDFLAGS=" --sysroot=/home/valentin/test-yocto/qemux86" CPPFLAGS=" --sysroot=/home/valentin/test-yocto/qemux86" configure --with-libtool-sysroot=/home/valentin/test-yocto/qemux86 --host=i586-poky-linux --build=x86_64-linux --target=i586-poky-linux

Message from cmd : autoreconf: Leaving directory `.'and $CONFIGURE_FLAGS was correctly done.

Verified on:

OS: Fedora 22
Eclipse-version: Mars
Commit: 1d179ddcbd1983bf7bcfe98efdcbb186bdccca4f