diff options
author | Tim Shimmin <tes@sgi.com> | 2006-04-04 06:06:00 +0000 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2006-04-04 06:06:00 +0000 |
commit | e64d8efb08545b0bec490431cd13dfd269f027c6 (patch) | |
tree | f0e79536692892e865a3e9afd0e9497e719bc9c7 | |
parent | db29d4842518f70e40d4796f98c870ad2a8005e1 (diff) | |
download | attr-e64d8efb08545b0bec490431cd13dfd269f027c6.tar.gz |
fix lib64 installs
Merge of master-melb:xfs-cmds:25657a by kenmcd.
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | aclocal.m4 | 94 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | include/builddefs.in | 11 | ||||
-rw-r--r-- | m4/Makefile | 5 | ||||
-rw-r--r-- | m4/multilib.m4 | 43 |
6 files changed, 130 insertions, 34 deletions
@@ -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 = . @@ -41,6 +41,7 @@ $(CONFIGURE): --bindir=/usr/bin \ --libdir=/lib \ --libexecdir=/usr/lib \ + --enable-lib64=yes \ --includedir=/usr/include \ --mandir=/usr/share/man \ --datadir=/usr/share \ @@ -48,7 +49,7 @@ $(CONFIGURE): touch .census aclocal.m4:: - aclocal --acdir=$(TOPDIR)/m4 --output=$@ + aclocal --acdir=`pwd`/m4 --output=$@ install: default $(SUBDIRS_MAKERULE) @@ -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 enable param 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 @@ -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` @@ -185,21 +247,3 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], AC_SUBST(rpmbuild) ]) -# -# 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 b482502..d685181 100644 --- a/configure.in +++ b/configure.in @@ -12,9 +12,15 @@ AC_ARG_ENABLE(gettext, enable_gettext=yes) AC_SUBST(enable_gettext) +AC_ARG_ENABLE(lib64, +[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],, + enable_lib64=no) +AC_SUBST(enable_lib64) + AC_PACKAGE_GLOBALS(attr) AC_PACKAGE_UTILITIES(attr) AC_MANUAL_FORMAT +AC_MULTILIB($enable_lib64) AC_C_CONST AC_TYPE_MODE_T diff --git a/include/builddefs.in b/include/builddefs.in index 1198083..8858342 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@ # @@ -26,8 +26,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@/attr PKG_MAN_DIR = @mandir@ PKG_DOC_DIR = @datadir@/doc/@pkg_name@ @@ -52,8 +52,9 @@ RPM = @rpm@ RPMBUILD = @rpmbuild@ RPM_VERSION = @rpm_version@ -ENABLE_SHARED = @enable_shared@ -ENABLE_GETTEXT = @enable_gettext@ +ENABLE_SHARED = @enable_shared@ +ENABLE_GETTEXT = @enable_gettext@ + HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ ifneq "$(findstring $(PKG_PLATFORM), linux gnu gnu/kfreebsd gnu/knetbsd)" "" diff --git a/m4/Makefile b/m4/Makefile index ff5be1d..6e003a5 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 = .. @@ -8,7 +8,8 @@ include $(TOPDIR)/include/builddefs LSRCFILES = \ manual_format.m4 \ package_globals.m4 \ - package_utilies.m4 + package_utilies.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) +]) |