bug-autoconf
[Top][All Lists]
Advanced

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

Re: [Dvd-devel] configure.in: BERO_CHECK_ALIGN


From: Bernhard Rosenkraenzer
Subject: Re: [Dvd-devel] configure.in: BERO_CHECK_ALIGN
Date: Wed, 27 Feb 2002 12:36:48 +0100 (CET)

On Wed, 13 Feb 2002, Paul Martinolich wrote:

> This does not work properly.  The AC_TRY_RUN is getting the
> return value, but assumes its an error rather than catching
> it.

I've tracked it down to a bug in autoconf (2.52):

The definition of BERO_CHECK_ALIGN is

AC_DEFUN([BERO_CHECK_ALIGN],
        [AC_CHECK_SIZEOF($1)
         AC_CACHE_CHECK([alignment of $1], AS_TR_SH([ac_cv_alignment_$1]),
                [AC_TRY_RUN([
                #include <stddef.h>
                #ifndef offsetof
                #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE 
*)0)->MEMBER)
                #endif
                struct foo {
                        char a;
                        $1 b;
                } foo;
                int main(int argc, char **argv)
                {
                        return offsetof(struct foo, b);
                }], [AS_TR_SH(ac_cv_alignment_$1)=0], 
[AS_TR_SH(ac_cv_alignment_$1)=$?], [AS_TR_SH(ac_cv_alignment_$1)=$2])])
          AC_DEFINE_UNQUOTED(AS_TR_CPP(ALIGN_$1), 
$AS_TR_SH([ac_cv_alignment_$1]), [Alignment of $1])
])


Simplified:
AC_TRY_RUN([test application], [alignment=0], [alignment=$?], [alignment=$2])


According to the autoconf info page:
 - Macro: AC_TRY_RUN (PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE],
          [ACTION-IF-CROSS-COMPILING])
     PROGRAM is the text of a C program, on which shell variable and
     back quote substitutions are performed.  If it compiles and links
     successfully and returns an exit status of 0 when executed, run
     shell commands ACTION-IF-TRUE.  Otherwise, run shell commands
     ACTION-IF-FALSE; the exit status of the program is available in
     the shell variable `$?'.  This macro uses `CFLAGS' or `CXXFLAGS',
     `CPPFLAGS', `LDFLAGS', and `LIBS' when compiling.

The generated configure script shows otherwise:
[...]
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_alignment_short=$?
fi
[...]

So $? actually contains the return value from cat, not from the "failed" 
program.

>  So xconfig.h has incorrect values.  When compiled, the
> program core dumps immediately, like for 'dvdrecord -version'.

That doesn't happen here (that's why I didn't see the problem in the 
first place), probably due to my usage of gcc 3.1-CVS.

> I am interested in getting this software to work on a
> powerpc-unknown-linux-gnu system, but as you see below, it
> fails even for i686-pc-linux-gnu.  I have a Mac G4 with
> Superdrive and Yellow Dog Linux 2.1 installed.  The dmesg
> reports the drive as a Pioneer 103 which I hear is the
> same as the A03, just the OEM version.

I'll release an update with a workaround for this autoconf bug today.
Please let me know if it works for you - I can't test on anything other 
than Linux/x86.

> I have photographic images scanned with a film scanner and
> one roll of 36 produces about 1.1 GB of compressed TIFF
> files.  A roll of 24 can be archived to CD-ROM.  I'd like
> to archive the larger rolls to DVD-R.  I plan to use ISO9660
> filesystem.

Should work.

LLaP
bero

-- 
This message is provided to you under the terms outlined at
http://www.bero.org/terms.html






reply via email to

[Prev in Thread] Current Thread [Next in Thread]