[evolution-patches] Patch for lib64 detection for Ximian connector 1.4.7.3
- From: Frederic Crozat <fcrozat mandrakesoft com>
- To: Evolution Patches <evolution-patches lists ximian com>
- Subject: [evolution-patches] Patch for lib64 detection for Ximian connector 1.4.7.3
- Date: Tue, 21 Sep 2004 16:59:19 +0200
This patch fixes compilation with dynamic ldap on x86-64 platform (I
haven't tested this patch but it was done by our AMD64 guy on an x86-64
platform so it should be ok :)
--
Frederic Crozat <fcrozat mandrakesoft com>
Mandrakesoft
--- ximian-connector-1.4.7.3/aclocal.m4.lib64 2004-08-13 12:20:59.000000000 -0400
+++ ximian-connector-1.4.7.3/aclocal.m4 2004-09-21 10:36:19.449011510 -0400
@@ -13,6 +13,39 @@ dnl PARTICULAR PURPOSE.
# evolution/acinclude.m4
# shared configure.in hacks between Evolution and Connector
+# EVO_CHECK_LIBNAME
+# Determine libdir name.
+AC_DEFUN([EVO_CHECK_LIBNAME], [
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ AC_MSG_CHECKING([libdir name])
+ case $host in
+ *-*-linux*)
+ # Test if the compiler is 64bit
+ echo 'int i;' > conftest.$ac_ext
+ evo_cv_cc_64bit_output=no
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *"ELF 64"*)
+ evo_cv_cc_64bit_output=yes
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ case $host_cpu:$evo_cv_cc_64bit_output in
+ powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+ EVO_LIB="lib64"
+ ;;
+ *:*)
+ EVO_LIB="lib"
+ ;;
+ esac
+ AC_MSG_RESULT([$EVO_LIB])
+])
+
# EVO_PURIFY_SUPPORT
# Add --enable-purify. If the user turns it on, subst PURIFY and set
# the automake conditional ENABLE_PURIFY
@@ -40,6 +73,7 @@ AC_DEFUN(EVO_PURIFY_SUPPORT, [
# ENABLE_LDAP will be set. LDAP_CFLAGS and LDAP_LIBS will be set
# appropriately.
AC_DEFUN(EVO_LDAP_CHECK, [
+ AC_REQUIRE([EVO_CHECK_LIBNAME])dnl
default="$1"
AC_ARG_WITH(openldap, [ --with-openldap=[no/yes/PREFIX] Enable LDAP support in evolution])
@@ -64,7 +98,7 @@ AC_DEFUN(EVO_LDAP_CHECK, [
case $with_static_ldap in
no|"")
- if test -f $with_openldap/lib/libldap.la; then
+ if test -f $with_openldap/$EVO_LIB/libldap.la; then
with_static_ldap=no
else
with_static_ldap=yes
@@ -95,13 +129,13 @@ AC_DEFUN(EVO_LDAP_CHECK, [
AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
AC_CHECK_LIB(lber, ber_get_tag, [
if test "$with_static_ldap" = "yes"; then
- LDAP_LIBS="$with_openldap/lib/liblber.a $LDAP_LIBS"
+ LDAP_LIBS="$with_openldap/$EVO_LIB/liblber.a $LDAP_LIBS"
else
LDAP_LIBS="-llber $LDAP_LIBS"
fi
AC_CHECK_LIB(ldap, ldap_open, [
if test $with_static_ldap = "yes"; then
- LDAP_LIBS="$with_openldap/lib/libldap.a $LDAP_LIBS"
+ LDAP_LIBS="$with_openldap/$EVO_LIB/libldap.a $LDAP_LIBS"
else
LDAP_LIBS="-lldap $LDAP_LIBS"
fi],
@@ -401,6 +435,7 @@ dnl the libraries corresponding to expli
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
+ AC_REQUIRE([EVO_CHECK_LIBNAME])dnl
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
@@ -423,7 +458,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
])
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$EVO_LIB
fi
fi
])
@@ -523,7 +558,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
- if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$EVO_LIB; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -613,6 +648,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
additional_includedir="$basedir/include"
;;
+ */lib64 | */lib64/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib64/*$,,'`
+ additional_includedir="$basedir/include"
+ ;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
@@ -671,9 +710,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$EVO_LIB; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$EVO_LIB; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]