building GDB natively using 'configure' at 'two' levels

Andrew Burgess andrew.burgess@embecosm.com
Wed Sep 8 11:30:02 GMT 2021


* SAIFI <saifi@strikr.io> [2021-09-08 09:47:12 +0000]:

> On Wed, 8 Sep 2021, Andrew Burgess wrote:
> > 
> > Here's how I'd configure and build GDB:
> > 
> > ...
> >  ../src/configure .... all configure options here ....
> > 
> > ....
> > Configure options passed to src/configure will be forwarded to
> > src/gdb/configure automatically.
> > 
> 
> Thanks Andrew !
> 
> in essence, 'sub'-configure options can be specified to the 'top'-configure
> 
> ${SRC}/gdb/configure                \
>       --prefix=/opt/gdb             \
>       --datadir=/opt/gdb/data       \
>       --htmldir=/opt/gdb/doc        \
>       --disable-binutils            \
>       --disable-ld                  \
>       --disable-gold                \
>       --disable-gas                 \
>       --disable-sim                 \
>       --disable-gprof               \
>       --disable-largefile           \
>       --with-gnu-ld                 \
>       --with-expat=no               \
>       --with-python=no              \
>       --with-guile=no               \
>       --with-intel-pt=no            \
>       --with-babeltrace=no
> 
> in other words,
> 
> as an example, given that there are three sub directories with a configure script
>  sub_dir_01
>  sub_dir_02
>  sub_dir_03
> 
> if sub_dir_01 'configure' had options
>   o1
>   o2
>   o3
> and sub_dir_02 'configure' had options
>   o4
>   o5
> then top level 'configure' will apply the 'union' of all the options specified
>   o1
>   o2
>   o3
>   o4
>   o5
> to each sub-directory which has a 'configure' script, ie.
>   sub_dir_01
>   sub_dir_02
>   sub_dir_03
> 
> sorry for being pedantic, just making sure that i understood 'the
> manner of application of options' correctly.

You are correct.

This works for us thanks to AC_DISABLE_OPTION_CHECKING in our top level
configure.ac file.

There's more details about this here:

  https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Option-Checking.html

Because we have a model where we have a top level configure script
recursively invokes the configure script for each sub-module, we need
the top level script not to error if it sees an option it doesn't
understand.

Thanks,
Andrew


More information about the Gdb mailing list