It does work (by luck) on existing platforms. But it's causing me
three problems:
1) It messes up config.cache; if you do this:
configure --cache-file=config.cache
you end up with this bogus line on x86_64:
ac_cv_c_endian=${ac_cv_c_endian=need}
Few people will care about that, but it's wrong.
2) I am cross-compiling, so I'd like to be able to override various
"configure" variables that configure cannot detect because it has no
way to run test programs. But I can't override this variable, because
configure bogusly uses ac_cv_c_endian both for endianness and to see
if you need alignment.
3) When doing native builds, I am configuring on a CPU where unaligned
accesses work, so they pass the "configure" check indicating it does
not require NEEDS_ALIGN, but are nonetheless very slow because they
are fixed up by a software trap handler. So again I would like to
override the autodetection of ac_cv_c_alignment and force NEEDS_ALIGN.
-Mat
On Aug 4, 11:47 am, Dustin <[email protected]> wrote:
> What does this break? It doesn't seem to affect any of the current
> builds.
>
> On Aug 4, 8:05 am, Mat Hostetter <[email protected]> wrote:
>
> > --- configure.ac.orig 2009-08-04 10:51:37.074888000 -0400
> > +++ configure.ac 2009-08-04 10:51:44.944340000 -0400
> > @@ -303,22 +303,22 @@
> > ], [
> > char *buf = malloc(32);
> > uint64_t *ptr = (uint64_t*)(buf+2);
> > *ptr = 0x1;
> > return 0;
> > ])
> > ],[
> > ac_cv_c_alignment=none
> > ],[
> > - ac_cv_c_endian=need
> > + ac_cv_c_alignment=need
> > ])
> > ])
> > -if test $ac_cv_c_endian = need; then
> > +if test $ac_cv_c_alignment = need; then
> > AC_DEFINE(NEED_ALIGN, 1, [Machine need alignment])
> > fi
> > ])
>
> > AC_C_ALIGNMENT
>
> > dnl Check for the requirements for running memcached with less privileges
> > dnl than the default privilege set. On Solaris we need setppriv and priv.h
> > dnl If you want to add support for other platforms you should check for
> > --- configure.orig 2009-08-04 10:51:40.160333000 -0400
> > +++ configure 2009-08-04 10:52:18.105635000 -0400
> > @@ -6519,31 +6519,31 @@
> > ac_cv_c_alignment=none
>
> > else
> > $as_echo "$as_me: program exited with status $ac_status" >&5
> > $as_echo "$as_me: failed program was:" >&5
> > sed 's/^/| /' conftest.$ac_ext >&5
>
> > ( exit $ac_status )
>
> > - ac_cv_c_endian=need
> > + ac_cv_c_alignment=need
>
> > fi
> > rm -rf conftest.dSYM
> > rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext
> > conftest.$ac_objext conftest.$ac_ext
> > fi
>
> > fi
> > { $as_echo "$as_me:$LINENO: result: $ac_cv_c_alignment" >&5
> > $as_echo "$ac_cv_c_alignment" >&6; }
> > -if test $ac_cv_c_endian = need; then
> > +if test $ac_cv_c_alignment = need; then
>
> > cat >>confdefs.h <<\_ACEOF
> > #define NEED_ALIGN 1
> > _ACEOF
>
> > fi