diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-01-10 10:07:41 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2014-01-13 13:18:39 +0100 |
commit | c8f23c92177c5a82ab3699b1b0d4acbee9afb770 (patch) | |
tree | 72b6c7cf7a006babd2177055d8c61d1f6bd15375 /include | |
parent | 2d13383b7fbcc04fc16681caa4f43d9d9083cca1 (diff) | |
download | acl-c8f23c92177c5a82ab3699b1b0d4acbee9afb770.tar.gz |
modernize build system
This deletes the hand rolled build system and replaces it entirely
with autotools. The overall diffstat shows that this is a clear
win, and it makes the package build/install like every other autotool
package out there which makes the lives of distro maintainers a lot
easier.
This should also be faster by virtue of using a non-recursive build.
Things to note:
- to generate autotools:
./autogen.sh
- to see full compile output:
make V=1
- to build specific targets:
make attr getfattr ...
- to run tests:
make check
- to create a release:
make distcheck -j
Other non-developer things:
- man pages are no longer compressed as this is uncommon in the
autotools world and distros don't need it anyways (they already
handle it automatically for most pakages)
- the minor # of the shared library is now based on the package
version so it'll be much bigger ... this isn't a problem, and
is actually a bugfix (older releases didn't change when they
should have)
(Again, this is all using the standard autotool targets.)
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 40 | ||||
-rw-r--r-- | include/Makemodule.am | 10 | ||||
-rw-r--r-- | include/builddefs.in | 94 | ||||
-rw-r--r-- | include/buildmacros | 160 | ||||
-rw-r--r-- | include/buildrules | 104 | ||||
-rw-r--r-- | include/config.h.in | 46 | ||||
-rwxr-xr-x | include/install-sh | 365 |
7 files changed, 10 insertions, 809 deletions
diff --git a/include/Makefile b/include/Makefile deleted file mode 100644 index 328a61d..0000000 --- a/include/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -TOPDIR = .. -include $(TOPDIR)/include/builddefs - -HFILES = acl.h libacl.h acl_ea.h misc.h walk_tree.h -LSRCFILES = builddefs.in buildmacros buildrules config.h.in install-sh -LDIRT = sys acl - -default: sys acl - -sys acl: - $(LN_S) . $@ - -include $(BUILDRULES) - -install-dev: default - $(INSTALL) -m 755 -d $(PKG_INC_DIR) - $(INSTALL) -m 755 -d $(PKG_INC_DIR)/sys - $(INSTALL) -m 644 acl.h $(PKG_INC_DIR)/sys/acl.h - $(INSTALL) -m 755 -d $(PKG_INC_DIR)/acl - $(INSTALL) -m 644 libacl.h $(PKG_INC_DIR)/acl/libacl.h - -install install-lib: diff --git a/include/Makemodule.am b/include/Makemodule.am new file mode 100644 index 0000000..2596f5e --- /dev/null +++ b/include/Makemodule.am @@ -0,0 +1,10 @@ +aclinclude_HEADERS += \ + include/libacl.h + +sysinclude_HEADERS += \ + include/acl.h + +noinst_HEADERS += \ + include/acl_ea.h \ + include/misc.h \ + include/walk_tree.h diff --git a/include/builddefs.in b/include/builddefs.in deleted file mode 100644 index 9ed15b4..0000000 --- a/include/builddefs.in +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (c) 2002-2006 Silicon Graphics, Inc. All Rights Reserved. -# -# @configure_input@ -# - -ifndef _BUILDDEFS_INCLUDED_ -_BUILDDEFS_INCLUDED_ = 1 - -DEBUG = @debug_build@ -OPTIMIZER = @opt_build@ -MALLOCLIB = @malloc_lib@ -LOADERFLAGS = @LDFLAGS@ - -LIBACL = $(TOPDIR)/libacl/libacl.la -LIBATTR = @libattr@ -LIBMISC = $(TOPDIR)/libmisc/libmisc.la - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -top_builddir = @top_builddir@ -datarootdir = @datarootdir@ - -PKG_NAME = @pkg_name@ -PKG_USER = @pkg_user@ -PKG_GROUP = @pkg_group@ -PKG_RELEASE = @pkg_release@ -PKG_VERSION = @pkg_version@ -PKG_PLATFORM = @pkg_platform@ -PKG_DISTRIBUTION= @pkg_distribution@ -PKG_BIN_DIR = @bindir@ -PKG_SBIN_DIR = @sbindir@ -PKG_LIB_DIR = @libdir@@libdirsuffix@ -PKG_DEVLIB_DIR = @libdir@@libdirsuffix@ -PKG_INC_DIR = @includedir@ -PKG_MAN_DIR = @mandir@ -PKG_DOC_DIR = @datadir@/doc/@pkg_name@ -PKG_LOCALE_DIR = @datadir@/locale - -CC = @cc@ -AWK = @awk@ -SED = @sed@ -TAR = @tar@ -ZIP = @zip@ -MAKE = @make@ -ECHO = @echo@ -SORT = @sort@ -LN_S = @LN_S@ -SHELL = @SHELL@ -LIBTOOL = @LIBTOOL@ -MAKEDEPEND = @makedepend@ - -MSGFMT = @msgfmt@ -MSGMERGE = @msgmerge@ -XGETTEXT = @xgettext@ - -ENABLE_SHARED = @enable_shared@ -ENABLE_GETTEXT = @enable_gettext@ - -HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ - -ifneq "$(findstring $(PKG_PLATFORM), linux gnu gnu/kfreebsd gnu/knetbsd)" "" -PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -endif - -ifeq ($(PKG_PLATFORM),linux) -DEPENDFLAGS = -D__linux__ -endif -ifeq ($(PKG_PLATFORM),darwin) -DEPENDFLAGS = -D__APPLE__ -endif -ifeq ($(PKG_PLATFORM),irix) -DEPENDFLAGS = -D__sgi__ -endif -ifeq ($(PKG_PLATFORM),freebsd) -DEPENDFLAGS = -D__FreeBSD__ -endif - -GCFLAGS = $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \ - -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ - -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include - -# Global, Platform, Local CFLAGS -CFLAGS += $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) - -include $(TOPDIR)/include/buildmacros - -endif - -# -# For targets that should always be rebuilt, -# define a target that is never up-to-date. -# Targets needing this should depend on $(_FORCE) -_FORCE = __force_build diff --git a/include/buildmacros b/include/buildmacros deleted file mode 100644 index 9e81bb8..0000000 --- a/include/buildmacros +++ /dev/null @@ -1,160 +0,0 @@ -# -# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - -BUILDRULES = $(TOPDIR)/include/buildrules - -# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in -# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES) -# $(CXXFILES), or $(HFILES) and is used to construct the manifest list -# during the "dist" phase (packaging). - -LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS) -LTLDFLAGS += $(LOADERFLAGS) -LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB) - -MAKEOPTS = --no-print-directory -SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES) - -DEPDIRT = dep dep.bak -MANDIRT = *.[1-9].gz -PODIRT = *.tmpo *.mo -CDIRT = $(OBJECTS) $(LTOBJECTS) $(LTCOMMAND) $(LTLIBRARY) -DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(PODIRT) $(CDIRT) - -OBJECTS = $(ASFILES:.s=.o) \ - $(CFILES:.c=.o) \ - $(LFILES:.l=.o) \ - $(YFILES:%.y=%.tab.o) - -INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP) - -IMAGES_DIR = $(TOPDIR)/all-images -DIST_DIR = $(TOPDIR)/dist - -CCF = $(CC) $(CFLAGS) $(CPPFLAGS) -MAKEF = $(MAKE) $(MAKEOPTS) -CXXF = $(CXX) $(CXXFLAGS) - -# For libtool. -LIBNAME = $(basename $(LTLIBRARY)) -LTOBJECTS = $(OBJECTS:.o=.lo) -LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) - -LTLINK = $(LIBTOOL) --mode=link $(CC) -LTEXEC = $(LIBTOOL) --mode=execute -LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) - -ifeq ($(ENABLE_SHARED),yes) -LTLDFLAGS += -rpath $(PKG_LIB_DIR) -LTLDFLAGS += -version-info $(LTVERSION) -endif - -ifeq ($(ENABLE_SHARED),yes) -INSTALL_LTLIB = \ - cd $(TOPDIR)/$(LIBNAME)/.libs; \ - ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ - ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \ - ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR) -endif - -# Libtool thinks the static and shared libs should be in the same dir, so -# make the static lib appear in the place we chose as rpath (using the two -# symlinks below). -# Other things want the shared libs to appear in /usr/lib, else they'll -# link with the static libs there. So, another symlink to get the .so into -# /usr/lib. -ifeq ($(ENABLE_SHARED),yes) -INSTALL_LTLIB_DEV = \ - cd $(TOPDIR)/$(LIBNAME)/.libs; \ - ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \ - ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \ - ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_DEVLIB_DIR)/$(LIBNAME).la ; \ - ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ - ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \ - if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \ - ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \ - ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \ - ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \ - fi -else -INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC) -endif - -INSTALL_LTLIB_STATIC = \ - cd $(TOPDIR)/$(LIBNAME)/.libs; \ - ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); - -INSTALL_MAN = \ - @for d in $(MAN_PAGES); do \ - first=true; \ - for m in `$(AWK) \ - '/^\.S[h|H] NAME/ {ok=1; next} ok {print; exit}' $$d \ - | $(SED) \ - -e 's/^\.Nm //' -e 's/,/ /g' -e 's/\\-.*//' \ - -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \ - do \ - [ -z "$$m" -o "$$m" = "\\" ] && continue; \ - t=$(MAN_DEST)/$$m.$(MAN_SECTION); \ - if $$first; then \ - if $(HAVE_ZIPPED_MANPAGES); then \ - $(ZIP) -9 -c $$d > $$d.gz; _sfx=.gz; \ - fi; \ - u=$$m.$(MAN_SECTION)$$_sfx; \ - echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx;\ - $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \ - else \ - echo $(INSTALL) -S $$u $${t}$$_sfx; \ - $(INSTALL) -S $$u $${t}$$_sfx; \ - fi; \ - first=false; \ - done; \ - done - -ifeq ($(ENABLE_GETTEXT),yes) -INSTALL_LINGUAS = \ - @for l in $(LINGUAS) ""; do \ - if test -f "$$l.mo" ; then \ - ldir=$(PKG_LOCALE_DIR)/$$l/LC_MESSAGES; \ - $(INSTALL) -m 755 -d $$ldir; \ - $(INSTALL) -m 644 $$l.mo $$ldir/$(PKG_NAME).mo; \ - fi; \ - done -endif - -MAN_MAKERULE = \ - @for f in *.[12345678] ""; do \ - if test ! -z "$$f"; then \ - $(ZIP) --best -c < $$f > $$f.gz; \ - fi; \ - done - -DIST_MAKERULE = \ - $(MAKEF) -C build dist - -SOURCE_MAKERULE = \ - @test -z "$$DIR" && DIR="."; \ - for f in $(SRCFILES) ""; do \ - test -z "$$f" && break; \ - test -L "$$f" || $(ECHO) $$DIR/$$f; \ - done; \ - for d in `echo $(SUBDIRS)` ""; do \ - test -z "$$d" && break; \ - if test -d "$$d"; then \ - $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \ - fi; \ - done diff --git a/include/buildrules b/include/buildrules deleted file mode 100644 index 159d70c..0000000 --- a/include/buildrules +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -ifndef _BUILDRULES_INCLUDED_ -_BUILDRULES_INCLUDED_ = 1 - -include $(TOPDIR)/include/builddefs - -clean clobber : $(addsuffix -clean,$(SUBDIRS)) - rm -f $(DIRT) - @rm -fr .libs - -%-clean: - $(MAKE) -C $* clean - -# Never blow away subdirs -ifdef SUBDIRS -.PRECIOUS: $(SUBDIRS) -.PHONY: $(SUBDIRS) - -$(SUBDIRS): - $(MAKE) -C $@ -endif - -# -# Standard targets -# - -ifdef LTCOMMAND -$(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES) - $(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS) -endif - -ifdef LTLIBRARY -$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS) - $(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS) - -%.lo: %.c - $(LTCOMPILE) -c $< -endif - -ifdef POTHEAD -%.pot: $(XGETTEXTFILES) - $(XGETTEXT) --language=C --keyword=_ -o $@ $(XGETTEXTFILES) - -# Generate temp .po files, to check whether translations need updating. -# Not by default, due to gettext output differences between versions. -%.po: $(POTHEAD) -# $(MSGMERGE) -o $@.tmpo $@ $(POTHEAD) -# if ! diff $@.tmpo $@ >/dev/null; then echo "$@ dated, see $@.tmpo"; fi - -%.mo: %.po - $(MSGFMT) -o $@ $< -endif - -source : - $(SOURCE_MAKERULE) - -endif # _BUILDRULES_INCLUDED_ - -$(_FORCE): - -.PHONY : depend - -DEPENDSCRIPT := $(MAKEDEPEND) $(DEPENDFLAGS) -f - -- $(CFLAGS) -- $(CFILES) | \ - $(SED) -e 's,`pwd`,$(TOPDIR),g' \ - -e 's, */[^ ]*,,g' \ - -e '/^[^ ]*: *$$/d' \ - -e '/^ *$$/d' - -ifdef LTLIBRARY -DEPENDSCRIPT := $(DEPENDSCRIPT) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' -endif - -depend : $(CFILES) $(HFILES) $(addsuffix -depend,$(SUBDIRS)) - $(DEPENDSCRIPT) > .dep - test -s .dep || rm -f .dep - -%-depend: - $(MAKE) -C $* depend - -# Include dep, but only if it exists -ifeq ($(shell test -f .dep && echo .dep), .dep) -include .dep -else -ifdef LTLIBRARY -$(LTOBJECTS): $(HFILES) -else -$(OBJECTS): $(HFILES) -endif -endif diff --git a/include/config.h.in b/include/config.h.in deleted file mode 100644 index 6a720ac..0000000 --- a/include/config.h.in +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @configure_input@ - */ - -/* Define if you have the attr/error_context.h header */ -#undef HAVE_ATTR_ERROR_CONTEXT_H - -/* Define if you want Posix compliant getfacl and setfacl utilities - without extensions */ -#undef POSIXLY_CORRECT - -/* The number of bytes in a int. */ -#undef SIZEOF_INT - -/* The number of bytes in a long. */ -#undef SIZEOF_LONG - -/* The number of bytes in a short. */ -#undef SIZEOF_SHORT - -/* Define if you have attribute((visibility(hidden))) in gcc. */ -#undef HAVE_VISIBILITY_ATTRIBUTE - -/* Define if you want gettext (I18N) support */ -#undef ENABLE_GETTEXT - -/* On GNU/kFreeBSD, ENODATA is not defined in the system headers */ -#include <errno.h> -#ifndef ENODATA -# define ENODATA ENOATTR -#endif diff --git a/include/install-sh b/include/install-sh deleted file mode 100755 index 3c9d49b..0000000 --- a/include/install-sh +++ /dev/null @@ -1,365 +0,0 @@ -#! /bin/sh -# -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# This script emulates bsd install and also recognises -# two environment variables, with the following semantics :- -# -# $DIST_MANIFEST - if set, the name of the file to append manifest -# information in the following format: -# File : f mode owner group src target -# Directory: d mode owner group target -# Symlink : l linkval target -# -# $DIST_ROOT - if set, prepend to target -# -# The sematics of all combinations of these two variables -# are as follows: -# -# $DIST_MANIFEST? $DIST_ROOT? | Copy? Append Manifest? -# -----------------------------+-------------------------- -# not set not set | yes no -# not set set | yes no -# set not set | no yes -# set set | yes yes -# -_usage() { - echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory" - echo "or $prog [-D] [-o owner] [-g group] [-m mode] file directory/file" - echo "or $prog [-o owner] [-g group] [-m mode] file [file ...] directory" - echo "or $prog -S file target (creates \"target\" symlink)" - echo "or $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.lai directory" - echo "" - echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the" - echo "behaviour of this command - see comments in the script." - echo "The -D flag is only available for the second usage, and causes" - echo "the target directory to be created before installing the file." - echo "" - exit 1 -} - -_chown () -{ - _st=255 - if [ $# -eq 3 ] ; then - chown $1:$2 $3 - _st=$? - if [ $_st -ne 0 ] ; then - if [ $REAL_UID != '0' ] ; then - if [ ! -f $DIST_ROOT/.chown.quiet ] ; then - echo '===============================================' - echo Ownership of files under ${DIST_ROOT:-/} - echo cannot be changed - echo '===============================================' - if [ -n "$DIST_ROOT" ] ; then - touch $DIST_ROOT/.chown.quiet - fi - fi - _st=0 - fi - fi - fi - - return $_st -} - - -_manifest () -{ - echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null} -} - -prog=`basename $0` -HERE=`pwd` -dflag=false -Dflag=false -Sflag=false -Tflag=false -DIRMODE=755 -FILEMODE=644 -OWNER=`id -u` -GROUP=`id -g` -REAL_UID=$OWNER - -# default is to install and don't append manifest -INSTALL=true -MANIFEST=: - -: ${DIST_ROOT:=${DESTDIR}} - -[ -n "$DIST_MANIFEST" -a -z "$DIST_ROOT" ] && INSTALL=false -[ -n "$DIST_MANIFEST" ] && MANIFEST="_manifest" - -[ $# -eq 0 ] && _usage - -if $INSTALL -then - CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown -else - CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true -fi - -[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true - -while getopts "Dcm:d:S:o:g:T:" c $* -do - case $c in - c) - ;; - g) - GROUP=$OPTARG - ;; - o) - OWNER=$OPTARG - ;; - m) - DIRMODE=`expr $OPTARG` - FILEMODE=$DIRMODE - ;; - D) - Dflag=true - ;; - S) - symlink=$OPTARG - Sflag=true - ;; - d) - dir=$DIST_ROOT/$OPTARG - dflag=true - ;; - T) - lt_install=$OPTARG - Tflag=true - ;; - *) - _usage - ;; - esac -done - -shift `expr $OPTIND - 1` - -status=0 -if $dflag -then - # - # first usage - # - $MKDIR -p $dir - status=$? - if [ $status -eq 0 ] - then - $CHMOD $DIRMODE $dir - status=$? - fi - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT} -elif $Sflag -then - # - # fourth usage (symlink) - # - if [ $# -ne 1 ] - then - _usage - else - target=$DIST_ROOT/$1 - fi - $LN -s -f $symlink $target - status=$? - $MANIFEST l $symlink ${target#$DIST_ROOT} -elif $Tflag -then - # - # -T (install libs built by libtool) - # - if [ $# -ne 2 ] - then - _usage - else - libtool_lai=$1 - # source the libtool variables - if [ ! -f $libtool_lai ] - then - echo "$prog: Unable to find libtool library file $libtool_lai" - exit 2 - fi - . ./$libtool_lai - target=$DIST_ROOT/$2 - fi - case $lt_install in - so_dot_version) - # Loop until we find libfoo.so.x.y.z, then break out. - for solib in $library_names - do - # does it have enough parts? libfoo.so.x.y.z == 5 - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq 5 ] - then - install_name=$target/$solib - $CP $solib $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT} - break - fi - done - ;; - - so_*) - case $lt_install in - so_dot_current) - # ln -s libfoo.so.x.y.z to libfoo.so.x - from_parts=5 # libfoo.so.x.y.z - to_parts=3 # libfoo.so.x - ;; - so_base) - # ln -s libfoo.so.x to libfoo.so - from_parts=3 # libfoo.so.x - to_parts=2 # libfoo.so - ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - # Loop until we find the names, then break out. - for solib in $library_names - do - # does it have enough parts? - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq $from_parts ] - then - from_name=$solib - elif [ $cnt -eq $to_parts ] - then - to_name=$solib - fi - - if [ -n "$from_name" ] && [ -n "$to_name" ] - then - install_name=$target/$to_name - $LN -s -f $from_name $install_name - status=$? - $MANIFEST l $from_name ${install_name#$DIST_ROOT} - break - fi - done - ;; - old_lib) - install_name=$target/$old_library - $CP $old_library $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT} - ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - case $lt_install in - old_lib|so_dot_version) - if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $install_name - $CHOWN $OWNER $GROUP $install_name - fi - ;; - esac - -else - list="" - dir="" - if [ $# -eq 2 ] - then - # - # second usage - # - f=$1 - dir=$DIST_ROOT/$2 - if $Dflag - then - mkdir -p `dirname $dir` - fi - $CP $f $dir - status=$? - if [ $status -eq 0 ] - then - if [ -f $dir/$f ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f - else - $CHMOD $FILEMODE $dir - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT} - fi - fi - else - # - # third usage - # - n=1 - while [ $# -gt 0 ] - do - if [ $# -gt 1 ] - then - list="$list $1" - else - dir=$DIST_ROOT/$1 - fi - shift - done - - # echo DIR=$dir list=\"$list\" - for f in $list - do - $CP $f $dir - status=$? - if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f - fi - [ $status -ne 0 ] && break - done - fi -fi - -exit $status |