install_headers::
@$(MAKE) install_source SRCROOT=$(DSTROOT)$(Destination)
$(_v) $(RM) -f $(DSTROOT)$(Destination)/Makefile
+ $(_v) $(MV) -f $(DSTROOT)$(Destination)/bin $(DSTROOT)$(MAKEFILEPATH)
.PHONY: bsd_install
-BSD_Install_Targets = $(BSD_Before_Install) BSD_install_dirs BSD_install BSD_clean_dirs $(BSD_After_Install)
+BSD_Install_Targets = $(BSD_Before_Install) BSD_install_dirs BSD_install BSD_clean_dirs $(BSD_After_Install) compress_man_pages
install:: $(BSD_Install_Targets)
$(_v) umask $(Install_Mask) ; $(Environment) $(BSDMAKE) $(Install_Environment) $(Install_Target)
BSD_clean_dirs::
- -$(_v) $(FIND) -d $(DSTROOT) -type d -print0 | $(XARGS) -0 rmdir 2> /dev/null
+ -$(_v) $(FIND) -d $(DSTROOT) -type d -exec rmdir "{}" \; 2> /dev/null
BSD_Build_Targets = $(BSD_Before_Build) BSD_build $(BSD_After_Build)
VPATH=$(Sources)
+ManPageDirectories = /usr/share/man
+
##
# Targets
##
else
$(_v) $(TAR) cf - . | (cd "$(SRCROOT)" ; $(TAR) xfp -)
endif
- $(_v) $(FIND) "$(SRCROOT)" $(Find_Cruft) | $(XARGS) $(RMDIR)
+ $(_v) $(FIND) "$(SRCROOT)" $(Find_Cruft) -depth -exec $(RMDIR) "{}" \;
endif
ifndef ShadowTestFile
rshowvar: showvar
$(_v) $(MAKE) recurse TARGET=rshowvar
+
+compress_man_pages:
+ifneq "$(strip $(ManPageDirectories))" ""
+ @echo "Compressing man pages for $(Project)..."
+ $(_v) $(COMPRESSMANPAGES) $(ManPageDirectories)
+endif
Sources = $(SRCROOT)/$(Project)
ConfigStamp = $(BuildDirectory)/configure-stamp
-Workaround_3678855 = /BogusHTMLInstallationDir
-
ifndef Install_Prefix
Install_Prefix = $(USRDIR)
endif
endif
ifndef Install_HTML
ifeq "$(UserType)" "Developer"
-Install_HTML = $(Workaround_3678855)
+Install_HTML = $(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)/$(ProjectName)
else
Install_HTML = $(NSDOCUMENTATIONDIR)/$(ToolType)/$(ProjectName)
endif
ifneq ($(GnuNoInstall),YES)
@echo "Installing $(Project)..."
$(_v) umask $(Install_Mask) ; $(MAKE) -C $(BuildDirectory) $(Environment) $(Install_Flags) $(Install_Target)
- $(_v) $(FIND) $(DSTROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
- $(_v) $(FIND) $(SYMROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
+ $(_v) $(FIND) $(DSTROOT) $(Find_Cruft) -depth -exec $(RMDIR) "{}" \;
+ $(_v) $(FIND) $(SYMROOT) $(Find_Cruft) -depth -exec $(RMDIR) "{}" \;
ifneq ($(GnuNoChown),YES)
$(_v)- $(CHOWN) -R $(Install_User):$(Install_Group) $(DSTROOT) $(SYMROOT)
endif
ifdef GnuAfterInstall
$(_v) $(MAKE) $(GnuAfterInstall)
endif
- $(_v) if [ -d "$(DSTROOT)$(Workaround_3678855)" ]; then \
- $(INSTALL_DIRECTORY) "$(DSTROOT)$(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)"; \
- $(MV) "$(DSTROOT)$(Workaround_3678855)" \
- "$(DSTROOT)$(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)/$(ProjectName)"; \
- fi
+ $(_v) $(MAKE) compress_man_pages
build:: configure
ifneq ($(GnuNoBuild),YES)
# Compilers and Binary Tools
##
AR = /usr/bin/ar
+ARSH = $(MAKEFILEPATH)/bin/ar.sh
BISON = /usr/bin/bison
BSDMAKE = /usr/bin/bsdmake
CC = /usr/bin/cc
# Miscellaneous
##
ARCH = /usr/bin/arch
+COMPRESSMANPAGES = $(MAKEFILEPATH)/bin/compress-man-pages.pl -d $(DSTROOT)
FALSE = /usr/bin/false
PWD = /bin/pwd
SLEEP = /bin/sleep
VARDIR = /private/var
VARTMPDIR = $(VARDIR)/tmp
-SYSTEM_DEVELOPER_TOOLS_DOC_DIR = $(NSDEVELOPERDIR)/ADC Reference Library/documentation/DeveloperTools
+SYSTEM_DEVELOPER_TOOLS_DOC_DIR = $(NSDEVELOPERDIR)/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools
##
# Targets
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+#
+# @APPLE_LICENSE_HEADER_START@
+#
+# This file contains Original Code and/or Modifications of Original Code
+# as defined in and that are subject to the Apple Public Source License
+# Version 2.0 (the 'License'). You may not use this file except in
+# compliance with the License. Please obtain a copy of the License at
+# http://www.opensource.apple.com/apsl/ and read it before using this
+# file.
+#
+# The Original Code and all software distributed under the License are
+# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+# Please see the License for the specific language governing rights and
+# limitations under the License.
+#
+# @APPLE_LICENSE_HEADER_END@
+##
+# Wrapper around ar which behaves more like ar.
+# Problem is Rhapsody's ar doesn't work on a file that's been ranlib'ed
+# and some makefiles want to edit ranlib'ed archives.
+#
+# The interesting and functional routine here in unranlib().
+# The "main" code, which wraps ar, is a hack and may not parse the
+# arguments correctly, but seems to work for most uses of ar, where
+# the library is argv[2].
+##
+# Wilfredo Sanchez Jr. | wsanchez@apple.com
+# Copyright 1998 Apple Computer, Inc.
+##
+
+##
+# Set up PATH
+##
+
+MyPath=/usr/bin:/bin;
+
+if [ -z "${PATH}" ]; then
+ export PATH=${MyPath};
+else
+ export PATH=${PATH}:${MyPath};
+fi
+
+##
+# Functions
+##
+
+unranlib ()
+{
+ local archive;
+
+ for archive in $*; do
+
+ local name="$(basename ${archive})";
+ local dir="/tmp/unranlib.$$/${name}";
+ local ofiles="";
+ local archs="$(file ${archive} | \
+ grep '(for architecture' | \
+ awk '{print $4}' | \
+ sed 's/)://')";
+
+ for arch in ${archs}; do
+ local archdir="${dir}/${arch}";
+ mkdir -p "${archdir}";
+
+ lipo -thin "${arch}" "${archive}" -o "${archdir}/${name}";
+
+ ( cd "${archdir}" && ar -xo "./${name}"; );
+
+ local ofile;
+ for ofile in `find "${archdir}" -name \*.o`; do
+ ofiles="${ofiles} $(basename ${ofile})";
+ done
+
+ done
+
+ ofiles=$(echo ${ofiles} | tr ' ' '\012' | sort | uniq);
+
+ local ofile;
+ for ofile in ${ofiles}; do
+ lipo -create $(find "${dir}" -name "${ofile}" -print) -o "${dir}/${ofile}";
+ done
+
+ ( cd "${dir}" && ar -cr "${name}" ${ofiles}; );
+
+ mv "${dir}/${name}" "${archive}";
+
+ rm -rf "${dir}";
+
+ done
+
+ rm -rf "/tmp/unranlib.$$";
+}
+
+##
+# Handle command line
+##
+
+# This is totally bogus, but enough for now.
+archive=$2;
+
+if [ -f "${archive}" ] &&
+ file "${archive}" | grep -E 'Mach-O (fat file|universal binary)' > /dev/null; then
+
+ # File is fat. Undo ranlib.
+ unranlib "${archive}";
+fi
+
+ar $*;
--- /dev/null
+#!/usr/bin/perl
+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+#
+# @APPLE_LICENSE_HEADER_START@
+#
+# This file contains Original Code and/or Modifications of Original Code
+# as defined in and that are subject to the Apple Public Source License
+# Version 2.0 (the 'License'). You may not use this file except in
+# compliance with the License. Please obtain a copy of the License at
+# http://www.opensource.apple.com/apsl/ and read it before using this
+# file.
+#
+# The Original Code and all software distributed under the License are
+# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+# Please see the License for the specific language governing rights and
+# limitations under the License.
+#
+# @APPLE_LICENSE_HEADER_END@
+
+use strict;
+use File::Basename ();
+use File::Find ();
+use Getopt::Std ();
+
+my $MyName = File::Basename::basename($0);
+my $N = 100;
+my $MinSize = 64;
+my %inodes;
+my @symlinks;
+our $opt_d = '';
+
+sub wanted {
+ return unless /\.[\dn][a-z]*$/;
+ if(-l $_) {
+ push(@symlinks, $_);
+ } elsif(-f _) {
+ return if -s _ < $MinSize;
+ my($dev, $ino) = stat(_);
+ my $list = $inodes{$ino};
+ $list = $inodes{$ino} = [] unless defined($list);
+ push(@$list, $_);
+ }
+}
+
+sub usage {
+ die "Usage: $MyName [-d prefix] dir ...\n";
+}
+
+Getopt::Std::getopts('d:');
+usage() unless scalar(@ARGV) > 0;
+
+for my $dir (@ARGV) {
+ $dir = $opt_d . $dir if $opt_d ne '';
+ next unless -e $dir;
+ die "$dir: no such directory\n" unless -d _;
+
+ %inodes = ();
+ @symlinks = ();
+ File::Find::find({
+ wanted => \&wanted,
+ no_chdir => 1,
+ }, $dir);
+
+ my(@compress, @links);
+ for(values(%inodes)) {
+ push(@compress, $_->[0]);
+ push(@links, $_) if scalar(@$_) > 1;
+ }
+
+ my $count;
+ while(($count = scalar(@compress)) > 0) {
+ $_ = $count > $N ? $N : $count;
+ my @args = splice(@compress, 0, $_);
+ print "gzip -f @args\n";
+ system('gzip', '-f', @args) == 0 or die "gzip failed\n";;
+ }
+ foreach my $list (@links) {
+ my $main = shift(@$list);
+ for(@$list) {
+ printf "rm $_; ln $main.gz $_.gz\n";
+ unlink $_ or die "Can't unlink: $!\n";
+ link("$main.gz", "$_.gz") or die "Can't link: $!\n";;
+ }
+ }
+ for(@symlinks) {
+ my $link = readlink($_);
+ printf "rm $_; ln -s $link.gz $_.gz\n";
+ unlink $_ or die "Can't unlink: $!\n";
+ symlink("$link.gz", "$_.gz") or die "Can't symlink: $!\n";
+ }
+}
--- /dev/null
+#!/usr/bin/perl
+#
+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+#
+# @APPLE_LICENSE_HEADER_START@
+#
+# This file contains Original Code and/or Modifications of Original Code
+# as defined in and that are subject to the Apple Public Source License
+# Version 2.0 (the 'License'). You may not use this file except in
+# compliance with the License. Please obtain a copy of the License at
+# http://www.opensource.apple.com/apsl/ and read it before using this
+# file.
+#
+# The Original Code and all software distributed under the License are
+# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+# Please see the License for the specific language governing rights and
+# limitations under the License.
+#
+# @APPLE_LICENSE_HEADER_END@
+
+use strict;
+use POSIX ();
+
+# Create a version string from various environment variables, from the
+# argument list, or the current directory
+
+my $name = $ARGV[0];
+$name = $ENV{RC_ProjectName} unless defined($name) && $name ne '';
+$name = $ENV{PROJECT_NAME} unless defined($name) && $name ne '';
+my $vers = $ENV{RC_ProjectNameAndSourceVersion};
+$vers = "$name-$ENV{RC_ProjectSourceVersion}" unless defined($vers) && $vers ne '' && defined($ENV{RC_ProjectSourceVersion}) && $ENV{RC_ProjectSourceVersion} ne '';
+if(defined($vers) && $vers ne '') {
+ if(defined($name) && $name ne '') {
+ $vers =~ s/^[^-]*-/$name-/;
+ } else {
+ ($name = $vers) =~ s/-.*//;
+ }
+ my $build = $ENV{RC_ProjectBuildVersion};
+ $vers .= "~$build" if defined($build) && $build ne '';
+} else {
+ if(defined($name) && $name ne '') {
+ $vers = $name;
+ } else {
+ require Cwd;
+ $vers = Cwd::cwd();
+ $name = time();
+ }
+}
+printf "const char __%s_version[] = \"@(#) %s %s\";\n", $name, $vers,
+ POSIX::strftime("%x %X %Z", localtime());