aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Shimmin <tes@sgi.com>2006-04-04 06:06:00 +0000
committerTim Shimmin <tes@sgi.com>2006-04-04 06:06:00 +0000
commitb8706baf11be58c7803186f06e6be8da7c3338a7 (patch)
treed101c7ed4908df1e32bba24c1c92107ce5c372c8
parent9d98ed6ba90a2e3932f954224024375c078ee480 (diff)
downloaddmapi-dev-b8706baf11be58c7803186f06e6be8da7c3338a7.tar.gz
fix lib64 installs
Merge of master-melb:xfs-cmds:25657a by kenmcd.
-rw-r--r--Makefile5
-rw-r--r--aclocal.m4109
-rw-r--r--configure.in6
-rw-r--r--include/builddefs.in6
-rw-r--r--m4/Makefile5
-rw-r--r--m4/multilib.m443
-rw-r--r--m4/package_xfslibs.m49
7 files changed, 147 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index 7f301b6..9085b4f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
#
TOPDIR = .
@@ -39,6 +39,7 @@ $(CONFIGURE):
--bindir=/usr/bin \
--libdir=/lib \
--libexecdir=/usr/lib \
+ --enable-lib64=yes \
--includedir=/usr/include \
--mandir=/usr/share/man \
--datadir=/usr/share \
@@ -46,7 +47,7 @@ $(CONFIGURE):
touch .census
aclocal.m4::
- aclocal --acdir=$(TOPDIR)/m4 --output=$@
+ aclocal --acdir=`pwd`/m4 --output=$@
install: default
$(SUBDIRS_MAKERULE)
diff --git a/aclocal.m4 b/aclocal.m4
index 1f30601..e49db9f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,68 @@
# PARTICULAR PURPOSE.
#
+# Find format of installed man pages.
+# Always gzipped on Debian, but not Redhat pre-7.0.
+# We don't deal with bzip2'd man pages, which Mandrake uses,
+# someone will send us a patch sometime hopefully. :-)
+#
+AC_DEFUN([AC_MANUAL_FORMAT],
+ [ have_zipped_manpages=false
+ for d in ${prefix}/share/man ${prefix}/man ; do
+ if test -f $d/man1/man.1.gz
+ then
+ have_zipped_manpages=true
+ break
+ fi
+ done
+ AC_SUBST(have_zipped_manpages)
+ ])
+
+# The AC_MULTILIB macro was extracted and modified from
+# gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file
+# so that the correct paths can be used for 64-bit libraries.
+#
+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl From Bruno Haible.
+
+dnl AC_MULTILIB creates a variable libdirsuffix, containing
+dnl the suffix of the libdir, either "" or "64".
+dnl Only do this if the given enable parameter is "yes".
+AC_DEFUN([AC_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64. The current
+ dnl practice is that on a system supporting 32-bit and 64-bit instruction
+ dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+ dnl libraries go under $prefix/lib. We determine the compiler's default
+ dnl mode by looking at the compiler's library search path. If at least
+ dnl of its elements ends in /lib64 or points to a directory whose absolute
+ dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+ dnl default, namely "lib".
+ enable_lib64="$1"
+ libdirsuffix=""
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test "$enable_lib64" = "yes" -a -n "$searchpath"; then
+ save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) libdirsuffix=64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) libdirsuffix=64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$save_IFS"
+ fi
+ AC_SUBST(libdirsuffix)
+])
+
+#
# Generic macro, sets up all of the global packaging variables.
# The following environment variables may be set to override defaults:
# DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
@@ -32,7 +94,7 @@ AC_DEFUN([AC_PACKAGE_GLOBALS],
debug_build="$DEBUG"
AC_SUBST(debug_build)
- OPTIMIZER=${OPTIMIZER:-'-g'} dnl -O2
+ OPTIMIZER=${OPTIMIZER:-'-g -O2'}
opt_build="$OPTIMIZER"
AC_SUBST(opt_build)
@@ -40,12 +102,12 @@ AC_DEFUN([AC_PACKAGE_GLOBALS],
malloc_lib="$MALLOCLIB"
AC_SUBST(malloc_lib)
- PKG_USER=${INSTALL_USER:-'root'}
- pkg_user="$PKG_USER"
+ pkg_user=`id -u`
+ test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
AC_SUBST(pkg_user)
- PKG_GROUP=${INSTALL_GROUP:-'root'}
- pkg_group="$PKG_GROUP"
+ pkg_group=`id -g`
+ test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
AC_SUBST(pkg_group)
pkg_distribution=`uname -s`
@@ -263,6 +325,19 @@ AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
AC_SUBST(libhdl)
])
+AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
+ [
+ AC_MSG_CHECKING([libhandle.a for IRIX])
+ libhdl="`pwd`/../irix/libhandle/libhandle.a"
+ if ! test -f $libhdl; then
+ echo 'no'
+ echo 'FATAL ERROR: could not find IRIX XFS handle library.'
+ exit 1
+ fi
+ echo 'yes'
+ AC_SUBST(libhdl)
+ ])
+
AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
[ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
@@ -275,21 +350,3 @@ AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
])
])
-#
-# Find format of installed man pages.
-# Always gzipped on Debian, but not Redhat pre-7.0.
-# We don't deal with bzip2'd man pages, which Mandrake uses,
-# someone will send us a patch sometime hopefully. :-)
-#
-AC_DEFUN([AC_MANUAL_FORMAT],
- [ have_zipped_manpages=false
- for d in ${prefix}/share/man ${prefix}/man ; do
- if test -f $d/man1/man.1.gz
- then
- have_zipped_manpages=true
- break
- fi
- done
- AC_SUBST(have_zipped_manpages)
- ])
-
diff --git a/configure.in b/configure.in
index 06438c2..799f61b 100644
--- a/configure.in
+++ b/configure.in
@@ -6,9 +6,15 @@ AC_ARG_ENABLE(shared,
enable_shared=yes)
AC_SUBST(enable_shared)
+AC_ARG_ENABLE(lib64,
+[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
+ enable_lib64=no)
+AC_SUBST(enable_lib64)
+
AC_PACKAGE_GLOBALS(dmapi)
AC_PACKAGE_UTILITIES(dmapi)
AC_PACKAGE_NEED_XFS_HANDLE_H
AC_MANUAL_FORMAT
+AC_MULTILIB($enable_lib64)
AC_OUTPUT(include/builddefs)
diff --git a/include/builddefs.in b/include/builddefs.in
index 17a6454..1afc479 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2002-2006 Silicon Graphics, Inc. All Rights Reserved.
#
# @configure_input@
#
@@ -23,8 +23,8 @@ PKG_PLATFORM = @pkg_platform@
PKG_DISTRIBUTION= @pkg_distribution@
PKG_BIN_DIR = @bindir@
PKG_SBIN_DIR = @sbindir@
-PKG_LIB_DIR = @libdir@
-PKG_DEVLIB_DIR = @libexecdir@
+PKG_LIB_DIR = @libdir@@libdirsuffix@
+PKG_DEVLIB_DIR = @libexecdir@@libdirsuffix@
PKG_INC_DIR = @includedir@/xfs
PKG_MAN_DIR = @mandir@
PKG_DOC_DIR = @datadir@/doc/@pkg_name@
diff --git a/m4/Makefile b/m4/Makefile
index dcd0d9c..af682f2 100644
--- a/m4/Makefile
+++ b/m4/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2003-2006 Silicon Graphics, Inc. All Rights Reserved.
#
TOPDIR = ..
@@ -9,7 +9,8 @@ LSRCFILES = \
manual_format.m4 \
package_globals.m4 \
package_utilies.m4 \
- package_xfslibs.m4
+ package_xfslibs.m4 \
+ multilib.m4
default:
diff --git a/m4/multilib.m4 b/m4/multilib.m4
new file mode 100644
index 0000000..8d991d8
--- /dev/null
+++ b/m4/multilib.m4
@@ -0,0 +1,43 @@
+# The AC_MULTILIB macro was extracted and modified from
+# gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file
+# so that the correct paths can be used for 64-bit libraries.
+#
+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl From Bruno Haible.
+
+dnl AC_MULTILIB creates a variable libdirsuffix, containing
+dnl the suffix of the libdir, either "" or "64".
+dnl Only do this if the given enable parameter is "yes".
+AC_DEFUN([AC_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64. The current
+ dnl practice is that on a system supporting 32-bit and 64-bit instruction
+ dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+ dnl libraries go under $prefix/lib. We determine the compiler's default
+ dnl mode by looking at the compiler's library search path. If at least
+ dnl of its elements ends in /lib64 or points to a directory whose absolute
+ dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+ dnl default, namely "lib".
+ enable_lib64="$1"
+ libdirsuffix=""
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test "$enable_lib64" = "yes" -a -n "$searchpath"; then
+ save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) libdirsuffix=64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) libdirsuffix=64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$save_IFS"
+ fi
+ AC_SUBST(libdirsuffix)
+])
diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
index af718c2..0a38e1b 100644
--- a/m4/package_xfslibs.m4
+++ b/m4/package_xfslibs.m4
@@ -42,7 +42,8 @@ AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
libxfs="-lxfs"
test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
- test -f /usr/lib/libxfs.la && libxfs="/usr/lib/libxfs.la"
+ test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
+ libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
AC_SUBST(libxfs)
])
@@ -57,7 +58,8 @@ AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
libhdl="-lhandle"
test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
- test -f /usr/lib/libhandle.la && libhdl="/usr/lib/libhandle.la"
+ test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
+ libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
AC_SUBST(libhdl)
])
@@ -72,7 +74,8 @@ AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
libhdl="-lhandle"
test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
- test -f /usr/lib/libhandle.la && libhdl="/usr/lib/libhandle.la"
+ test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
+ libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
AC_SUBST(libhdl)
])