Re: recursive configure
Jack Andrews <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CAJvHTNwi-TD7dKVP2MR-BZOOb+EJXQdJBueL9bEC1z7Zkxdh=Q@mail.gmail.com> |
to answer my own question,
in configure.ac, noconfigdirs gets target-newlib and target-libgloss:
i[[3456789]]86-*-linux*)
# This section makes it possible to build newlib natively on linux.
# If we are using a cross compiler then don't configure newlib.
if test x${is_cross_compiler} != xno ; then
noconfigdirs="$noconfigdirs target-newlib"
fi
noconfigdirs="$noconfigdirs target-libgloss"
then, later in configure.ac notsupp is set based on noconfigdirs and
echo "*** This configuration is not supported in the following
subdirectories:" 1>&2
echo " ${notsupp}" 1>&2
echo " (Any other directories should still work fine.)" 1>&2
On Fri, 22 Nov 2024 at 17:14, Jack Andrews <[email protected]> wrote:
> On Thu, 21 Nov 2024 at 09:38, Andrew Pinski <[email protected]> wrote:
> > So the toplevel configure only configures the toplevel makefile
> > and then when invoking make, it will do the configures then.
>
> Thank you for your reply, Andrew - much appreciated.
>
> Now I understand the stages of configure - make - configure I'm
> getting somewhere. But I'm stuck again. To illustrate my problem,
> I try configuring for i386 linux and I get an error saying
>
> *** This configuration is not supported in the following subdirectories:
> target-newlib target-libgloss
>
> There doesn't seem to be any context to the error message.
>
> This is what I did:
>
> $ cat a.sh
> ver="4.4.0.20231231"
> pkg=newlib-$ver
> tar=$pkg.tar.gz
>
> if [ ! -e $tar ]; then
> wget ftp://sourceware.org/pub/newlib/$tar
> fi
> tar xf $tar
> mkdir -p build; cd build; rm -rf *
> ../$pkg/configure --with-newlib \
> --target=i386-pc-linux-gnu \
> --prefix=/tmp
> $ bash a.sh >/dev/null
> *** This configuration is not supported in the following subdirectories:
> target-newlib target-libgloss
> (Any other directories should still work fine.)
>
> why is my configuration not supported? only the other day, I was
> getting makefiles for newlib, so i don't know what is going on now.
> i check the config.log but there's no reason i can see for this error
>
> thanks in advance for any pointers
> jack
>
> the full output of this configure is
>
> $ bash a.sh
> checking build system type... x86_64-pc-linux-gnu
> checking host system type... x86_64-pc-linux-gnu
> checking target system type... i386-pc-linux-gnu
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln works... yes
> checking whether ln -s works... yes
> checking for a sed that does not truncate output... /usr/bin/sed
> checking for gawk... gawk
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
> checking for gnatbind... gnatbind
> checking for gnatmake... gnatmake
> checking whether compiler driver understands Ada... no
> checking how to compare bootstrapped objects... cmp --ignore-initial=16
> $$f1 $$f2
> checking for objdir... .libs
> checking for isl 0.16, 0.15, or deprecated 0.14... yes
> checking for isl 0.16 or 0.15... yes
> *** This configuration is not supported in the following subdirectories:
> target-newlib target-libgloss
> (Any other directories should still work fine.)
> checking for default BUILD_CONFIG...
> checking for --enable-vtable-verify... no
> checking for bison... no
> checking for byacc... no
> checking for yacc... no
> checking for bison... no
> checking for gm4... no
> checking for gnum4... no
> checking for m4... m4
> checking for flex... no
> checking for lex... no
> checking for flex... no
> checking for makeinfo... makeinfo
> checking for expect... no
> checking for runtest... no
> checking for ar... ar
> checking for as... as
> checking for dlltool... no
> checking for ld... ld
> checking for lipo... no
> checking for nm... nm
> checking for ranlib... ranlib
> checking for strip... strip
> checking for windres... no
> checking for windmc... no
> checking for objcopy... objcopy
> checking for objdump... objdump
> checking for readelf... readelf
> checking for -plugin option... --plugin
> /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so
> checking for i386-pc-linux-gnu-cc... no
> checking for i386-pc-linux-gnu-gcc... no
> checking for i386-pc-linux-gnu-c++... no
> checking for i386-pc-linux-gnu-g++... no
> checking for i386-pc-linux-gnu-cxx... no
> checking for i386-pc-linux-gnu-gxx... no
> checking for i386-pc-linux-gnu-gcc... no
> checking for i386-pc-linux-gnu-gcj... no
> checking for i386-pc-linux-gnu-gfortran... no
> checking for i386-pc-linux-gnu-gccgo... no
> checking for i386-pc-linux-gnu-ar... no
> checking for i386-pc-linux-gnu-as... no
> checking for i386-pc-linux-gnu-dlltool... no
> checking for i386-pc-linux-gnu-ld... no
> checking for i386-pc-linux-gnu-lipo... no
> checking for i386-pc-linux-gnu-nm... no
> checking for i386-pc-linux-gnu-objcopy... no
> checking for i386-pc-linux-gnu-objdump... no
> checking for i386-pc-linux-gnu-ranlib... no
> checking for i386-pc-linux-gnu-readelf... no
> checking for i386-pc-linux-gnu-strip... no
> checking for i386-pc-linux-gnu-windres... no
> checking for i386-pc-linux-gnu-windmc... no
> checking where to find the target ar... pre-installed
> checking where to find the target as... pre-installed
> checking where to find the target cc... pre-installed
> checking where to find the target c++... pre-installed
> checking where to find the target c++ for libstdc++... pre-installed
> checking where to find the target dlltool... pre-installed
> checking where to find the target gcc... pre-installed
> checking where to find the target gcj... pre-installed
> checking where to find the target gfortran... pre-installed
> checking where to find the target gccgo... pre-installed
> checking where to find the target ld... pre-installed
> checking where to find the target lipo... pre-installed
> checking where to find the target nm... pre-installed
> checking where to find the target objcopy... pre-installed
> checking where to find the target objdump... pre-installed
> checking where to find the target ranlib... pre-installed
> checking where to find the target readelf... pre-installed
> checking where to find the target strip... pre-installed
> checking where to find the target windres... pre-installed
> checking where to find the target windmc... pre-installed
> checking whether to enable maintainer-specific portions of Makefiles... no
> configure: creating ./config.status
> config.status: creating Makefile
>
>
>
>> On Wed, Nov 20, 2024 at 12:02 AM Jack Andrews <[email protected]> wrote:
>> >
>> > Hi newlib, I hope you're well. Thanks for the great lib.
>> >
>> > I'm porting newlib to BareMetal OS. I'm trying to understand the build
>> > process. When I remove libgloss/Makefile.in, I can still configure
>> > newlib - why? Shouldn't configure be recursive? I've tried configuring
>> > libgloss separately but that fails.
>>
>> This is partly because newlib toplevel shares the same toplevel
>> configure as GCC/binutils/gdb.
>> So subdirectories can either be a target library/program or a host (or
>> even a build) library/program too.
>> So the toplevel configure only configures the toplevel makefile and
>> then when invoking make, it will do the configures then.
>> Also not all targets use libgloss but still will use newlib. So there
>> is no reason to configure in the libgloss subdirectory for those
>> cases.
>>
>> Oh and you can do a combined build with GCC and binutils/gdb with
>> newlib and get a full set of multilibs even installed in the correct
>> location.
>>
>> For you OS, if you don't need libgloss, you can edit the toplevel
>> configure.ac (and regenerated configure) to disable it for that
>> target.
>> See around `# Disable newlib and libgloss for various target OSes.`.
>>
>> Hope this helps.
>>
>> Thanks,
>> Andrew
>>
>> >
>> > Here's what I did in a script:
>> >
>> > $ uname -sp
>> > Linux x86_64
>> > $ cat mail.sh
>> > ver="4.4.0.20231231"
>> > pkg=newlib-$ver
>> > tar=$pkg.tar.gz
>> >
>> > if [ ! -e $tar ]; then wget ftp://sourceware.org/pub/newlib/$tar; fi
>> > tar xf $tar
>> >
>> > rm -rf build; mkdir build; cd build
>> > if ../$pkg/configure >/dev/null; then echo configure works; fi
>> > if ../$pkg/libgloss/configure >/dev/null; then echo configure libgloss
>> works; fi
>> > rm ../$pkg/libgloss/Makefile.in
>> > if ../$pkg/configure >/dev/null; then echo why does configure
>> > still work?; fi
>> >
>> > cd ..
>> > $ bash mail.sh
>> > configure works
>> > configure: error: cannot run /bin/bash ../config.sub
>> > why does configure still work?
>> > $
>> >
>> > thanks in advance,
>> > jack
>>
>