Re: Patch to specify out-of-tree gdk-pixbuf-csource for cross compiling



Michael Natterer <mitch gimp org> writes:

> Owen Taylor <otaylor redhat com> writes:
> 
> > Sven Neumann <sven gimp org> writes:
> > 
> > > Hi,
> > > 
> > > Michael Natterer <mitch gimp org> writes:
> > > 
> > > > Done. Unfortunately, I noticed that the stuff I did to the configure
> > > > scripts won't work...
> > > > 
> > > > What I did is:
> > > > 
> > > > AM_CONDITIONAL(CROSS_COMPILING, test $build != $host)
> > > > 
> > > > if test $CROSS_COMPILING; then
> > > >   (...)
> > > > 
> > > > 
> > > > but CROSS_COMPILING expands to CROSS_COMPILING_TRUE and CROSS_COMPILING_FALSE
> > > > in the generated configure...
> > > > 
> > > > The following version would work but looks ugly...
> > > > 
> > > > AM_CONDITIONAL(CROSS_COMPILING, test $build != $host)
> > > > 
> > > > if test x$CROSS_COMPILING_FALSE = x; then
> > > >   (...)
> > > 
> > > what about something like this:
> > > 
> > > if test $build != $host; then
> > >   cross_compiling=yes
> > > else
> > >   cross_compiling=no
> > > fi
> > > 
> > > AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
> > > 
> > > if test $cross_compiling = yes; then
> > >   ...
> > > fi
> > 
> > This is the correct version. The namespace for conditionals is
> > completely separate from the namespace for shell variables, and
> > no assumption should be made about the implementation of conditionals.
> 
> A co-worker just figured out that AC_PROG_CC already sets the shell
> variable cross_compiling to either "yes" or "no", so it could be
> reduced to:
> 
> AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
> 
> if test $cross_compiling = yes; then
>   ...
> fi
> 
> However I don't know if this is an implementation detail, as it
> appears in the autoconf 2.13 docs but not in the 2.53 ones...
> 
> Anyone out there with a definitive answer ?-)
 
While the docs aren't clear on the subject, I believe the change is
just that in 2.53 cross_compiling is just set by autoconf in the
"core" part rather by the AC_PROG_CC macro. (It's mentioned once or
twice in the autoconf-2.53 documentation.)

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]