On Wed, Jul 02, 2008 at 03:37:55PM +0200, Marcus Rueckert wrote:
> On 2008-07-02 06:36:41 -0500, Carlo Marcelo Arenas Belon wrote:
> > The following proposed patch for stable 3.1, replaces the configure routine
> > that tried to guess the libdir directory by assuming biarch rules from
> > fedora linux (breaking all amd64 BSD and x64 Solaris) and overriding the
> > libdir parameter passed at configure time (breaking fedora linux ppc64).
> > 
> > Contains changes from r1452, r1467, r1468, r1475 and r1487
> > 
> > Carlo
> > ---
> 
> > Index: configure.in
> > ===================================================================
> > --- configure.in    (revision 1496)
> > +++ configure.in    (working copy)
> > @@ -111,7 +111,6 @@
> >  dnl The following cpu_vendor_os string goes into config.h.
> >  dnl
> >  AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", HOST_OS)
> > -AC_DEFINE_UNQUOTED(ARCH, "$host_cpu", ARCH)
> >  AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$host", CPU_VENDOR_OS)
> >  dnl AC_CYGWIN
> >  
> > @@ -494,14 +493,40 @@
> >  EXPORT_SYMBOLS="-export-dynamic"
> >  case "$host" in
> >  *linux*)
> > -                CFLAGS="$CFLAGS -D_REENTRANT"
> > -                AC_DEFINE(LINUX, 1, LINUX)
> > +           CFLAGS="$CFLAGS -D_REENTRANT"
> > +           AC_DEFINE(LINUX, 1, LINUX)
> >  dnl
> >  dnl For fsusage.c - disk usage.
> >  dnl
> > -                AC_DEFINE(STAT_STATVFS, 1, STAT_STATVFS)
> > -                AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC)
> > -                ;;
> > +           AC_DEFINE(STAT_STATVFS, 1, STAT_STATVFS)
> > +           AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC)
> > +           if test x"$build_cpu" != xia64 && \
> > +               test x"$build_cpu" != xalpha; then
> > +                   if test x"$libdir" = x"\${exec_prefix}/lib"; then
> > +                           if test x"$exec_prefix" = xNONE; then
> > +                                   if test x"$prefix" = xNONE; then
> > +                                           libroot="/usr"
> > +                                   else
> > +                                           libroot="$prefix"
> > +                                   fi
> > +                           else
> > +                                   libroot="$exec_prefix"
> > +                           fi
> > +
> > +                           AC_TRY_COMPILE([], [],
> > +                               [file conftest.$ac_objext > conftest.file])
> > +                           FILE=`cat conftest.file`
> > +                           WIDTH_CPU=`expr "x$FILE" : '.*ELF \(.*\)-bit '`
> > +                           rm -f conftest.file
> > +                           if test x"$WIDTH_CPU" = x64; then
> > +                                   libdir="$libroot/lib64"
> > +                           else
> > +                                   libdir="$libroot/lib"
> > +                           fi
> > +                           moduledir="$libdir/ganglia"
> > +                   fi
> > +           fi
> > +           ;;
> >  *ia64-*hpux*)      CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" 
> >             LIBS="-lpthread $LIBS"
> >             EXPORT_SYMBOLS="-Wl,-E"
> > @@ -572,16 +597,7 @@
> >  
> >  dnl Python module config files need to know where to look for libraries 
> > (/usr/lib vs /usr/lib64)
> >  AC_SUBST_FILE(libdir)
> > -if test "x$prefix" = xNONE; then
> > -  prefix="$ac_default_prefix"
> > -fi
> >  
> > -if test "x$host_cpu" = "xx86_64"; then
> > -  libdir="$prefix/lib64"
> > -else
> > -  libdir="$prefix/lib"
> > -fi
> > -
> >  AC_OUTPUT(Makefile 
> >            ganglia-config
> >            tests/Makefile 
> 
> i would never ever default libdir to $prefix/lib64.

agree, and as I said several times, I'd rather drop this and revert the
original patch that put that rule in there and rely in the packager/user
to specify --libdir if on a biarch system because getting it right is hard
and prone to failure :

  
http://www.mail-archive.com/ganglia-developers@lists.sourceforge.net/msg04275.html

but the part you are missing, is that this patch at least makes that problem
smaller and allows packages/user to fix it using --libdir if we got it wrong
and therefore it is most likely to help more people than it hurts, and will
stop hurting all people affected in 3.1 by the current implementation.

getting it wrong at least with what will be the first release of 3.1, will
prevent some users to have a working package or will get them a gmond with
no metrics to report and so (I presume, as I wasn't the one that committed
the original patch) that since the failure mode will be bad it was better
to try to guess a working libdir to prevent the user to shoot himself on the
foot.

There are some patches already being worked on for the next release of 3.1
which will hopefully make the failure mode be not that bad and then if this
heuristic has been found to be more problematic than helpful will be easier
to drop.

> there are linux
> distros which default to single arch on x86_64.

do you have any examples?, I checked debian/ubuntu and they both will still
work thanks to a link that maps lib64 into lib.  I also checked gentoo and it
will still work because lib64 (like in fedora) is the directory used for 64bit
libraries.

also checked that it was hopefully consistent with as many architectures I
could get packages from fedora/rhel and debian but since I don't have the
hardware to build on them, having them tested by anyone that does is
definitely encouraged (HINT: packagers)

having it tested in as many distributions/architectures as possible to verify
it does what is expected is a must and I was hoping the distribution
packagers will be able to help with that ;)

this patch should apply cleanly to the latest snapshot from ganglia 3.1, and
even fresher snapshots are always available from :

  http://tapir.sajinet.com.pe/ganglia/

> imho the default should
> always be plain $prefix/lib and if the packager/user is on a biarch
> system he has to specify --libdir.

do you happen to know who the packager from OpenSuSE or SLES is, and if he
will be willing to help?

Carlo

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to