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 
-------------------------------------------------------------------------
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