[26177] trunk/base

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 15 03:11:24 PDT 2007


Revision: 26177
          http://trac.macosforge.org/projects/macports/changeset/26177
Author:   jmpp at macports.org
Date:     2007-06-15 03:11:22 -0700 (Fri, 15 Jun 2007)

Log Message:
-----------

Finally merging the dp2mp-move branch into trunk, woot!

This basically means all strings in our sources,
whether it's something we output to the user or something
internal, such as a function/proc naming, are entirely in
the macports namespace and we no longer mix darwinports
with apple with macports strings.

It also means we now have new paths in svn and on
the client side at installation time, added to a
cleaner structure under ${prefix}/var/. Read
http://trac.macports.org/projects/macports/wiki/MacPortsRenaming
for more information.

NOTE: This commit also marks the rsync server finally
being moved over to the macosforge boxes, with the new
layout outlined in the dp2mp-move branch in place.
DNS entries still point to the old rsync server for
macports, however, so sync'ing/selfupdating an installation
based on these sources will be temporarily broken
until dns refresh.

To developers and testers, please do test the upgrade
target in the main base/Makefile as thouroughly as
possible and report any bugs/shortcomings/unexpected_behavior
to me, thanks!

Modified Paths:
--------------
    trunk/base/ChangeLog
    trunk/base/Makefile.in
    trunk/base/ReleaseProcess
    trunk/base/aclocal.m4
    trunk/base/config/Makefile
    trunk/base/config/README.TXT
    trunk/base/config/RELEASE_URL
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/doc/INTERNALS
    trunk/base/doc/Makefile
    trunk/base/doc/exampleport/Portfile
    trunk/base/doc/portfile.7
    trunk/base/doc/portgroup.7
    trunk/base/doc/porthier.7
    trunk/base/doc/portstyle.7
    trunk/base/doc/prefix.mtree.in
    trunk/base/doc/sources.conf
    trunk/base/doc/variants.conf
    trunk/base/portmgr/IndexRegen.sh
    trunk/base/portmgr/autosubmit.tcl
    trunk/base/portmgr/dmg/ReadMe.rtf
    trunk/base/portmgr/dmg/postflight
    trunk/base/src/Makefile.in
    trunk/base/src/cflib1.0/Makefile
    trunk/base/src/darwintracelib1.0/Makefile
    trunk/base/src/package1.0/Makefile
    trunk/base/src/package1.0/package.tcl
    trunk/base/src/package1.0/portarchive.tcl
    trunk/base/src/package1.0/portdmg.tcl
    trunk/base/src/package1.0/portdpkg.tcl
    trunk/base/src/package1.0/portmpkg.tcl
    trunk/base/src/package1.0/portpkg.tcl
    trunk/base/src/package1.0/portrpmpackage.tcl
    trunk/base/src/package1.0/portunarchive.tcl
    trunk/base/src/pextlib1.0/Makefile
    trunk/base/src/pextlib1.0/Pextlib.c
    trunk/base/src/pextlib1.0/compat.c
    trunk/base/src/pextlib1.0/compat.h
    trunk/base/src/pextlib1.0/curl.c
    trunk/base/src/pextlib1.0/curl.h
    trunk/base/src/pextlib1.0/filemap.c
    trunk/base/src/pextlib1.0/filemap.h
    trunk/base/src/pextlib1.0/readline.c
    trunk/base/src/pextlib1.0/rmd160cmd.h
    trunk/base/src/pextlib1.0/strcasecmp.c
    trunk/base/src/pextlib1.0/strcasecmp.h
    trunk/base/src/pextlib1.0/tests/curl.tcl
    trunk/base/src/pextlib1.0/uid.c
    trunk/base/src/pextlib1.0/uid.h
    trunk/base/src/pextlib1.0/vercomp.c
    trunk/base/src/pextlib1.0/vercomp.h
    trunk/base/src/pextlib1.0/xinstall.c
    trunk/base/src/port/Makefile
    trunk/base/src/port/port.1
    trunk/base/src/port/port.tcl
    trunk/base/src/port/portindex.tcl
    trunk/base/src/port/portmirror.tcl
    trunk/base/src/port1.0/Makefile
    trunk/base/src/port1.0/port.tcl
    trunk/base/src/port1.0/portactivate.tcl
    trunk/base/src/port1.0/portbuild.tcl
    trunk/base/src/port1.0/portchecksum.tcl
    trunk/base/src/port1.0/portclean.tcl
    trunk/base/src/port1.0/portconfigure.tcl
    trunk/base/src/port1.0/portdestroot.tcl
    trunk/base/src/port1.0/portdistcheck.tcl
    trunk/base/src/port1.0/portextract.tcl
    trunk/base/src/port1.0/portfetch.tcl
    trunk/base/src/port1.0/portinstall.tcl
    trunk/base/src/port1.0/portlivecheck.tcl
    trunk/base/src/port1.0/portmain.tcl
    trunk/base/src/port1.0/portmirror.tcl
    trunk/base/src/port1.0/portpatch.tcl
    trunk/base/src/port1.0/portstartupitem.tcl
    trunk/base/src/port1.0/portsubmit.tcl
    trunk/base/src/port1.0/porttest.tcl
    trunk/base/src/port1.0/porttrace.tcl
    trunk/base/src/port1.0/portutil.tcl
    trunk/base/src/port1.0/resources/Makefile
    trunk/base/src/port1.0/resources/fetch/Makefile
    trunk/base/src/port1.0/resources/group/Makefile
    trunk/base/src/port1.0/resources/group/gnustep-1.0.tcl
    trunk/base/src/port1.0/resources/group/python-1.0.tcl
    trunk/base/src/port1.0/resources/group/python24-1.0.tcl
    trunk/base/src/port1.0/resources/package/Makefile
    trunk/base/src/port1.0/tests/portutil.tcl
    trunk/base/src/portindex/initialize.sql
    trunk/base/src/programs/Makefile.in
    trunk/base/src/programs/daemondo/Makefile.in
    trunk/base/src/programs/daemondo/main.c
    trunk/base/src/registry1.0/Makefile
    trunk/base/src/registry1.0/portimage.tcl
    trunk/base/src/registry1.0/receipt_flat.tcl
    trunk/base/src/registry1.0/receipt_sqlite.tcl
    trunk/base/src/registry1.0/registry.tcl
    trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.h
    trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.m
    trunk/base/src/tclobjc1.0/Makefile.in
    trunk/base/src/tclobjc1.0/objc_encoding.h
    trunk/base/src/tclobjc1.0/objc_encoding.m
    trunk/base/src/tclobjc1.0/tclobjc.h
    trunk/base/src/tclobjc1.0/tclobjc.m
    trunk/base/src/tclobjc1.0/tclobjc_types.h
    trunk/base/src/tclobjc1.0/tclobjc_types.m
    trunk/base/src/thread2.6.diff
    trunk/base/tests/Makefile
    trunk/base/tests/sources.conf
    trunk/base/tests/test/envvariables/Makefile
    trunk/base/tests/test/trace/Makefile
    trunk/base/tests/test/universal/Makefile
    trunk/base/tests/test/universal-2/Makefile

Added Paths:
-----------
    trunk/base/Mk/macports.autoconf.mk.in
    trunk/base/Mk/macports.subdir.mk
    trunk/base/Mk/macports.tea.mk
    trunk/base/config/dp_version
    trunk/base/config/mp_version
    trunk/base/doc/macports.conf.5
    trunk/base/doc/macports.conf.in
    trunk/base/foundation.m4
    trunk/base/objc.m4
    trunk/base/portmgr/mprsyncup.new
    trunk/base/portmgr/packaging/
    trunk/base/portmgr/packaging/PortIndex2MySQL.tcl
    trunk/base/portmgr/packaging/SETUP.chroot.sh
    trunk/base/portmgr/packaging/buildall.sh
    trunk/base/portmgr/packaging/dpkgall.tcl
    trunk/base/portmgr/packaging/mpkgall.tcl
    trunk/base/portmgr/packaging/packageall.tcl
    trunk/base/portmgr/packaging/rpmall.tcl
    trunk/base/portmgr/rsync.repos
    trunk/base/src/macports1.0/
    trunk/base/src/macports1.0/Makefile
    trunk/base/src/macports1.0/macports.c
    trunk/base/src/macports1.0/macports.h
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/macports1.0/macports_autoconf.tcl.in
    trunk/base/src/macports1.0/macports_dlist.tcl
    trunk/base/src/macports1.0/macports_fastload.tcl.in
    trunk/base/src/macports1.0/macports_index.tcl
    trunk/base/src/macports1.0/macports_util.tcl
    trunk/base/src/macports1.0/options.h
    trunk/base/src/macports1.0/portconf.c
    trunk/base/src/macports1.0/session.c
    trunk/base/src/macports1.0/session.h
    trunk/base/src/macports1.0/test_util.tcl
    trunk/base/src/macports1.0/tests/
    trunk/base/src/macports1.0/tests/macports_dlist.tcl
    trunk/base/src/macports1.0/util.c
    trunk/base/src/macports1.0/util.h
    trunk/base/src/sqlite-3.1.3.diff
    trunk/base/src/sqlite-3.1.3.tar.gz
    trunk/base/tests/test-macports.conf

Removed Paths:
-------------
    trunk/base/Mk/dports.autoconf.mk.in
    trunk/base/Mk/dports.subdir.mk
    trunk/base/Mk/dports.tea.mk
    trunk/base/config/dp_version
    trunk/base/doc/README.platforms
    trunk/base/doc/ports.conf.5
    trunk/base/doc/ports.conf.in
    trunk/base/foundation.m4
    trunk/base/objc.m4
    trunk/base/portmgr/Makefile
    trunk/base/portmgr/PortIndex2MySQL.tcl
    trunk/base/portmgr/SETUP.chroot.sh
    trunk/base/portmgr/buildall.sh
    trunk/base/portmgr/dpkgall.tcl
    trunk/base/portmgr/mpkgall.tcl
    trunk/base/portmgr/packageall.tcl
    trunk/base/portmgr/packaging/PortIndex2MySQL.tcl
    trunk/base/portmgr/packaging/SETUP.chroot.sh
    trunk/base/portmgr/packaging/buildall.sh
    trunk/base/portmgr/packaging/dpkgall.tcl
    trunk/base/portmgr/packaging/mpkgall.tcl
    trunk/base/portmgr/packaging/packageall.tcl
    trunk/base/portmgr/packaging/rpmall.tcl
    trunk/base/portmgr/rpmall.tcl
    trunk/base/src/darwinports1.0/
    trunk/base/src/macports1.0/Makefile
    trunk/base/src/macports1.0/macports.c
    trunk/base/src/macports1.0/macports.h
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/macports1.0/macports_autoconf.tcl.in
    trunk/base/src/macports1.0/macports_dlist.tcl
    trunk/base/src/macports1.0/macports_fastload.tcl.in
    trunk/base/src/macports1.0/macports_index.tcl
    trunk/base/src/macports1.0/macports_util.tcl
    trunk/base/src/macports1.0/options.h
    trunk/base/src/macports1.0/portconf.c
    trunk/base/src/macports1.0/session.c
    trunk/base/src/macports1.0/session.h
    trunk/base/src/macports1.0/test_util.tcl
    trunk/base/src/macports1.0/tests/
    trunk/base/src/macports1.0/tests/macports_dlist.tcl
    trunk/base/src/macports1.0/util.c
    trunk/base/src/macports1.0/util.h
    trunk/base/src/sqlite-3.1.3.diff
    trunk/base/src/sqlite-3.1.3.tar.gz
    trunk/base/tests/test-ports.conf

Property Changed:
----------------
    trunk/base/src/thread2.6.diff

Modified: trunk/base/ChangeLog
===================================================================
--- trunk/base/ChangeLog	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/ChangeLog	2007-06-15 10:11:22 UTC (rev 26177)
@@ -6,22 +6,6 @@
 
 (unreleased)
 
-    - Fix port variants calculation to properly account for negated variants and
-      to detect problems between required and negated variants
-      (ticket #11920, eridius r26036, patch by gwhitney).
-
-    - Add global methods lpush, lpop, lshift, and lunshift. Works similar to
-      lappend (in fact lpush is just lappend) and do what they sound like.
-      Also add ldindex. Works like lindex, but deletes the element from the list.
-      Documented in portfile.7 (eridius r26034).
-    
-    - Add global methods try and throw. Implemented based on the specification
-      in TIP #89. Documented in portfile.7 (eridius r26034).
-
-    - Handle encodings properly now. All Portfiles and .conf files are assumed
-      to be utf-8, and reading them or calling portindex(1) should now work
-      the same on all locales (ticket #11978, eridius r25975).
-
     - Add support for decoding of obscured maintainer addresses.
       We support two types of obscured addresses in Portfile maintainers field:
          (1) username ==> implies username at macports.org

Modified: trunk/base/Makefile.in
===================================================================
--- trunk/base/Makefile.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/Makefile.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,4 +1,6 @@
-SUBDIR		= config doc src portmgr
+# $Id$
+
+SUBDIR		= config doc src
 DISTDIR		= dist
 DISTVER		=
 DISTTAG		= release_${subst .,_,${DISTVER}}
@@ -7,11 +9,11 @@
 DISTARCNAME	= ${DISTNAME}-archive
 SVNURL		= http://svn.macports.org/repository/macports
 
-include Mk/dports.autoconf.mk
+include Mk/macports.autoconf.mk
 
-all:: Mk/dports.autoconf.mk
+all:: Mk/macports.autoconf.mk
 
-Mk/dports.autoconf.mk: Mk/dports.autoconf.mk.in src/config.h.in Makefile.in config.status
+Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in config.status
 	./config.status
 	make clean
 
@@ -24,23 +26,143 @@
 		echo "Source tree not configured. Use ./configure" ; \
 	fi
 
-include Mk/dports.subdir.mk
+upgrade:
+	@echo -e "\nUpgrading your existing MacPorts installation to the new layout:\n"
 
+# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now be installed onto
+# ${TCL_PACKAGE_DIR}/macports1.0 with new names:
+	[ ! -d ${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -rf ${TCL_PACKAGE_DIR}/darwinports1.0
+
+# MacPorts base files in ${datadir} are also safely removed as new ones are always installed, and onto a their new location in this case too:
+	[ ! -d ${datadir}/darwinports ] || rm -rf ${datadir}/darwinports
+
+# Old version file can be safely deleted, as it was already used to start this upgrade and a new one will be installed into the new location:
+	[ ! -f ${sysconfdir}/ports/dp_version ] || rm -vf ${sysconfdir}/ports/dp_version
+
+# Old ports.conf(5) man page is removed:
+	[ ! -f ${prefix}/share/man/man5/ports.conf.5 ] || rm -vf ${prefix}/share/man/man5/ports.conf.5
+
+# Conf files directory is renamed:
+	[ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
+
+# Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first:
+	[ -d ${localstatedir}/macports ] || mkdir -vp ${localstatedir}/macports
+	for dir in distfiles packages receipts software; do \
+		[ ! -d ${localstatedir}/db/dports/$${dir} ] || mv -v ${localstatedir}/db/dports/$${dir} ${localstatedir}/macports ; \
+	done
+
+# Move the default ports tree to the new layout:
+	[ ! -d ${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ] || { mkdir -vp \
+	${localstatedir}/macports/sources/rsync.macports.org/release && mv -v \
+	${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ${localstatedir}/macports/sources/rsync.macports.org/release/ports ; }
+
+# Open up receipts and upgrade any paths in them containing old conventions to the new namespace:
+	for receipt in ${localstatedir}/macports/receipts/*/*/receipt.bz2 ; do [ ! \( -f $${receipt} -a ! -f $${receipt}.mpsaved \) ] || { \
+		cp -v $${receipt} $${receipt}.mpsaved && { \
+			$(BZIP2) -q -dc $${receipt} | sed 's/db\/dports/macports/g' | $(BZIP2) -q -zf > $${receipt}.new ; \
+		} && mv -v $${receipt}.new $${receipt} ; \
+	}; done
+
+# Check for existance of the main configuration file and perform a couple of replacements on it, backing it up first:
+## 1) new default path up to our configuration files (referenced through other variables);
+## 2) new default value for the portdbpath variable;
+## 3) new MacPorts rsync server;
+## 4) new default value for the base tree;
+## 5) new default value for trunk's base sources for users who have it (some do);
+## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
+## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
+## 8) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
+	[ ! \( -f ${sysconfdir}/macports/ports.conf -a ! -f ${sysconfdir}/macports/macports.conf.mpsaved \) ] || { \
+		mv -v ${sysconfdir}/macports/ports.conf ${sysconfdir}/macports/macports.conf.mpsaved; \
+		sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf.mpsaved > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/db\/dports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/darwinports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/dpupdate1\/base/release\/base/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed '/^rsync_options/s/"\(.*\)"/\1/' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/ ports.conf(5)/ macports.conf(5)/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+		sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
+	}
+
+# Check for existance of the main sources file and perform a couple of replacements on it, backing it up first:
+## 1) new MacPorts rsync server;
+## 2) new default value for the ports tree.
+	[ ! \( -f ${sysconfdir}/macports/sources.conf -a ! -f ${sysconfdir}/macports/sources.conf.mpsaved \) ] || { \
+		cp -v ${sysconfdir}/macports/sources.conf ${sysconfdir}/macports/sources.conf.mpsaved; \
+		sed 's/darwinports/macports/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
+			mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
+		sed 's/dpupdate\/dports/release\/ports\//g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
+			mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
+	}
+
+# Check for existance of a personal configuration file and perform a couple of replacements on it, backing it up first:
+## 1) new default path up to our configuration files (referenced through other variables);
+## 2) new default value for the portdbpath variable;
+## 3) new MacPorts rsync server;
+## 4) new default value for the base tree;
+## 5) new default value for trunk's base sources for users who have it (some do);
+## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
+## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
+## 8) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
+	[ ! \( -f $${HOME}/.macports/ports.conf -a ! -f $${HOME}/.macports/macports.conf.mpsaved \) ] || { \
+		mv -v $${HOME}/.macports/ports.conf $${HOME}/.macports/macports.conf.mpsaved; \
+		sed 's/etc\/ports/etc\/macports/g' $${HOME}/.macports/macports.conf.mpsaved > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/db\/dports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/darwinports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/dpupdate1\/base/release\/base/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed '/^rsync_options/s/"\(.*\)"/\1/' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/ ports.conf(5)/ macports.conf(5)/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+	}
+
+
+#something more?
+
+# Upgrade success announcement (meaning we're done ;):
+	@echo -e "\nMacPorts installation successfully upgraded from the old DarwinPorts namespace!\n"
+
+####
+# NOTES:
+#    -) should we use the ${DESTDIR} sandbox?
+#    -) should we force moves?
+#    -) maybe I can regroup at least some of the sed calls?
+#    -) 
+####
+
+install:: upgrade
+
+include Mk/macports.subdir.mk
+
 install::
-	@echo ""
-	@echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:"
-	@echo ""
-	@echo "sudo port selfupdate"
-	@echo ""
-	@echo "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation."
-	@echo ""
+	@echo -e "\nCongratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:\n"
+	@echo -e "sudo port selfupdate\n"
+	@echo -e "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation.\n"
+	@echo -e "Stray sources might have been left in the legacy ${localstatedir}/db/dports directory after this upgrade,"
+	@echo -e "which moved most of what it could to ${localstatedir}/macports, so you might want to look in the former and cleanup manually.\n"
 
 clean::
 
 distclean::
 	rm -f config.log config.status configure.lineno
 	rm -rf autom4te.cache ${DISTDIR}
-	rm -f Makefile Mk/dports.autoconf.mk
+	rm -f Makefile Mk/macports.autoconf.mk
 
 _gettag:
 	cd ${DISTDIR}; svn co ${SVNURL}/tags/${SVNTAG} ${PKGNAME}-svn

Deleted: trunk/base/Mk/dports.autoconf.mk.in
===================================================================
--- trunk/base/Mk/dports.autoconf.mk.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/Mk/dports.autoconf.mk.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,59 +0,0 @@
-SHELL			= @SHELL@
-
-
-srcdir			= @srcdir@
-VPATH			= @srcdir@
-
-CC			= @CC@
-CFLAGS			= @CFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_WERROR) $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) $(CPPFLAGS) $(CFLAGS_LIBCURL)
-OBJCFLAGS		= @OBJCFLAGS@ $(CFLAGS_WERROR) ${CFLAGS_DEBUG}  $(CFLAGS_OPTIMIZE) $(CPPFLAGS) $(CFLAGS_LIBCURL)
-CPPFLAGS		= @CPPFLAGS@ @DEFS@ @INCLUDES@ @TCL_INCLUDES@
-TCL_DEFS		= @TCL_DEFS@
-SHLIB_CFLAGS		= @SHLIB_CFLAGS@
-CFLAGS_DEBUG		= @CFLAGS_DEBUG@
-CFLAGS_OPTIMIZE		= @CFLAGS_OPTIMIZE@
-CFLAGS_QUICHEEATERS	= @CFLAGS_QUICHEEATERS@
-CFLAGS_WERROR		= @CFLAGS_WERROR@
-CFLAGS_LIBCURL		= @CFLAGS_LIBCURL@
-
-OBJC_RUNTIME		= @OBJC_RUNTIME@
-OBJC_RUNTIME_FLAGS	= @OBJC_RUNTIME_FLAGS@
-OBJC_LIBS		= @OBJC_LIBS@
-
-TCL_CC			= @TCL_CC@
-SHLIB_LD		= @SHLIB_LD@
-LDFLAGS_LIBCURL		= @LDFLAGS_LIBCURL@
-LDFLAGS			=  -L/usr/local/lib @LDFLAGS@ $(LDFLAGS_LIBCURL)
-SHLIB_LDFLAGS		= @SHLIB_LDFLAGS@ ${LDFLAGS}
-SHLIB_SUFFIX		= @SHLIB_SUFFIX@
-TCL_STUB_LIB_SPEC	= @TCL_STUB_LIB_SPEC@
-
-LIBS			= @LIBS@
-MD5_LIBS		= @MD5_LIBS@
-SQLITE3_LIBS		= @SQLITE3_LIBS@
-INSTALL			= @INSTALL@
-MTREE			= @MTREE@
-LN_S			= @LN_S@
-XCODEBUILD		= @XCODEBUILD@
-
-TCLSH			= @TCLSH@
-TCL_PACKAGE_DIR		= @TCL_PACKAGE_DIR@
-
-DSTUSR			= @DSTUSR@
-DSTGRP			= @DSTGRP@
-DSTMODE			= @DSTMODE@
-
-
-prefix			= @prefix@
-sysconfdir		= @sysconfdir@
-exec_prefix		= @exec_prefix@
-bindir			= @bindir@
-datadir			= @datadir@
-libdir			= @libdir@
-localstatedir		= @localstatedir@
-infodir			= @infodir@
-
-portconfigdir		= @PORTCONFIGDIR@
-dportsdir		= @DPORTSDIR@
-
-SILENT			= @

Deleted: trunk/base/Mk/dports.subdir.mk
===================================================================
--- trunk/base/Mk/dports.subdir.mk	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/Mk/dports.subdir.mk	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,27 +0,0 @@
-.PHONY : all
-.PHONY : clean distclean
-.PHONY : install
-
-all::
-	@for subdir in $(SUBDIR); do\
-		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
-		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
-	done
-
-clean distclean::
-	@for subdir in $(SUBDIR); do\
-		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
-		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
-	done
-
-test::
-	@for subdir in $(SUBDIR); do\
-		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
-		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
-	done
-
-install::
-	@for subdir in $(SUBDIR); do\
-		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
-		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
-	done

Deleted: trunk/base/Mk/dports.tea.mk
===================================================================
--- trunk/base/Mk/dports.tea.mk	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/Mk/dports.tea.mk	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,22 +0,0 @@
-.SUFFIXES: .m
-
-.m.o:
-	${CC} -c -DUSE_TCL_STUBS ${OBJCFLAGS} ${TCL_DEFS} ${SHLIB_CFLAGS} $< -o $@
-
-.c.o:
-	${CC} -c -DUSE_TCL_STUBS ${CFLAGS} ${TCL_DEFS} ${SHLIB_CFLAGS} $< -o $@
-
-$(SHLIB_NAME):: ${OBJS}
-	${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS} ${MD5_LIBS} ${SQLITE3_LIBS}
-
-all:: ${SHLIB_NAME}
-
-clean::
-	rm -f ${OBJS} ${SHLIB_NAME} so_locations
-
-distclean:: clean
-
-install:: all
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
-	$(SILENT) $(TCLSH) ../pkg_mkindex.tcl ${INSTALLDIR}

Copied: trunk/base/Mk/macports.autoconf.mk.in (from rev 26176, branches/dp2mp-move/base/Mk/macports.autoconf.mk.in)
===================================================================
--- trunk/base/Mk/macports.autoconf.mk.in	                        (rev 0)
+++ trunk/base/Mk/macports.autoconf.mk.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,60 @@
+SHELL			= @SHELL@
+
+
+srcdir			= @srcdir@
+VPATH			= @srcdir@
+
+CC			= @CC@
+CFLAGS			= @CFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_WERROR) $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) $(CPPFLAGS) $(CFLAGS_LIBCURL)
+OBJCFLAGS		= @OBJCFLAGS@ $(CFLAGS_WERROR) ${CFLAGS_DEBUG}  $(CFLAGS_OPTIMIZE) $(CPPFLAGS) $(CFLAGS_LIBCURL)
+CPPFLAGS		= @CPPFLAGS@ @DEFS@ @INCLUDES@ @TCL_INCLUDES@
+TCL_DEFS		= @TCL_DEFS@
+SHLIB_CFLAGS		= @SHLIB_CFLAGS@
+CFLAGS_DEBUG		= @CFLAGS_DEBUG@
+CFLAGS_OPTIMIZE		= @CFLAGS_OPTIMIZE@
+CFLAGS_QUICHEEATERS	= @CFLAGS_QUICHEEATERS@
+CFLAGS_WERROR		= @CFLAGS_WERROR@
+CFLAGS_LIBCURL		= @CFLAGS_LIBCURL@
+
+OBJC_RUNTIME		= @OBJC_RUNTIME@
+OBJC_RUNTIME_FLAGS	= @OBJC_RUNTIME_FLAGS@
+OBJC_LIBS		= @OBJC_LIBS@
+
+TCL_CC			= @TCL_CC@
+SHLIB_LD		= @SHLIB_LD@
+LDFLAGS_LIBCURL		= @LDFLAGS_LIBCURL@
+LDFLAGS			=  -L/usr/local/lib @LDFLAGS@ $(LDFLAGS_LIBCURL)
+SHLIB_LDFLAGS		= @SHLIB_LDFLAGS@ ${LDFLAGS}
+SHLIB_SUFFIX		= @SHLIB_SUFFIX@
+TCL_STUB_LIB_SPEC	= @TCL_STUB_LIB_SPEC@
+
+LIBS			= @LIBS@
+MD5_LIBS		= @MD5_LIBS@
+SQLITE3_LIBS		= @SQLITE3_LIBS@
+INSTALL			= @INSTALL@
+MTREE			= @MTREE@
+LN_S			= @LN_S@
+XCODEBUILD		= @XCODEBUILD@
+BZIP2			= @BZIP2@
+
+TCLSH			= @TCLSH@
+TCL_PACKAGE_DIR		= @TCL_PACKAGE_DIR@
+
+DSTUSR			= @DSTUSR@
+DSTGRP			= @DSTGRP@
+DSTMODE			= @DSTMODE@
+
+
+prefix			= @prefix@
+sysconfdir		= @sysconfdir@
+exec_prefix		= @exec_prefix@
+bindir			= @bindir@
+datadir			= @datadir@
+libdir			= @libdir@
+localstatedir		= @localstatedir@
+infodir			= @infodir@
+
+mpconfigdir		= @MPCONFIGDIR@
+portsdir		= @PORTSDIR@
+
+SILENT			= @

Copied: trunk/base/Mk/macports.subdir.mk (from rev 26176, branches/dp2mp-move/base/Mk/macports.subdir.mk)
===================================================================
--- trunk/base/Mk/macports.subdir.mk	                        (rev 0)
+++ trunk/base/Mk/macports.subdir.mk	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,27 @@
+.PHONY : all
+.PHONY : clean distclean
+.PHONY : install
+
+all::
+	@for subdir in $(SUBDIR); do\
+		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
+		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
+	done
+
+clean distclean::
+	@for subdir in $(SUBDIR); do\
+		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
+		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
+	done
+
+test::
+	@for subdir in $(SUBDIR); do\
+		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
+		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
+	done
+
+install::
+	@for subdir in $(SUBDIR); do\
+		echo ===\> making $@ in ${DIRPRFX}$$subdir; \
+		( cd $$subdir && $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ $@) || exit 1; \
+	done

Copied: trunk/base/Mk/macports.tea.mk (from rev 26176, branches/dp2mp-move/base/Mk/macports.tea.mk)
===================================================================
--- trunk/base/Mk/macports.tea.mk	                        (rev 0)
+++ trunk/base/Mk/macports.tea.mk	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,22 @@
+.SUFFIXES: .m
+
+.m.o:
+	${CC} -c -DUSE_TCL_STUBS ${OBJCFLAGS} ${TCL_DEFS} ${SHLIB_CFLAGS} $< -o $@
+
+.c.o:
+	${CC} -c -DUSE_TCL_STUBS ${CFLAGS} ${TCL_DEFS} ${SHLIB_CFLAGS} $< -o $@
+
+$(SHLIB_NAME):: ${OBJS}
+	${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS} ${MD5_LIBS} ${SQLITE3_LIBS}
+
+all:: ${SHLIB_NAME}
+
+clean::
+	rm -f ${OBJS} ${SHLIB_NAME} so_locations
+
+distclean:: clean
+
+install:: all
+	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
+	$(SILENT) $(TCLSH) ../pkg_mkindex.tcl ${INSTALLDIR}

Modified: trunk/base/ReleaseProcess
===================================================================
--- trunk/base/ReleaseProcess	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/ReleaseProcess	2007-06-15 10:11:22 UTC (rev 26177)
@@ -48,7 +48,7 @@
 In preparation for a release, several things should be completed within the code:
 
 * Update the file base/ChangeLog in both trunk and the relase branch to reflect the appropriate changes.
-* Update the file base/config/dp_version with the target release number. Note that this is a floating point number that corresponds to the release number; it should correspond roughly to the release number where possible. Release 1.4.1, for instance, would be represented by the floating point number 1.41. The version number in dp_version is displayed by the port command as the version of MacPorts, and is used by the selfupdate command to determine whether a newer version of code is available. This number should be different between trunk and a release branch and the former should be updated as needed to differentiate it from the latter.
+* Update the file base/config/mp_version with the target release number. Note that this is a floating point number that corresponds to the release number; it should correspond roughly to the release number where possible. Release 1.4.1, for instance, would be represented by the floating point number 1.41. The version number in mp_version is displayed by the port command as the version of MacPorts, and is used by the selfupdate command to determine whether a newer version of code is available. This number should be different between trunk and a release branch and the former should be updated as needed to differentiate it from the latter.
 * Make sure that these, and any other changes or bug fixes are made on and/or merged between the release branch and trunk as needded. For instance, if you've made changes to ChangeLog only on the release branch, those changes should be merged back into trunk as well.
 
 

Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/aclocal.m4	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 builtin(include,foundation.m4)
 
 #------------------------------------------------------------------------
-# OD_CHECK_FRAMEWORK_COREFOUNDATION --
+# MP_CHECK_FRAMEWORK_COREFOUNDATION --
 #
 #	Check if CoreFoundation framework is available, define HAVE_FRAMEWORK_COREFOUNDATION if so.
 #
@@ -23,12 +23,12 @@
 #		HAVE_FRAMEWORK_COREFOUNDATION
 #
 #------------------------------------------------------------------------
-AC_DEFUN(OD_CHECK_FRAMEWORK_COREFOUNDATION, [
+AC_DEFUN(MP_CHECK_FRAMEWORK_COREFOUNDATION, [
 	FRAMEWORK_LIBS="-framework CoreFoundation"
 
 	AC_MSG_CHECKING([for CoreFoundation framework])
 
-	AC_CACHE_VAL(od_cv_have_framework_corefoundation, [
+	AC_CACHE_VAL(mp_cv_have_framework_corefoundation, [
 		ac_save_LIBS="$LIBS"
 		LIBS="$FRAMEWORK_LIBS $LIBS"
 		
@@ -40,18 +40,18 @@
 					CFArrayRef bundles = CFBundleCreateBundlesFromDirectory(NULL, url, CFSTR("pkg"));
 			])
 			], [
-				od_cv_have_framework_corefoundation="yes"
+				mp_cv_have_framework_corefoundation="yes"
 			], [
-				od_cv_have_framework_corefoundation="no"
+				mp_cv_have_framework_corefoundation="no"
 			]
 		)
 
 		LIBS="$ac_save_LIBS"
 	])
 
-	AC_MSG_RESULT(${od_cv_have_framework_corefoundation})
+	AC_MSG_RESULT(${mp_cv_have_framework_corefoundation})
 
-	if test x"${od_cv_have_framework_corefoundation}" = "xyes"; then
+	if test x"${mp_cv_have_framework_corefoundation}" = "xyes"; then
 		AC_DEFINE([HAVE_FRAMEWORK_COREFOUNDATION], [], [Define if CoreFoundation framework is available])
 	fi
 
@@ -60,7 +60,7 @@
 
 
 #------------------------------------------------------------------------
-# OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER --
+# MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER --
 #
 #	Check if if the routine CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
 #	is available in CoreFoundation.
@@ -81,12 +81,12 @@
 #		HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
 #
 #------------------------------------------------------------------------
-AC_DEFUN(OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER, [
+AC_DEFUN(MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER, [
 	FRAMEWORK_LIBS="-framework CoreFoundation"
 
 	AC_MSG_CHECKING([for CFNotificationCenterGetDarwinNotifyCenter])
 
-	AC_CACHE_VAL(od_cv_have_function_cfnotificationcentergetdarwinnotifycenter, [
+	AC_CACHE_VAL(mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter, [
 		ac_save_LIBS="$LIBS"
 		LIBS="$FRAMEWORK_LIBS $LIBS"
 		
@@ -97,18 +97,18 @@
 					CFNotificationCenterRef ref = CFNotificationCenterGetDarwinNotifyCenter();
 			])
 			], [
-				od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
+				mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
 			], [
-				od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
+				mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
 			]
 		)
 
 		LIBS="$ac_save_LIBS"
 	])
 
-	AC_MSG_RESULT(${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter})
+	AC_MSG_RESULT(${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter})
 
-	if test x"${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
+	if test x"${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
 		AC_DEFINE([HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER], [], [Define if function CFNotificationCenterGetDarwinNotifyCenter in CoreFoundation framework])
 	fi
 
@@ -117,7 +117,7 @@
 
 
 #------------------------------------------------------------------------
-# OD_CHECK_FRAMEWORK_SYSTEMCONFIGURATION --
+# MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION --
 #
 #	Check if SystemConfiguration framework is available, define HAVE_FRAMEWORK_SYSTEMCONFIGURATION if so.
 #
@@ -137,12 +137,12 @@
 #		HAVE_FRAMEWORK_SYSTEMCONFIGURATION
 #
 #------------------------------------------------------------------------
-AC_DEFUN(OD_CHECK_FRAMEWORK_SYSTEMCONFIGURATION, [
+AC_DEFUN(MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION, [
 	FRAMEWORK_LIBS="-framework SystemConfiguration"
 
 	AC_MSG_CHECKING([for SystemConfiguration framework])
 
-	AC_CACHE_VAL(od_cv_have_framework_systemconfiguration, [
+	AC_CACHE_VAL(mp_cv_have_framework_systemconfiguration, [
 		ac_save_LIBS="$LIBS"
 		LIBS="$FRAMEWORK_LIBS $LIBS"
 		
@@ -154,18 +154,18 @@
 					SCDynamicStoreRef dsRef = SCDynamicStoreCreate(NULL, NULL, NULL, NULL);
 			])
 			], [
-				od_cv_have_framework_systemconfiguration="yes"
+				mp_cv_have_framework_systemconfiguration="yes"
 			], [
-				od_cv_have_framework_systemconfiguration="no"
+				mp_cv_have_framework_systemconfiguration="no"
 			]
 		)
 
 		LIBS="$ac_save_LIBS"
 	])
 
-	AC_MSG_RESULT(${od_cv_have_framework_systemconfiguration})
+	AC_MSG_RESULT(${mp_cv_have_framework_systemconfiguration})
 
-	if test x"${od_cv_have_framework_systemconfiguration}" = "xyes"; then
+	if test x"${mp_cv_have_framework_systemconfiguration}" = "xyes"; then
 		AC_DEFINE([HAVE_FRAMEWORK_SYSTEMCONFIGURATION], [], [Define if SystemConfiguration framework is available])
 	fi
 
@@ -174,7 +174,7 @@
 
 
 #------------------------------------------------------------------------
-# OD_CHECK_FRAMEWORK_IOKIT --
+# MP_CHECK_FRAMEWORK_IOKIT --
 #
 #	Check if IOKit framework is available, define HAVE_FRAMEWORK_IOKIT if so.
 #
@@ -194,12 +194,12 @@
 #		HAVE_FRAMEWORK_IOKIT
 #
 #------------------------------------------------------------------------
-AC_DEFUN(OD_CHECK_FRAMEWORK_IOKIT, [
+AC_DEFUN(MP_CHECK_FRAMEWORK_IOKIT, [
 	FRAMEWORK_LIBS="-framework IOKit"
 
 	AC_MSG_CHECKING([for IOKit framework])
 
-	AC_CACHE_VAL(od_cv_have_framework_iokit, [
+	AC_CACHE_VAL(mp_cv_have_framework_iokit, [
 		ac_save_LIBS="$LIBS"
 		LIBS="$FRAMEWORK_LIBS $LIBS"
 		
@@ -211,18 +211,18 @@
 					IORegisterForSystemPower(0, NULL, NULL, NULL);
 			])
 			], [
-				od_cv_have_framework_iokit="yes"
+				mp_cv_have_framework_iokit="yes"
 			], [
-				od_cv_have_framework_iokit="no"
+				mp_cv_have_framework_iokit="no"
 			]
 		)
 
 		LIBS="$ac_save_LIBS"
 	])
 
-	AC_MSG_RESULT(${od_cv_have_framework_iokit})
+	AC_MSG_RESULT(${mp_cv_have_framework_iokit})
 
-	if test x"${od_cv_have_framework_iokit}" = "xyes"; then
+	if test x"${mp_cv_have_framework_iokit}" = "xyes"; then
 		AC_DEFINE([HAVE_FRAMEWORK_IOKIT], [], [Define if IOKit framework is available])
 	fi
 
@@ -230,68 +230,68 @@
 ])
 
 
-dnl This macro checks if the user specified a dports tree
+dnl This macro checks if the user specified a ports tree
 dnl explicitly. If not, search for it
 
-# OD_PATH_DPORTSDIR(DEFAULT_DPORTSDIR)
+# MP_PATH_PORTSDIR(DEFAULT_PORTSDIR)
 #---------------------------------------
- AC_DEFUN([OD_PATH_DPORTSDIR],[
+ AC_DEFUN([MP_PATH_PORTSDIR],[
  	dnl For ease of reading, run after gcc has been found/configured
  	AC_REQUIRE([AC_PROG_CC])
 
- 	AC_ARG_WITH(dports-dir, [AC_HELP_STRING([--with-dports-dir=DIR], [Specify alternate dports directory])], [ dportsdir="$withval" ] )
+ 	AC_ARG_WITH(ports-dir, [AC_HELP_STRING([--with-ports-dir=DIR], [Specify alternate ports directory])], [ portsdir="$withval" ] )
 
 
- 	AC_MSG_CHECKING([for dports tree])
- 	if test "x$dportsdir" != "x" ; then
- 	  if test -d "$dportsdir" -a -e "$dportsdir/PortIndex" ; then
+ 	AC_MSG_CHECKING([for ports tree])
+ 	if test "x$portsdir" != "x" ; then
+ 	  if test -d "$portsdir" -a -e "$portsdir/PortIndex" ; then
  		:
  	  else
- 		AC_MSG_ERROR([$dportsdir not a valid dports tree])
+ 		AC_MSG_ERROR([$portsdir not a valid ports tree])
  	  fi
  	else
  		dnl If the user didn't give a path, look for default
  		if test "x$1" != "x" ; then
  		  if test -d "$1" -a -e "$1/PortIndex" ; then
- 			dportsdir=$1
+ 			portsdir=$1
  		  fi
  		fi
  	fi
 
- 	if test "x$dportsdir" != "x" ; then
- 		AC_MSG_RESULT($dportsdir)
- 		DPORTSDIR="$dportsdir"
- 		AC_SUBST(DPORTSDIR)
+ 	if test "x$portsdir" != "x" ; then
+ 		AC_MSG_RESULT($portsdir)
+ 		PORTSDIR="$portsdir"
+ 		AC_SUBST(PORTSDIR)
  	else
- 		AC_MSG_WARN([No dports tree found])
+ 		AC_MSG_WARN([No ports tree found])
  	fi
 
          ])
 
 
-# OD_PATH_PORTCONFIGDIR
+# MP_PATH_MPCONFIGDIR
 #---------------------------------------
-AC_DEFUN([OD_PATH_PORTCONFIGDIR],[
+AC_DEFUN([MP_PATH_MPCONFIGDIR],[
 	dnl if the user actually specified --prefix, shift
-	dnl portconfigdir to $prefix/etc/ports
-	dnl 	AC_REQUIRE([OD_PATH_DPORTSDIR])
+	dnl mpconfigdir to $prefix/etc/macports
+	dnl 	AC_REQUIRE([MP_PATH_PORTSDIR])
 	
-        AC_MSG_CHECKING([for ports config directory])
+        AC_MSG_CHECKING([for MacPorts config directory])
 
-	portconfigdir='${sysconfdir}/ports'
+	mpconfigdir='${sysconfdir}/macports'
 
-	AC_MSG_RESULT([$portconfigdir])
-	PORTCONFIGDIR="$portconfigdir"
-        AC_SUBST(PORTCONFIGDIR)
+	AC_MSG_RESULT([$mpconfigdir])
+	MPCONFIGDIR="$mpconfigdir"
+        AC_SUBST(MPCONFIGDIR)
 
 	])
 
-# OD_CHECK_INSTALLUSER
+# MP_CHECK_INSTALLUSER
 #-------------------------------------------------
-AC_DEFUN([OD_CHECK_INSTALLUSER],[
+AC_DEFUN([MP_CHECK_INSTALLUSER],[
 	dnl if with user specifies --with-install-user,
 	dnl use it. otherwise default to platform defaults
-        AC_REQUIRE([OD_PATH_PORTCONFIGDIR])
+        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
 	AC_ARG_WITH(install-user, [AC_HELP_STRING([--with-install-user=USER], [Specify user ownership of installed files])], [ DSTUSR=$withval ] )
 	
@@ -304,12 +304,12 @@
 	AC_SUBST(DSTUSR)
 ])
 
-# OD_CHECK_INSTALLGROUP
+# MP_CHECK_INSTALLGROUP
 #-------------------------------------------------
-AC_DEFUN([OD_CHECK_INSTALLGROUP],[
+AC_DEFUN([MP_CHECK_INSTALLGROUP],[
 	dnl if with user specifies --with-install-group,
 	dnl use it. otherwise default to platform defaults
-        AC_REQUIRE([OD_CHECK_INSTALLUSER])
+        AC_REQUIRE([MP_CHECK_INSTALLUSER])
 
 	AC_ARG_WITH(install-group, [AC_HELP_STRING([--with-install-group=GROUP], [Specify group ownership of installed files])], [ DSTGRP=$withval ] )
 
@@ -330,13 +330,13 @@
 	AC_SUBST(DSTGRP)
 ])
 
-# OD_DIRECTORY_MODE
+# MP_DIRECTORY_MODE
 #-------------------------------------------------
-AC_DEFUN([OD_DIRECTORY_MODE],[
+AC_DEFUN([MP_DIRECTORY_MODE],[
 	dnl if with user specifies --with-directory-mode,
 	dnl use the specified permissions for ${prefix} directories
 	dnl otherwise use 0775
-        AC_REQUIRE([OD_PATH_PORTCONFIGDIR])
+        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
 	AC_ARG_WITH(directory-mode, [AC_HELP_STRING([--with-directory-mode=MODE], [Specify directory mode of installed directories])], [ DSTMODE=$withval ] )
 	
@@ -349,10 +349,10 @@
 	AC_SUBST(DSTMODE)
 ])
 
-# OD_LIB_MD5
+# MP_LIB_MD5
 #---------------------------------------
 # Check for an md5 implementation
-AC_DEFUN([OD_LIB_MD5],[
+AC_DEFUN([MP_LIB_MD5],[
 
 	# Check for libmd, which is prefered
 	AC_CHECK_LIB([md], [MD5Update],[
@@ -400,9 +400,9 @@
 dnl present, so must the headers be. If nothing is present,
 dnl print a warning
 
-# OD_CHECK_X11
+# MP_CHECK_X11
 # ---------------------
-AC_DEFUN([OD_CHECK_X11], [
+AC_DEFUN([MP_CHECK_X11], [
 
 	AC_PATH_XTRA
 
@@ -428,7 +428,7 @@
 		"__no__yes__")
 		# either the user said --without-x, or it was not found
 		# at all (runtime or headers)
-			AC_MSG_WARN([X11 not available. You will not be able to use dports that use X11])
+			AC_MSG_WARN([X11 not available. You will not be able to use ports that use X11])
 			state=0
 			;;
 		"__yes__yes__")
@@ -484,9 +484,9 @@
 
 ])
 
-# OD_PROG_XAR
+# MP_PROG_XAR
 #---------------------------------------
-AC_DEFUN([OD_PROG_XAR],[
+AC_DEFUN([MP_PROG_XAR],[
 
 	AC_PATH_PROG([XAR], [xar], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
 
@@ -499,22 +499,22 @@
 	AC_SUBST(XAR)
 ])
 
-# OD_PROG_DAEMONDO
+# MP_PROG_DAEMONDO
 #---------------------------------------
-AC_DEFUN([OD_PROG_DAEMONDO],[
-	AC_REQUIRE([OD_CHECK_FRAMEWORK_COREFOUNDATION])
-	AC_REQUIRE([OD_CHECK_FRAMEWORK_SYSTEMCONFIGURATION])
-	AC_REQUIRE([OD_CHECK_FRAMEWORK_IOKIT])
-	AC_REQUIRE([OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER])
+AC_DEFUN([MP_PROG_DAEMONDO],[
+	AC_REQUIRE([MP_CHECK_FRAMEWORK_COREFOUNDATION])
+	AC_REQUIRE([MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION])
+	AC_REQUIRE([MP_CHECK_FRAMEWORK_IOKIT])
+	AC_REQUIRE([MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER])
 	
     AC_MSG_CHECKING(for whether we will build daemondo)
     result=no
 	case $host_os in
 	darwin*)
-		if test "x$od_cv_have_framework_corefoundation" == "xyes" &&
-		   test "x$od_cv_have_framework_systemconfiguration" == "xyes" &&
-		   test "x$od_cv_have_framework_iokit" == "xyes" &&
-		   test "x$od_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
+		if test "x$mp_cv_have_framework_corefoundation" == "xyes" &&
+		   test "x$mp_cv_have_framework_systemconfiguration" == "xyes" &&
+		   test "x$mp_cv_have_framework_iokit" == "xyes" &&
+		   test "x$mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
 			result=yes
 			EXTRA_PROGS="$EXTRA_PROGS daemondo"
 			AC_CONFIG_FILES([src/programs/daemondo/Makefile])
@@ -526,7 +526,7 @@
 ])
 
 #------------------------------------------------------------------------
-# OD_TCL_PACKAGE_DIR --
+# MP_TCL_PACKAGE_DIR --
 #
 #	Locate the correct directory for Tcl package installation
 #
@@ -547,7 +547,7 @@
 #		TCL_PACKAGE_DIR
 #------------------------------------------------------------------------
 
-AC_DEFUN(OD_TCL_PACKAGE_DIR, [
+AC_DEFUN(MP_TCL_PACKAGE_DIR, [
     AC_MSG_CHECKING(for Tcl package directory)
 
     AC_ARG_WITH(tclpackage, [  --with-tclpackage       Tcl package installation directory.], with_tclpackagedir=${withval})
@@ -607,17 +607,12 @@
     AC_SUBST(TCL_PACKAGE_DIR)
 ])
 
-# OD_PROG_TCLSH
+# MP_PROG_TCLSH
 #---------------------------------------
-AC_DEFUN([OD_PROG_TCLSH],[
+AC_DEFUN([MP_PROG_TCLSH],[
 
 
 	case $host_os in
-		freebsd*)
-			# FreeBSD installs a dummy tclsh (annoying)
-			# Look for a real versioned tclsh first
-			AC_PATH_PROG([TCLSH], [tclsh${TCL_VERSION} tclsh])
-			;;
 		*)
 			# Otherwise, look for a non-versioned tclsh
 			AC_PATH_PROG([TCLSH], [tclsh tclsh${TCL_VERSION}])
@@ -630,14 +625,14 @@
 	AC_SUBST(TCLSH)
 ])
 
-# OD_TCL_PACKAGE
+# MP_TCL_PACKAGE
 #	Determine if a Tcl package is present.
 #
 # Arguments:
 #	Package name (may include the version)
 #
 # Syntax:
-#   OD_TCL_PACKAGE (package, [action-if-found], [action-if-not-found])
+#   MP_TCL_PACKAGE (package, [action-if-found], [action-if-not-found])
 #
 # Requires:
 #	TCLSH must be set
@@ -645,13 +640,13 @@
 # Results:
 #	Execute action-if-found or action-if-not-found
 #---------------------------------------
-AC_DEFUN([OD_TCL_PACKAGE],[
+AC_DEFUN([MP_TCL_PACKAGE],[
 	AC_MSG_CHECKING([for Tcl $1 package])
 	package_present=`echo 'if {[[catch {package require $1}]]} {puts -nonewline 0} else {puts -nonewline 1}' | $TCLSH`
 	AS_IF([test "$package_present" = "1"], [$2], [$3])[]
 ])
 
-# OD_TCL_THREAD_SUPPORT
+# MP_TCL_THREAD_SUPPORT
 #	Determine if thread support is available in tclsh.
 #
 # Arguments:
@@ -663,7 +658,7 @@
 # Results:
 #   Fails if thread support isn't available.
 #---------------------------------------
-AC_DEFUN([OD_TCL_THREAD_SUPPORT],[
+AC_DEFUN([MP_TCL_THREAD_SUPPORT],[
 	AC_MSG_CHECKING([whether tclsh was compiled with threads])
 	tcl_threadenabled=`echo 'puts -nonewline [[info exists tcl_platform(threaded)]]' | $TCLSH`
 	if test "$tcl_threadenabled" = "1" ; then
@@ -674,7 +669,7 @@
 	fi
 ])
 
-# OD_LIBCURL_FLAGS
+# MP_LIBCURL_FLAGS
 #	Sets the flags to compile with libcurl.
 #
 # Arguments:
@@ -687,7 +682,7 @@
 #   defines some help strings.
 #   sets CFLAGS_LIBCURL and LDFLAGS_LIBCURL
 #---------------------------------------
-AC_DEFUN([OD_LIBCURL_FLAGS],[
+AC_DEFUN([MP_LIBCURL_FLAGS],[
 	AC_ARG_WITH(curlprefix,
 		   [  --with-curlprefix       base directory for the cURL install '/usr', '/usr/local',...],
 		   [  curlprefix=$withval ])
@@ -711,7 +706,7 @@
 	AC_SUBST(LDFLAGS_LIBCURL)
 ])
 
-# OD_LIBCURL_VERSION
+# MP_LIBCURL_VERSION
 #	Determine the version of libcurl.
 #
 # Arguments:
@@ -723,7 +718,7 @@
 # Results:
 #   sets libcurl_version to "0" or some number
 #---------------------------------------
-AC_DEFUN([OD_LIBCURL_VERSION],[
+AC_DEFUN([MP_LIBCURL_VERSION],[
 	if test "x$CURL" = "x"; then
 		libcurl_version="0"
 	else
@@ -736,7 +731,7 @@
 
 dnl This macro tests if the compiler supports GCC's
 dnl __attribute__ syntax for unused variables/parameters
-AC_DEFUN([OD_COMPILER_ATTRIBUTE_UNUSED], [
+AC_DEFUN([MP_COMPILER_ATTRIBUTE_UNUSED], [
 	AC_MSG_CHECKING([how to mark unused variables])
 	AC_COMPILE_IFELSE(
 		[AC_LANG_SOURCE([[int a __attribute__ ((unused));]])],
@@ -747,10 +742,10 @@
 	
 ])
 
-dnl This macro ensures DP installation prefix bin/sbin paths are NOT in PATH
+dnl This macro ensures MP installation prefix bin/sbin paths are NOT in PATH
 dnl for configure to prevent potential problems when base/ code is updated
 dnl and ports are installed that would match needed items.
-AC_DEFUN([OD_PATH_SCAN],[
+AC_DEFUN([MP_PATH_SCAN],[
 	oldprefix=$prefix
 	if test "x$prefix" = "xNONE" ; then
 		prefix=$ac_default_prefix
@@ -775,7 +770,7 @@
 ])
 
 dnl This macro tests for tar support of --no-same-owner
-AC_DEFUN([OD_TAR_NO_SAME_OWNER],[
+AC_DEFUN([MP_TAR_NO_SAME_OWNER],[
 	AC_PATH_PROG(TAR, [tar])
 	AC_PATH_PROG(GNUTAR, [gnutar])
 	
@@ -795,7 +790,7 @@
 ])
 
 #------------------------------------------------------------------------
-# DP_CHECK_READLINK_IS_P1003_1A --
+# MP_CHECK_READLINK_IS_P1003_1A --
 #
 #	Check if readlink conforms to POSIX 1003.1a standard, define
 #	READLINK_IS_NOT_P1003_1A if it doesn't.
@@ -816,10 +811,10 @@
 #		READLINK_IS_NOT_P1003_1A
 #
 #------------------------------------------------------------------------
-AC_DEFUN(DP_CHECK_READLINK_IS_P1003_1A, [
+AC_DEFUN(MP_CHECK_READLINK_IS_P1003_1A, [
 	AC_MSG_CHECKING([if readlink conforms to POSIX 1003.1a])
 
-	AC_CACHE_VAL(dp_cv_readlink_is_posix_1003_1a, [
+	AC_CACHE_VAL(mp_cv_readlink_is_posix_1003_1a, [
 		AC_COMPILE_IFELSE([
 			AC_LANG_PROGRAM([
 					#include <unistd.h>
@@ -827,16 +822,16 @@
 				], [
 			])
 			], [
-				dp_cv_readlink_is_posix_1003_1a="yes"
+				mp_cv_readlink_is_posix_1003_1a="yes"
 			], [
-				dp_cv_readlink_is_posix_1003_1a="no"
+				mp_cv_readlink_is_posix_1003_1a="no"
 			]
 		)
 	])
 
-	AC_MSG_RESULT(${dp_cv_readlink_is_posix_1003_1a})
+	AC_MSG_RESULT(${mp_cv_readlink_is_posix_1003_1a})
 
-	if test x"${dp_cv_readlink_is_posix_1003_1a}" = "xno"; then
+	if test x"${mp_cv_readlink_is_posix_1003_1a}" = "xno"; then
 		AC_DEFINE([READLINK_IS_NOT_P1003_1A], [], [Define to 1 if readlink does not conform with POSIX 1003.1a (where third argument is a size_t and return value is a ssize_t)])
 	fi
 

Modified: trunk/base/config/Makefile
===================================================================
--- trunk/base/config/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/config/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,4 +1,4 @@
-include ../Mk/dports.autoconf.mk
+include ../Mk/macports.autoconf.mk
 
 all:
 
@@ -9,5 +9,5 @@
 distclean: clean
 
 install::
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${portconfigdir}
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 dp_version ${DESTDIR}${portconfigdir}
+	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${mpconfigdir}
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 mp_version ${DESTDIR}${mpconfigdir}

Modified: trunk/base/config/README.TXT
===================================================================
--- trunk/base/config/README.TXT	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/config/README.TXT	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 The file RELEASE_URL in this directory is used by the rsync infrastructure
-at macports to control the tag from which "released" code is provided,
-ultimately, at rsync://rsync.darwinports.org/dpupdate1/base.
+at the MacPorts server to control the tag from which "released" code is provided,
+ultimately at rsync://rsync.macports.org/release/base/.
 
 The script handling that operation checks out from svn the code tagged by the
-contents of the RELEASE_URL file, and makes that code available via rsync.
-The script is at /base/portmgr/mprsyncup.
+contents of the RELEASE_URL file and makes that code available via rsync.
+The script is svn at base/portmgr/mprsyncup.

Modified: trunk/base/config/RELEASE_URL
===================================================================
--- trunk/base/config/RELEASE_URL	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/config/RELEASE_URL	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1 +1 @@
-http://svn.macports.org/repository/macports/tags/release_1_4_42/
+http://svn.macports.org/repository/macports/tags/release_1_4_42/base

Deleted: trunk/base/config/dp_version
===================================================================
--- trunk/base/config/dp_version	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/config/dp_version	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1 +0,0 @@
-1.500

Copied: trunk/base/config/dp_version (from rev 26176, branches/dp2mp-move/base/config/dp_version)
===================================================================
--- trunk/base/config/dp_version	                        (rev 0)
+++ trunk/base/config/dp_version	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1 @@
+1.6

Copied: trunk/base/config/mp_version (from rev 26176, branches/dp2mp-move/base/config/mp_version)
===================================================================
--- trunk/base/config/mp_version	                        (rev 0)
+++ trunk/base/config/mp_version	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1 @@
+1.6

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/configure	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,28 +1,57 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for MacPorts 1.5.
+# Generated by GNU Autoconf 2.61 for MacPorts 1.6.
 #
 # Report bugs to <macports-dev at lists.macosforge.org>.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -31,8 +60,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -46,18 +110,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -65,157 +130,388 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
 fi
 
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
+  case $as_dir in
 	 /*)
-	   if ("$as_dir/$as_base" -c '
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
 
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf at gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -224,7 +520,28 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -233,89 +550,237 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
 
-# CDPATH.
-$as_unset CDPATH
+exec 7<&0 </dev/null 6>&1
 
-
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME='MacPorts'
 PACKAGE_TARNAME='macports'
-PACKAGE_VERSION='1.5'
-PACKAGE_STRING='MacPorts 1.5'
+PACKAGE_VERSION='1.6'
+PACKAGE_STRING='MacPorts 1.6'
 PACKAGE_BUGREPORT='macports-dev at lists.macosforge.org'
 
 ac_unique_file="src/pextlib1.0/Pextlib.c"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
 ac_default_prefix=/opt/local
-ac_subdirs_all="$ac_subdirs_all src/thread2.6"
-ac_subdirs_all="$ac_subdirs_all src/sqlite-3.1.3"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT OBJC OBJCFLAGS ac_ct_OBJC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LN_S MTREE CVS SVN RSYNC HAVE_LAUNCHD LAUNCHCTL XCODEBUILD BZIP2 XAR OPEN TAR GNUTAR TAR_CMD CFLAGS_QUICHEEATERS CFLAGS_WERROR OBJCPP EGREP OBJC_RUNTIME OBJC_RUNTIME_FLAGS OBJC_LIBS OBJC_PTHREAD_LIBS OBJC_PTHREAD_CFLAGS HAVE_FRAMEWORK_COREFOUNDATION HAVE_FRAMEWORK_SYSTEMCONFIGURATION HAVE_FRAMEWORK_IOKIT HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER REPLACEMENT_PROGS EXTRA_PROGS DPORTSDIR 
 PORTCONFIGDIR DSTUSR DSTGRP DSTMODE CPP READLINK_IS_NOT_P1003_1A MD5_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDES TCLSH TCL_PACKAGE_DIR CURL_CONFIG CFLAGS_LIBCURL LDFLAGS_LIBCURL subdirs SQLITE3_LIBS SQLITE3_DIR OUR_INCLUDED_PACKAGES INCLUDES CFLAGS_DEBUG CFLAGS_OPTIMIZE TCL_DEFS STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_SUFFIX TCL_CC prefix_expanded PORTCONFIGDIR_EXPANDED localstatedir_expanded LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+OBJC
+OBJCFLAGS
+ac_ct_OBJC
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+SET_MAKE
+LN_S
+MTREE
+CVS
+SVN
+RSYNC
+HAVE_LAUNCHD
+LAUNCHCTL
+XCODEBUILD
+BZIP2
+XAR
+OPEN
+TAR
+GNUTAR
+TAR_CMD
+CFLAGS_QUICHEEATERS
+CFLAGS_WERROR
+OBJCPP
+GREP
+EGREP
+OBJC_RUNTIME
+OBJC_RUNTIME_FLAGS
+OBJC_LIBS
+OBJC_PTHREAD_LIBS
+OBJC_PTHREAD_CFLAGS
+HAVE_FRAMEWORK_COREFOUNDATION
+HAVE_FRAMEWORK_SYSTEMCONFIGURATION
+HAVE_FRAMEWORK_IOKIT
+HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
+REPLACEMENT_PROGS
+EXTRA_PROGS
+PORTSDIR
+MPCONFIGDIR
+DSTUSR
+DSTGRP
+DSTMODE
+CPP
+READLINK_IS_NOT_P1003_1A
+MD5_LIBS
+XMKMF
+X_CFLAGS
+X_PRE_LIBS
+X_LIBS
+X_EXTRA_LIBS
+TCL_VERSION
+TCL_BIN_DIR
+TCL_SRC_DIR
+TCL_LIB_FILE
+TCL_LIB_FLAG
+TCL_LIB_SPEC
+TCL_STUB_LIB_FILE
+TCL_STUB_LIB_FLAG
+TCL_STUB_LIB_SPEC
+TCL_INCLUDES
+TCLSH
+TCL_PACKAGE_DIR
+CURL_CONFIG
+CFLAGS_LIBCURL
+LDFLAGS_LIBCURL
+subdirs
+SQLITE3_LIBS
+SQLITE3_DIR
+OUR_INCLUDED_PACKAGES
+INCLUDES
+CFLAGS_DEBUG
+CFLAGS_OPTIMIZE
+TCL_DEFS
+STLIB_LD
+SHLIB_LD
+SHLIB_CFLAGS
+SHLIB_LDFLAGS
+SHLIB_SUFFIX
+TCL_CC
+prefix_expanded
+MPCONFIGDIR_EXPANDED
+localstatedir_expanded
+LIBOBJS
+LTLIBOBJS'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+OBJC
+OBJCFLAGS
+MTREE
+CVS
+SVN
+RSYNC
+TAR
+GNUTAR
+BZIP2
+XAR
+OPEN
+OBJCPP
+CPP
+XMKMF'
+ac_subdirs_all='src/thread2.6
+src/sqlite-3.1.3'
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -342,34 +807,48 @@
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -391,33 +870,45 @@
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
 
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
   -enable-* | --enable-*)
     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -444,6 +935,12 @@
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -468,13 +965,16 @@
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -539,6 +1039,16 @@
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -591,24 +1101,20 @@
   -with-* | --with-*)
     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -639,8 +1145,7 @@
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -660,29 +1165,21 @@
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
 # There might be people who depend on the old broken behavior: `$host'
 # used to hold the argument of --host etc.
 # FIXME: To remove some day.
@@ -707,122 +1204,76 @@
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$0" : 'X\(//\)[^/]' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-  fi
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_OBJC_set=${OBJC+set}
-ac_env_OBJC_value=$OBJC
-ac_cv_env_OBJC_set=${OBJC+set}
-ac_cv_env_OBJC_value=$OBJC
-ac_env_OBJCFLAGS_set=${OBJCFLAGS+set}
-ac_env_OBJCFLAGS_value=$OBJCFLAGS
-ac_cv_env_OBJCFLAGS_set=${OBJCFLAGS+set}
-ac_cv_env_OBJCFLAGS_value=$OBJCFLAGS
-ac_env_MTREE_set=${MTREE+set}
-ac_env_MTREE_value=$MTREE
-ac_cv_env_MTREE_set=${MTREE+set}
-ac_cv_env_MTREE_value=$MTREE
-ac_env_CVS_set=${CVS+set}
-ac_env_CVS_value=$CVS
-ac_cv_env_CVS_set=${CVS+set}
-ac_cv_env_CVS_value=$CVS
-ac_env_SVN_set=${SVN+set}
-ac_env_SVN_value=$SVN
-ac_cv_env_SVN_set=${SVN+set}
-ac_cv_env_SVN_value=$SVN
-ac_env_RSYNC_set=${RSYNC+set}
-ac_env_RSYNC_value=$RSYNC
-ac_cv_env_RSYNC_set=${RSYNC+set}
-ac_cv_env_RSYNC_value=$RSYNC
-ac_env_TAR_set=${TAR+set}
-ac_env_TAR_value=$TAR
-ac_cv_env_TAR_set=${TAR+set}
-ac_cv_env_TAR_value=$TAR
-ac_env_GNUTAR_set=${GNUTAR+set}
-ac_env_GNUTAR_value=$GNUTAR
-ac_cv_env_GNUTAR_set=${GNUTAR+set}
-ac_cv_env_GNUTAR_value=$GNUTAR
-ac_env_BZIP2_set=${BZIP2+set}
-ac_env_BZIP2_value=$BZIP2
-ac_cv_env_BZIP2_set=${BZIP2+set}
-ac_cv_env_BZIP2_value=$BZIP2
-ac_env_XAR_set=${XAR+set}
-ac_env_XAR_value=$XAR
-ac_cv_env_XAR_set=${XAR+set}
-ac_cv_env_XAR_value=$XAR
-ac_env_OPEN_set=${OPEN+set}
-ac_env_OPEN_value=$OPEN
-ac_cv_env_OPEN_set=${OPEN+set}
-ac_cv_env_OPEN_value=$OPEN
-ac_env_OBJCPP_set=${OBJCPP+set}
-ac_env_OBJCPP_value=$OBJCPP
-ac_cv_env_OBJCPP_set=${OBJCPP+set}
-ac_cv_env_OBJCPP_value=$OBJCPP
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -831,7 +1282,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures MacPorts 1.5 to adapt to many kinds of systems.
+\`configure' configures MacPorts 1.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -851,9 +1302,6 @@
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
 			  [$ac_default_prefix]
@@ -871,15 +1319,22 @@
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/macports]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -897,7 +1352,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of MacPorts 1.5:";;
+     short | recursive ) echo "Configuration of MacPorts 1.6:";;
    esac
   cat <<\_ACEOF
 
@@ -912,7 +1367,7 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-objc-runtime     Specify either "GNU" or "apple"
   --with-objc-foundation  Specify either "GNUstep" or "apple"
-  --with-dports-dir=DIR   Specify alternate dports directory
+  --with-ports-dir=DIR    Specify alternate ports directory
   --with-install-user=USER
                           Specify user ownership of installed files
   --with-install-group=GROUP
@@ -934,8 +1389,9 @@
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   OBJC        Objective C compiler command
   OBJCFLAGS   Objective C compiler flags
   MTREE       path to mtree command
@@ -949,126 +1405,93 @@
   OPEN        path to open command
   OBJCPP      Objective C preprocessor
   CPP         C preprocessor
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <macports-dev at lists.macosforge.org>.
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-MacPorts configure 1.5
-generated by GNU Autoconf 2.59
+MacPorts configure 1.6
+generated by GNU Autoconf 2.61
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by MacPorts $as_me 1.5, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+It was created by MacPorts $as_me 1.6, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1087,7 +1510,7 @@
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1101,6 +1524,7 @@
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1122,7 +1546,6 @@
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1133,7 +1556,7 @@
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1155,9 +1578,7 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1168,8 +1589,8 @@
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1182,20 +1603,34 @@
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1206,22 +1641,28 @@
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1233,26 +1674,24 @@
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1283,14 +1722,17 @@
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1306,8 +1748,8 @@
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1319,12 +1761,11 @@
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1349,8 +1790,7 @@
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1367,11 +1807,6 @@
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
@@ -1396,111 +1831,165 @@
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+ac_config_headers="$ac_config_headers src/config.h"
 
-          ac_config_headers="$ac_config_headers src/config.h"
-
 ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
 if test "${ac_cv_target+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
 
 
 # The aliases save the names the user supplied, while $host etc.
@@ -1510,7 +1999,7 @@
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-# Check user PATH for DP paths, and remove as necessary.
+# Check user PATH for MP paths, and remove as necessary.
 
 	oldprefix=$prefix
 	if test "x$prefix" = "xNONE" ; then
@@ -1544,8 +2033,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1558,32 +2047,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1596,36 +2087,51 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1638,74 +2144,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+
   fi
-done
-done
-
 fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1719,7 +2185,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -1730,6 +2196,7 @@
   fi
 done
 done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -1747,22 +2214,23 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1775,36 +2243,38 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1817,29 +2287,45 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
@@ -1852,21 +2338,35 @@
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -1891,47 +2391,77 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
 	;;
-    conftest.$ac_ext )
-	# This is the source file.
-	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
@@ -1943,19 +2473,21 @@
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -1974,22 +2506,27 @@
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
 
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -2000,9 +2537,8 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
@@ -2016,14 +2552,14 @@
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2043,14 +2579,20 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -2068,12 +2610,12 @@
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2096,50 +2638,49 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2155,38 +2696,118 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2202,12 +2823,12 @@
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2241,12 +2862,17 @@
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2261,205 +2887,57 @@
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2476,8 +2954,8 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_OBJC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2490,25 +2968,27 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 OBJC=$ac_cv_prog_OBJC
 if test -n "$OBJC"; then
-  echo "$as_me:$LINENO: result: $OBJC" >&5
-echo "${ECHO_T}$OBJC" >&6
+  { echo "$as_me:$LINENO: result: $OBJC" >&5
+echo "${ECHO_T}$OBJC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$OBJC" && break
   done
 fi
@@ -2518,8 +2998,8 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2532,30 +3012,45 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_OBJC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC
 if test -n "$ac_ct_OBJC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_OBJC" >&5
-echo "${ECHO_T}$ac_ct_OBJC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_OBJC" >&5
+echo "${ECHO_T}$ac_ct_OBJC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_OBJC" && break
 done
-test -n "$ac_ct_OBJC" || ac_ct_OBJC="gcc"
 
-  OBJC=$ac_ct_OBJC
+  if test "x$ac_ct_OBJC" = x; then
+    OBJC="gcc"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJC=$ac_ct_OBJC
+  fi
 fi
 
 
@@ -2579,8 +3074,8 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-echo "$as_me:$LINENO: checking whether we are using the GNU Objective C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Objective C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Objective C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Objective C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_objc_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2603,46 +3098,42 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_objc_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objc_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_objc_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objc_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_objc_compiler_gnu" >&6; }
 GOBJC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_OBJCFLAGS=${OBJCFLAGS+set}
 ac_save_OBJCFLAGS=$OBJCFLAGS
 OBJCFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $OBJC accepts -g" >&5
-echo $ECHO_N "checking whether $OBJC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $OBJC accepts -g" >&5
+echo $ECHO_N "checking whether $OBJC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_objc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2662,38 +3153,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_objc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_objc_g=no
+	ac_cv_prog_objc_g=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_objc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_objc_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_objc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_objc_g" >&6; }
 if test "$ac_test_OBJCFLAGS" = set; then
   OBJCFLAGS=$ac_save_OBJCFLAGS
 elif test $ac_cv_prog_objc_g = yes; then
@@ -2728,8 +3215,8 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2751,7 +3238,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2770,21 +3257,22 @@
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -2794,50 +3282,51 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-	@echo 'ac_maketemp="$(MAKE)"'
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
 # Extract the first word of "mtree", so it can be a program name with args.
 set dummy mtree; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_MTREE+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2852,31 +3341,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MTREE="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 MTREE=$ac_cv_path_MTREE
-
 if test -n "$MTREE"; then
-  echo "$as_me:$LINENO: result: $MTREE" >&5
-echo "${ECHO_T}$MTREE" >&6
+  { echo "$as_me:$LINENO: result: $MTREE" >&5
+echo "${ECHO_T}$MTREE" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "cvs", so it can be a program name with args.
 set dummy cvs; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_CVS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2891,31 +3381,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CVS="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 CVS=$ac_cv_path_CVS
-
 if test -n "$CVS"; then
-  echo "$as_me:$LINENO: result: $CVS" >&5
-echo "${ECHO_T}$CVS" >&6
+  { echo "$as_me:$LINENO: result: $CVS" >&5
+echo "${ECHO_T}$CVS" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "svn", so it can be a program name with args.
 set dummy svn; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_SVN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2930,31 +3421,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 SVN=$ac_cv_path_SVN
-
 if test -n "$SVN"; then
-  echo "$as_me:$LINENO: result: $SVN" >&5
-echo "${ECHO_T}$SVN" >&6
+  { echo "$as_me:$LINENO: result: $SVN" >&5
+echo "${ECHO_T}$SVN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "rsync", so it can be a program name with args.
 set dummy rsync; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_RSYNC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2969,31 +3461,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_RSYNC="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 RSYNC=$ac_cv_path_RSYNC
-
 if test -n "$RSYNC"; then
-  echo "$as_me:$LINENO: result: $RSYNC" >&5
-echo "${ECHO_T}$RSYNC" >&6
+  { echo "$as_me:$LINENO: result: $RSYNC" >&5
+echo "${ECHO_T}$RSYNC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "launchd", so it can be a program name with args.
 set dummy launchd; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_HAVE_LAUNCHD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3006,29 +3499,31 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_HAVE_LAUNCHD="yes"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 HAVE_LAUNCHD=$ac_cv_prog_HAVE_LAUNCHD
 if test -n "$HAVE_LAUNCHD"; then
-  echo "$as_me:$LINENO: result: $HAVE_LAUNCHD" >&5
-echo "${ECHO_T}$HAVE_LAUNCHD" >&6
+  { echo "$as_me:$LINENO: result: $HAVE_LAUNCHD" >&5
+echo "${ECHO_T}$HAVE_LAUNCHD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "launchctl", so it can be a program name with args.
 set dummy launchctl; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_LAUNCHCTL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3043,31 +3538,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LAUNCHCTL="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 LAUNCHCTL=$ac_cv_path_LAUNCHCTL
-
 if test -n "$LAUNCHCTL"; then
-  echo "$as_me:$LINENO: result: $LAUNCHCTL" >&5
-echo "${ECHO_T}$LAUNCHCTL" >&6
+  { echo "$as_me:$LINENO: result: $LAUNCHCTL" >&5
+echo "${ECHO_T}$LAUNCHCTL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "xcodebuild", so it can be a program name with args.
 set dummy xcodebuild; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_XCODEBUILD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3082,31 +3578,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 XCODEBUILD=$ac_cv_path_XCODEBUILD
-
 if test -n "$XCODEBUILD"; then
-  echo "$as_me:$LINENO: result: $XCODEBUILD" >&5
-echo "${ECHO_T}$XCODEBUILD" >&6
+  { echo "$as_me:$LINENO: result: $XCODEBUILD" >&5
+echo "${ECHO_T}$XCODEBUILD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "bzip2", so it can be a program name with args.
 set dummy bzip2; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_BZIP2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3121,31 +3618,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 BZIP2=$ac_cv_path_BZIP2
-
 if test -n "$BZIP2"; then
-  echo "$as_me:$LINENO: result: $BZIP2" >&5
-echo "${ECHO_T}$BZIP2" >&6
+  { echo "$as_me:$LINENO: result: $BZIP2" >&5
+echo "${ECHO_T}$BZIP2" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "xar", so it can be a program name with args.
 set dummy xar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_XAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3160,31 +3658,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_XAR="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 XAR=$ac_cv_path_XAR
-
 if test -n "$XAR"; then
-  echo "$as_me:$LINENO: result: $XAR" >&5
-echo "${ECHO_T}$XAR" >&6
+  { echo "$as_me:$LINENO: result: $XAR" >&5
+echo "${ECHO_T}$XAR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "open", so it can be a program name with args.
 set dummy open; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_OPEN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3199,28 +3698,29 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_OPEN="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 OPEN=$ac_cv_path_OPEN
-
 if test -n "$OPEN"; then
-  echo "$as_me:$LINENO: result: $OPEN" >&5
-echo "${ECHO_T}$OPEN" >&6
+  { echo "$as_me:$LINENO: result: $OPEN" >&5
+echo "${ECHO_T}$OPEN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
+
 # Define some precious variables allowing user to override PATH for some programs
 
 
@@ -3235,8 +3735,8 @@
 
 	# Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_TAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3251,31 +3751,32 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 TAR=$ac_cv_path_TAR
-
 if test -n "$TAR"; then
-  echo "$as_me:$LINENO: result: $TAR" >&5
-echo "${ECHO_T}$TAR" >&6
+  { echo "$as_me:$LINENO: result: $TAR" >&5
+echo "${ECHO_T}$TAR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 	# Extract the first word of "gnutar", so it can be a program name with args.
 set dummy gnutar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_GNUTAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3290,49 +3791,50 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 GNUTAR=$ac_cv_path_GNUTAR
-
 if test -n "$GNUTAR"; then
-  echo "$as_me:$LINENO: result: $GNUTAR" >&5
-echo "${ECHO_T}$GNUTAR" >&6
+  { echo "$as_me:$LINENO: result: $GNUTAR" >&5
+echo "${ECHO_T}$GNUTAR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
-	echo "$as_me:$LINENO: checking for which tar variant to use" >&5
-echo $ECHO_N "checking for which tar variant to use... $ECHO_C" >&6
+
+	{ echo "$as_me:$LINENO: checking for which tar variant to use" >&5
+echo $ECHO_N "checking for which tar variant to use... $ECHO_C" >&6; }
 	if test -n "$GNUTAR"; then
   TAR_CMD=$GNUTAR
 else
   TAR_CMD=$TAR
 fi
 
-	echo "$as_me:$LINENO: result: $TAR_CMD" >&5
-echo "${ECHO_T}$TAR_CMD" >&6
+	{ echo "$as_me:$LINENO: result: $TAR_CMD" >&5
+echo "${ECHO_T}$TAR_CMD" >&6; }
 
 
-	echo "$as_me:$LINENO: checking for $TAR_CMD --no-same-owner support" >&5
-echo $ECHO_N "checking for $TAR_CMD --no-same-owner support... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for $TAR_CMD --no-same-owner support" >&5
+echo $ECHO_N "checking for $TAR_CMD --no-same-owner support... $ECHO_C" >&6; }
 	no_same_owner_support=`$TAR_CMD --help 2>&1 | grep no-same-owner`
 	if test -z "$no_same_owner_support" ; then
-		echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 	else
-		echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 		TAR_CMD="$TAR_CMD --no-same-owner"
 	fi
 
@@ -3344,13 +3846,13 @@
 
 
 
-	# Check whether --enable-werror or --disable-werror was given.
+	# Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then
-  enableval="$enable_werror"
-  enable_werror=${enableval}
+  enableval=$enable_werror; enable_werror=${enableval}
 else
   enable_werror=no
-fi;
+fi
+
 	if test x"$enable_werror" != "xno"; then
 		CFLAGS_WERROR="-Werror"
 	else
@@ -3361,8 +3863,8 @@
 
 
 
-	echo "$as_me:$LINENO: checking how to mark unused variables" >&5
-echo $ECHO_N "checking how to mark unused variables... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking how to mark unused variables" >&5
+echo $ECHO_N "checking how to mark unused variables... $ECHO_C" >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3372,27 +3874,22 @@
 int a __attribute__ ((unused));
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define UNUSED __attribute__((unused))
@@ -3402,20 +3899,21 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\_ACEOF
 #define UNUSED
 _ACEOF
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-	echo "$as_me:$LINENO: result: " >&5
-echo "${ECHO_T}" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+	{ echo "$as_me:$LINENO: result: " >&5
+echo "${ECHO_T}" >&6; }
 
 
-	echo "$as_me:$LINENO: checking for gcc symbol visibility attribute" >&5
-echo $ECHO_N "checking for gcc symbol visibility attribute... $ECHO_C" >&6
+
+	{ echo "$as_me:$LINENO: checking for gcc symbol visibility attribute" >&5
+echo $ECHO_N "checking for gcc symbol visibility attribute... $ECHO_C" >&6; }
 	if test "${mp_cv_attribute_mp_private+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3438,27 +3936,22 @@
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 			mp_cv_attribute_mp_private="__attribute__((visibility(\"hidden\")))"
 
@@ -3470,13 +3963,14 @@
 			mp_cv_attribute_mp_private="no"
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 
-	echo "$as_me:$LINENO: result: $mp_cv_attribute_mp_private" >&5
-echo "${ECHO_T}$mp_cv_attribute_mp_private" >&6
+	{ echo "$as_me:$LINENO: result: $mp_cv_attribute_mp_private" >&5
+echo "${ECHO_T}$mp_cv_attribute_mp_private" >&6; }
 
 	if test x"$mp_cv_attribute_mp_private" = "xno"; then
 		MP_PRIVATE=""
@@ -3498,8 +3992,8 @@
 ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_objc_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the Objective C preprocessor" >&5
-echo $ECHO_N "checking how to run the Objective C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the Objective C preprocessor" >&5
+echo $ECHO_N "checking how to run the Objective C preprocessor... $ECHO_C" >&6; }
 if test -z "$OBJCPP"; then
   if test "${ac_cv_prog_OBJCPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3529,24 +4023,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_objc_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_objc_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_objc_preproc_warn_flag$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3555,9 +4047,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3567,24 +4060,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_objc_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_objc_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_objc_preproc_warn_flag$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3595,6 +4086,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3612,8 +4104,8 @@
 else
   ac_cv_prog_OBJCPP=$OBJCPP
 fi
-echo "$as_me:$LINENO: result: $OBJCPP" >&5
-echo "${ECHO_T}$OBJCPP" >&6
+{ echo "$as_me:$LINENO: result: $OBJCPP" >&5
+echo "${ECHO_T}$OBJCPP" >&6; }
 ac_preproc_ok=false
 for ac_objc_preproc_warn_flag in '' yes
 do
@@ -3636,24 +4128,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_objc_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_objc_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_objc_preproc_warn_flag$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3662,9 +4152,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3674,24 +4165,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_objc_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_objc_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_objc_preproc_warn_flag$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3702,6 +4191,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3724,23 +4214,170 @@
 ac_compiler_gnu=$ac_cv_objc_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
 
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3764,36 +4401,32 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
@@ -3848,6 +4481,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3867,18 +4501,27 @@
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3891,12 +4534,14 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -3919,9 +4564,9 @@
 		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -3935,38 +4580,35 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -3980,12 +4622,12 @@
 
 
 
-# Check whether --with-objc-runtime or --without-objc-runtime was given.
+# Check whether --with-objc-runtime was given.
 if test "${with_objc_runtime+set}" = set; then
-  withval="$with_objc_runtime"
-  with_objc_runtime=${withval}
-fi;
+  withval=$with_objc_runtime; with_objc_runtime=${withval}
+fi
 
+
 	if test x"${with_objc_runtime}" != x; then
 		case "${with_objc_runtime}" in
 			GNU)
@@ -4012,18 +4654,19 @@
 for ac_header in objc/objc.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4034,41 +4677,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4077,24 +4716,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_objc_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_objc_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_objc_preproc_warn_flag$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -4102,9 +4739,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_objc_preproc_warn_flag in
@@ -4128,25 +4766,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
 ## ------------------------------------------------ ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4175,9 +4812,9 @@
 	# Test if pthreads are required to link against
 	# libobjc - this is the case on FreeBSD.
 
-	echo "$as_me:$LINENO: checking if linking libobjc requires pthreads" >&5
-echo $ECHO_N "checking if linking libobjc requires pthreads... $ECHO_C" >&6
-	if test "${od_cv_objc_req_pthread+set}" = set; then
+	{ echo "$as_me:$LINENO: checking if linking libobjc requires pthreads" >&5
+echo $ECHO_N "checking if linking libobjc requires pthreads... $ECHO_C" >&6; }
+	if test "${mp_cv_objc_req_pthread+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4209,30 +4846,26 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
 					# Linked without -pthread
-					od_cv_objc_req_pthread="no"
+					mp_cv_objc_req_pthread="no"
 
 else
   echo "$as_me: failed program was:" >&5
@@ -4240,15 +4873,16 @@
 
 
 					# Failed to link without -pthread
-					od_cv_objc_req_pthread="yes"
+					mp_cv_objc_req_pthread="yes"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 		# If the above failed, try with pthreads
-		if test x"${od_cv_objc_req_pthread}" = x"yes"; then
+		if test x"${mp_cv_objc_req_pthread}" = x"yes"; then
 			LIBS="${LIBS} ${PTHREAD_LIBS}"
 			OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
 			cat >conftest.$ac_ext <<_ACEOF
@@ -4275,30 +4909,26 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
 						# Linked with -lpthread
-						od_cv_objc_req_pthread="yes"
+						mp_cv_objc_req_pthread="yes"
 
 else
   echo "$as_me: failed program was:" >&5
@@ -4308,32 +4938,33 @@
 						# Failed to link against objc at all
 						# This will be caught in the runtime
 						# checks below
-						od_cv_objc_req_pthread="no"
+						mp_cv_objc_req_pthread="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 		fi
 
 fi
 
-	echo "$as_me:$LINENO: result: ${od_cv_objc_req_pthread}" >&5
-echo "${ECHO_T}${od_cv_objc_req_pthread}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_objc_req_pthread}" >&5
+echo "${ECHO_T}${mp_cv_objc_req_pthread}" >&6; }
 
-	if test x"${od_cv_objc_req_pthread}" = x"no"; then
+	if test x"${mp_cv_objc_req_pthread}" = x"no"; then
 		OBJC_LIBS="-lobjc"
 		OBJC_PTHREAD_LIBS="${PTHREAD_LIBS}"
 		OBJC_PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
-	elif test x"${od_cv_objc_req_pthread}" = x"yes"; then
+	elif test x"${mp_cv_objc_req_pthread}" = x"yes"; then
 		OBJC_LIBS="-lobjc ${PTHREAD_LIBS}"
 		OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
 	fi
 
 	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"apple"; then
-		echo "$as_me:$LINENO: checking for Apple Objective-C runtime" >&5
-echo $ECHO_N "checking for Apple Objective-C runtime... $ECHO_C" >&6
-		if test "${od_cv_objc_runtime_apple+set}" = set; then
+		{ echo "$as_me:$LINENO: checking for Apple Objective-C runtime" >&5
+echo $ECHO_N "checking for Apple Objective-C runtime... $ECHO_C" >&6; }
+		if test "${mp_cv_objc_runtime_apple+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4365,54 +4996,51 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-						od_cv_objc_runtime_apple="yes"
+						mp_cv_objc_runtime_apple="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-						od_cv_objc_runtime_apple="no"
+						mp_cv_objc_runtime_apple="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
 
-		echo "$as_me:$LINENO: result: ${od_cv_objc_runtime_apple}" >&5
-echo "${ECHO_T}${od_cv_objc_runtime_apple}" >&6
+		{ echo "$as_me:$LINENO: result: ${mp_cv_objc_runtime_apple}" >&5
+echo "${ECHO_T}${mp_cv_objc_runtime_apple}" >&6; }
 	else
-		od_cv_objc_runtime_apple="no"
+		mp_cv_objc_runtime_apple="no"
 	fi
 
 	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"GNU"; then
-		echo "$as_me:$LINENO: checking for GNU Objective C runtime" >&5
-echo $ECHO_N "checking for GNU Objective C runtime... $ECHO_C" >&6
-		if test "${od_cv_objc_runtime_gnu+set}" = set; then
+		{ echo "$as_me:$LINENO: checking for GNU Objective C runtime" >&5
+echo $ECHO_N "checking for GNU Objective C runtime... $ECHO_C" >&6; }
+		if test "${mp_cv_objc_runtime_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4444,52 +5072,49 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-						od_cv_objc_runtime_gnu="yes"
+						mp_cv_objc_runtime_gnu="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-						od_cv_objc_runtime_gnu="no"
+						mp_cv_objc_runtime_gnu="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
 
-		echo "$as_me:$LINENO: result: ${od_cv_objc_runtime_gnu}" >&5
-echo "${ECHO_T}${od_cv_objc_runtime_gnu}" >&6
+		{ echo "$as_me:$LINENO: result: ${mp_cv_objc_runtime_gnu}" >&5
+echo "${ECHO_T}${mp_cv_objc_runtime_gnu}" >&6; }
 	else
-		od_cv_objc_runtime_gnu="no"
+		mp_cv_objc_runtime_gnu="no"
 	fi
 
 	# Apple runtime is prefered
-	if test x"${od_cv_objc_runtime_apple}" = x"yes"; then
+	if test x"${mp_cv_objc_runtime_apple}" = x"yes"; then
 			OBJC_RUNTIME="APPLE_RUNTIME"
 			OBJC_RUNTIME_FLAGS="-fnext-runtime"
 			{ echo "$as_me:$LINENO: Using Apple Objective-C runtime" >&5
@@ -4499,7 +5124,7 @@
 #define APPLE_RUNTIME 1
 _ACEOF
 
-	elif test x"${od_cv_objc_runtime_gnu}" = x"yes"; then
+	elif test x"${mp_cv_objc_runtime_gnu}" = x"yes"; then
 			OBJC_RUNTIME="GNU_RUNTIME"
 			OBJC_RUNTIME_FLAGS="-fgnu-runtime"
 			{ echo "$as_me:$LINENO: Using GNU Objective-C runtime" >&5
@@ -4538,12 +5163,12 @@
 
 
 
-# Check whether --with-objc-foundation or --without-objc-foundation was given.
+# Check whether --with-objc-foundation was given.
 if test "${with_objc_foundation+set}" = set; then
-  withval="$with_objc_foundation"
-  with_objc_foundation=${withval}
-fi;
+  withval=$with_objc_foundation; with_objc_foundation=${withval}
+fi
 
+
 	if test x"${with_objc_foundation}" != x; then
 		case "${with_objc_foundation}" in
 			GNUstep)
@@ -4571,8 +5196,8 @@
 	if test x"${with_objc_foundation}" == x || test x"${with_objc_foundation}" == x"apple"; then
 		# '[' = '['
 		# ']' = ']'
-		echo "$as_me:$LINENO: checking for Apple Foundation library" >&5
-echo $ECHO_N "checking for Apple Foundation library... $ECHO_C" >&6
+		{ echo "$as_me:$LINENO: checking for Apple Foundation library" >&5
+echo $ECHO_N "checking for Apple Foundation library... $ECHO_C" >&6; }
 
 		# Set NeXT LIBS and CFLAGS
 		APPLE_FOUNDATION_CFLAGS="-framework Foundation"
@@ -4612,27 +5237,23 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
 						ac_cv_objc_foundation_apple="yes"
 
@@ -4645,7 +5266,8 @@
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 			# Restore LIBS and CFLAGS
 			LIBS="${LIBS_OLD}"
@@ -4653,8 +5275,8 @@
 
 fi
 
-		echo "$as_me:$LINENO: result: ${ac_cv_objc_foundation_apple}" >&5
-echo "${ECHO_T}${ac_cv_objc_foundation_apple}" >&6
+		{ echo "$as_me:$LINENO: result: ${ac_cv_objc_foundation_apple}" >&5
+echo "${ECHO_T}${ac_cv_objc_foundation_apple}" >&6; }
 	else
 		ac_cv_objc_foundation_apple="no"
 	fi
@@ -4671,8 +5293,8 @@
 			fi
 		else
 
-			echo "$as_me:$LINENO: checking for GNUstep Foundation library" >&5
-echo $ECHO_N "checking for GNUstep Foundation library... $ECHO_C" >&6
+			{ echo "$as_me:$LINENO: checking for GNUstep Foundation library" >&5
+echo $ECHO_N "checking for GNUstep Foundation library... $ECHO_C" >&6; }
 
 			# Set GNUstep LDFLAGS, CPPFLAGS, and LIBS
 			GNUSTEP_LDFLAGS="-L${GNUSTEP_SYSTEM_ROOT}/Library/Libraries/"
@@ -4715,27 +5337,23 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_objc_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
 							ac_cv_objc_foundation_gnustep="yes"
 
@@ -4748,7 +5366,8 @@
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 				# Restore LDFLAGS, CPPFLAGS, and LIBS
 				LDFLAGS="${LDFLAGS_OLD}"
@@ -4757,8 +5376,8 @@
 
 fi
 
-			echo "$as_me:$LINENO: result: ${ac_cv_objc_foundation_gnustep}" >&5
-echo "${ECHO_T}${ac_cv_objc_foundation_gnustep}" >&6
+			{ echo "$as_me:$LINENO: result: ${ac_cv_objc_foundation_gnustep}" >&5
+echo "${ECHO_T}${ac_cv_objc_foundation_gnustep}" >&6; }
 		fi
 	else
 		ac_cv_objc_foundation_gnustep="no"
@@ -4805,10 +5424,10 @@
 
 	FRAMEWORK_LIBS="-framework CoreFoundation"
 
-	echo "$as_me:$LINENO: checking for CoreFoundation framework" >&5
-echo $ECHO_N "checking for CoreFoundation framework... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for CoreFoundation framework" >&5
+echo $ECHO_N "checking for CoreFoundation framework... $ECHO_C" >&6; }
 
-	if test "${od_cv_have_framework_corefoundation+set}" = set; then
+	if test "${mp_cv_have_framework_corefoundation+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4838,40 +5457,37 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-				od_cv_have_framework_corefoundation="yes"
+				mp_cv_have_framework_corefoundation="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-				od_cv_have_framework_corefoundation="no"
+				mp_cv_have_framework_corefoundation="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 		LIBS="$ac_save_LIBS"
@@ -4879,10 +5495,10 @@
 fi
 
 
-	echo "$as_me:$LINENO: result: ${od_cv_have_framework_corefoundation}" >&5
-echo "${ECHO_T}${od_cv_have_framework_corefoundation}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_have_framework_corefoundation}" >&5
+echo "${ECHO_T}${mp_cv_have_framework_corefoundation}" >&6; }
 
-	if test x"${od_cv_have_framework_corefoundation}" = "xyes"; then
+	if test x"${mp_cv_have_framework_corefoundation}" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FRAMEWORK_COREFOUNDATION
@@ -4895,10 +5511,10 @@
 
 	FRAMEWORK_LIBS="-framework SystemConfiguration"
 
-	echo "$as_me:$LINENO: checking for SystemConfiguration framework" >&5
-echo $ECHO_N "checking for SystemConfiguration framework... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for SystemConfiguration framework" >&5
+echo $ECHO_N "checking for SystemConfiguration framework... $ECHO_C" >&6; }
 
-	if test "${od_cv_have_framework_systemconfiguration+set}" = set; then
+	if test "${mp_cv_have_framework_systemconfiguration+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4928,40 +5544,37 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-				od_cv_have_framework_systemconfiguration="yes"
+				mp_cv_have_framework_systemconfiguration="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-				od_cv_have_framework_systemconfiguration="no"
+				mp_cv_have_framework_systemconfiguration="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 		LIBS="$ac_save_LIBS"
@@ -4969,10 +5582,10 @@
 fi
 
 
-	echo "$as_me:$LINENO: result: ${od_cv_have_framework_systemconfiguration}" >&5
-echo "${ECHO_T}${od_cv_have_framework_systemconfiguration}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_have_framework_systemconfiguration}" >&5
+echo "${ECHO_T}${mp_cv_have_framework_systemconfiguration}" >&6; }
 
-	if test x"${od_cv_have_framework_systemconfiguration}" = "xyes"; then
+	if test x"${mp_cv_have_framework_systemconfiguration}" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FRAMEWORK_SYSTEMCONFIGURATION
@@ -4985,10 +5598,10 @@
 
 	FRAMEWORK_LIBS="-framework IOKit"
 
-	echo "$as_me:$LINENO: checking for IOKit framework" >&5
-echo $ECHO_N "checking for IOKit framework... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for IOKit framework" >&5
+echo $ECHO_N "checking for IOKit framework... $ECHO_C" >&6; }
 
-	if test "${od_cv_have_framework_iokit+set}" = set; then
+	if test "${mp_cv_have_framework_iokit+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -5018,40 +5631,37 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-				od_cv_have_framework_iokit="yes"
+				mp_cv_have_framework_iokit="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-				od_cv_have_framework_iokit="no"
+				mp_cv_have_framework_iokit="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 		LIBS="$ac_save_LIBS"
@@ -5059,10 +5669,10 @@
 fi
 
 
-	echo "$as_me:$LINENO: result: ${od_cv_have_framework_iokit}" >&5
-echo "${ECHO_T}${od_cv_have_framework_iokit}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_have_framework_iokit}" >&5
+echo "${ECHO_T}${mp_cv_have_framework_iokit}" >&6; }
 
-	if test x"${od_cv_have_framework_iokit}" = "xyes"; then
+	if test x"${mp_cv_have_framework_iokit}" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FRAMEWORK_IOKIT
@@ -5075,10 +5685,10 @@
 
 	FRAMEWORK_LIBS="-framework CoreFoundation"
 
-	echo "$as_me:$LINENO: checking for CFNotificationCenterGetDarwinNotifyCenter" >&5
-echo $ECHO_N "checking for CFNotificationCenterGetDarwinNotifyCenter... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for CFNotificationCenterGetDarwinNotifyCenter" >&5
+echo $ECHO_N "checking for CFNotificationCenterGetDarwinNotifyCenter... $ECHO_C" >&6; }
 
-	if test "${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter+set}" = set; then
+	if test "${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -5107,40 +5717,37 @@
 
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-				od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
+				mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-				od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
+				mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 		LIBS="$ac_save_LIBS"
@@ -5148,10 +5755,10 @@
 fi
 
 
-	echo "$as_me:$LINENO: result: ${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" >&5
-echo "${ECHO_T}${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" >&5
+echo "${ECHO_T}${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" >&6; }
 
-	if test x"${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
+	if test x"${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
@@ -5167,33 +5774,33 @@
 
 
 
-    echo "$as_me:$LINENO: checking for whether we will build daemondo" >&5
-echo $ECHO_N "checking for whether we will build daemondo... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for whether we will build daemondo" >&5
+echo $ECHO_N "checking for whether we will build daemondo... $ECHO_C" >&6; }
     result=no
 	case $host_os in
 	darwin*)
-		if test "x$od_cv_have_framework_corefoundation" == "xyes" &&
-		   test "x$od_cv_have_framework_systemconfiguration" == "xyes" &&
-		   test "x$od_cv_have_framework_iokit" == "xyes" &&
-		   test "x$od_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
+		if test "x$mp_cv_have_framework_corefoundation" == "xyes" &&
+		   test "x$mp_cv_have_framework_systemconfiguration" == "xyes" &&
+		   test "x$mp_cv_have_framework_iokit" == "xyes" &&
+		   test "x$mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
 			result=yes
 			EXTRA_PROGS="$EXTRA_PROGS daemondo"
-			          ac_config_files="$ac_config_files src/programs/daemondo/Makefile"
+			ac_config_files="$ac_config_files src/programs/daemondo/Makefile"
 
 		fi
 		;;
 	*)
 	esac
-	echo "$as_me:$LINENO: result: ${result}" >&5
-echo "${ECHO_T}${result}" >&6
+	{ echo "$as_me:$LINENO: result: ${result}" >&5
+echo "${ECHO_T}${result}" >&6; }
 
-#OD_PROG_XAR
+#MP_PROG_XAR
 
 
 
 
-# set default dports-directory
-DPORTS_DIR_DEFAULT=`pwd | sed -e "s/base/dports/"`
+# set default ports-directory
+PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
 
 # Check for paths
 
@@ -5201,52 +5808,52 @@
 
 
 
-# Check whether --with-dports-dir or --without-dports-dir was given.
-if test "${with_dports_dir+set}" = set; then
-  withval="$with_dports_dir"
-   dportsdir="$withval"
-fi;
+# Check whether --with-ports-dir was given.
+if test "${with_ports_dir+set}" = set; then
+  withval=$with_ports_dir;  portsdir="$withval"
+fi
 
 
- 	echo "$as_me:$LINENO: checking for dports tree" >&5
-echo $ECHO_N "checking for dports tree... $ECHO_C" >&6
- 	if test "x$dportsdir" != "x" ; then
- 	  if test -d "$dportsdir" -a -e "$dportsdir/PortIndex" ; then
+
+ 	{ echo "$as_me:$LINENO: checking for ports tree" >&5
+echo $ECHO_N "checking for ports tree... $ECHO_C" >&6; }
+ 	if test "x$portsdir" != "x" ; then
+ 	  if test -d "$portsdir" -a -e "$portsdir/PortIndex" ; then
  		:
  	  else
- 		{ { echo "$as_me:$LINENO: error: $dportsdir not a valid dports tree" >&5
-echo "$as_me: error: $dportsdir not a valid dports tree" >&2;}
+ 		{ { echo "$as_me:$LINENO: error: $portsdir not a valid ports tree" >&5
+echo "$as_me: error: $portsdir not a valid ports tree" >&2;}
    { (exit 1); exit 1; }; }
  	  fi
  	else
- 		 		if test "x$DPORTS_DIR_DEFAULT" != "x" ; then
- 		  if test -d "$DPORTS_DIR_DEFAULT" -a -e "$DPORTS_DIR_DEFAULT/PortIndex" ; then
- 			dportsdir=$DPORTS_DIR_DEFAULT
+ 		 		if test "x$PORTS_DIR_DEFAULT" != "x" ; then
+ 		  if test -d "$PORTS_DIR_DEFAULT" -a -e "$PORTS_DIR_DEFAULT/PortIndex" ; then
+ 			portsdir=$PORTS_DIR_DEFAULT
  		  fi
  		fi
  	fi
 
- 	if test "x$dportsdir" != "x" ; then
- 		echo "$as_me:$LINENO: result: $dportsdir" >&5
-echo "${ECHO_T}$dportsdir" >&6
- 		DPORTSDIR="$dportsdir"
+ 	if test "x$portsdir" != "x" ; then
+ 		{ echo "$as_me:$LINENO: result: $portsdir" >&5
+echo "${ECHO_T}$portsdir" >&6; }
+ 		PORTSDIR="$portsdir"
 
  	else
- 		{ echo "$as_me:$LINENO: WARNING: No dports tree found" >&5
-echo "$as_me: WARNING: No dports tree found" >&2;}
+ 		{ echo "$as_me:$LINENO: WARNING: No ports tree found" >&5
+echo "$as_me: WARNING: No ports tree found" >&2;}
  	fi
 
 
 
 
-        echo "$as_me:$LINENO: checking for ports config directory" >&5
-echo $ECHO_N "checking for ports config directory... $ECHO_C" >&6
+        { echo "$as_me:$LINENO: checking for MacPorts config directory" >&5
+echo $ECHO_N "checking for MacPorts config directory... $ECHO_C" >&6; }
 
-	portconfigdir='${sysconfdir}/ports'
+	mpconfigdir='${sysconfdir}/macports'
 
-	echo "$as_me:$LINENO: result: $portconfigdir" >&5
-echo "${ECHO_T}$portconfigdir" >&6
-	PORTCONFIGDIR="$portconfigdir"
+	{ echo "$as_me:$LINENO: result: $mpconfigdir" >&5
+echo "${ECHO_T}$mpconfigdir" >&6; }
+	MPCONFIGDIR="$mpconfigdir"
 
 
 
@@ -5256,34 +5863,34 @@
 
 
 
-# Check whether --with-install-user or --without-install-user was given.
+# Check whether --with-install-user was given.
 if test "${with_install_user+set}" = set; then
-  withval="$with_install_user"
-   DSTUSR=$withval
-fi;
+  withval=$with_install_user;  DSTUSR=$withval
+fi
 
-	echo "$as_me:$LINENO: checking for install user" >&5
-echo $ECHO_N "checking for install user... $ECHO_C" >&6
+
+	{ echo "$as_me:$LINENO: checking for install user" >&5
+echo $ECHO_N "checking for install user... $ECHO_C" >&6; }
 	if test "x$DSTUSR" = "x" ; then
 	   DSTUSR=root
 	fi
 
-	echo "$as_me:$LINENO: result: $DSTUSR" >&5
-echo "${ECHO_T}$DSTUSR" >&6
+	{ echo "$as_me:$LINENO: result: $DSTUSR" >&5
+echo "${ECHO_T}$DSTUSR" >&6; }
 
 
 
 
 
 
-# Check whether --with-install-group or --without-install-group was given.
+# Check whether --with-install-group was given.
 if test "${with_install_group+set}" = set; then
-  withval="$with_install_group"
-   DSTGRP=$withval
-fi;
+  withval=$with_install_group;  DSTGRP=$withval
+fi
 
-	echo "$as_me:$LINENO: checking for install group" >&5
-echo $ECHO_N "checking for install group... $ECHO_C" >&6
+
+	{ echo "$as_me:$LINENO: checking for install group" >&5
+echo $ECHO_N "checking for install group... $ECHO_C" >&6; }
 	if test "x$DSTGRP" = "x" ; then
 
 	   case $host_os in
@@ -5296,28 +5903,28 @@
 	   esac
 	fi
 
-	echo "$as_me:$LINENO: result: $DSTGRP" >&5
-echo "${ECHO_T}$DSTGRP" >&6
+	{ echo "$as_me:$LINENO: result: $DSTGRP" >&5
+echo "${ECHO_T}$DSTGRP" >&6; }
 
 
 
 
 
 
-# Check whether --with-directory-mode or --without-directory-mode was given.
+# Check whether --with-directory-mode was given.
 if test "${with_directory_mode+set}" = set; then
-  withval="$with_directory_mode"
-   DSTMODE=$withval
-fi;
+  withval=$with_directory_mode;  DSTMODE=$withval
+fi
 
-	echo "$as_me:$LINENO: checking what permissions to use for installation directories" >&5
-echo $ECHO_N "checking what permissions to use for installation directories... $ECHO_C" >&6
+
+	{ echo "$as_me:$LINENO: checking what permissions to use for installation directories" >&5
+echo $ECHO_N "checking what permissions to use for installation directories... $ECHO_C" >&6; }
 	if test "x$DSTMODE" = "x" ; then
 	   DSTMODE=0775
 	fi
 
-	echo "$as_me:$LINENO: result: $DSTMODE" >&5
-echo "${ECHO_T}$DSTMODE" >&6
+	{ echo "$as_me:$LINENO: result: $DSTMODE" >&5
+echo "${ECHO_T}$DSTMODE" >&6; }
 
 
 
@@ -5327,8 +5934,8 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -5362,24 +5969,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -5388,9 +5993,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5400,24 +6006,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -5428,6 +6032,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5445,8 +6050,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -5469,24 +6074,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -5495,9 +6098,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5507,24 +6111,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -5535,6 +6137,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5557,8 +6160,8 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5582,36 +6185,32 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
@@ -5666,6 +6265,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -5685,18 +6285,27 @@
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5709,12 +6318,14 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5731,9 +6342,9 @@
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -5755,38 +6366,35 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
@@ -5798,13 +6406,12 @@
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
 if test "${ac_cv_search_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5812,126 +6419,83 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char opendir ();
 int
 main ()
 {
-opendir ();
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+for ac_lib in '' dir; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in dir; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  ac_cv_search_opendir=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
 else
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
 if test "${ac_cv_search_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5939,122 +6503,80 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char opendir ();
 int
 main ()
 {
-opendir ();
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+for ac_lib in '' x; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in x; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  ac_cv_search_opendir=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
 fi
 
-echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_wait_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6067,7 +6589,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
@@ -6084,38 +6606,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_sys_wait_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_sys_wait_h=no
+	ac_cv_header_sys_wait_h=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
 if test $ac_cv_header_sys_wait_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6124,8 +6642,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
-echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
+echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; }
 if test "${ac_cv_header_stat_broken+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6138,42 +6656,52 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#if defined(S_ISBLK) && defined(S_IFDIR)
-# if S_ISBLK (S_IFDIR)
-You lose.
-# endif
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
 #endif
 
-#if defined(S_ISBLK) && defined(S_IFCHR)
-# if S_ISBLK (S_IFCHR)
-You lose.
-# endif
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
 #endif
 
-#if defined(S_ISLNK) && defined(S_IFREG)
-# if S_ISLNK (S_IFREG)
-You lose.
-# endif
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
 #endif
 
-#if defined(S_ISSOCK) && defined(S_IFREG)
-# if S_ISSOCK (S_IFREG)
-You lose.
-# endif
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
 #endif
 
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "You lose" >/dev/null 2>&1; then
-  ac_cv_header_stat_broken=yes
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stat_broken=no
 else
-  ac_cv_header_stat_broken=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stat_broken=yes
 fi
-rm -f conftest*
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
-echo "${ECHO_T}$ac_cv_header_stat_broken" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
+echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; }
 if test $ac_cv_header_stat_broken = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6200,18 +6728,19 @@
 	readline/readline.h readline/history.h pwd.h sys/paths.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6222,41 +6751,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6265,24 +6790,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6290,9 +6813,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -6316,25 +6840,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
 ## ------------------------------------------------ ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -6350,8 +6873,8 @@
 INCLUDES="-I.. -I. $INCLUDES"
 
 # Checks for library functions.
-echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5
+echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; }
 if test "${ac_cv_func_closedir_void+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6373,19 +6896,28 @@
 int
 main ()
 {
-exit (closedir (opendir (".")) != 0);
+return closedir (opendir (".")) != 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6398,11 +6930,13 @@
 ( exit $ac_status )
 ac_cv_func_closedir_void=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-echo "${ECHO_T}$ac_cv_func_closedir_void" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; }
 if test $ac_cv_func_closedir_void = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6411,8 +6945,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_pid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6423,50 +6957,47 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef pid_t ac__type_new_;
 int
 main ()
 {
-if ((pid_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (pid_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_pid_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_pid_t=no
+	ac_cv_type_pid_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
 if test $ac_cv_type_pid_t = yes; then
   :
 else
@@ -6478,22 +7009,22 @@
 fi
 
 
-
-for ac_header in unistd.h vfork.h
+for ac_header in vfork.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6504,41 +7035,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6547,24 +7074,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6572,9 +7097,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -6598,25 +7124,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
 ## ------------------------------------------------ ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -6633,9 +7158,9 @@
 for ac_func in fork vfork
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6661,68 +7186,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -6732,8 +7249,8 @@
 done
 
 if test "x$ac_cv_func_fork" = xyes; then
-  echo "$as_me:$LINENO: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6; }
 if test "${ac_cv_func_fork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6741,27 +7258,40 @@
   ac_cv_func_fork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-/* By Ruediger Kuhlmann. */
-      #include <sys/types.h>
-      #if HAVE_UNISTD_H
-      # include <unistd.h>
-      #endif
-      /* Some systems only have a dummy stub for fork() */
-      int main ()
-      {
-	if (fork() < 0)
-	  exit (1);
-	exit (0);
-      }
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+	  /* By Ruediger Kuhlmann. */
+	  return fork () < 0;
+
+  ;
+  return 0;
+}
+_ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6774,11 +7304,13 @@
 ( exit $ac_status )
 ac_cv_func_fork_works=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6; }
 
 else
   ac_cv_func_fork_works=$ac_cv_func_fork
@@ -6798,8 +7330,8 @@
 fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 if test "x$ac_cv_func_vfork" = xyes; then
-  echo "$as_me:$LINENO: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; }
 if test "${ac_cv_func_vfork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6813,15 +7345,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* Thanks to Paul Eggert for this test.  */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+$ac_includes_default
 #include <sys/wait.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_VFORK_H
+#ifdef HAVE_VFORK_H
 # include <vfork.h>
 #endif
 /* On some sparc systems, changes by the child to local and incoming
@@ -6892,7 +7418,7 @@
 
     while (wait(&status) != child)
       ;
-    exit(
+    return (
 	 /* Was there some problem with vforking?  */
 	 child < 0
 
@@ -6909,13 +7435,22 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6928,11 +7463,13 @@
 ( exit $ac_status )
 ac_cv_func_vfork_works=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; }
 
 fi;
 if test "x$ac_cv_func_fork_works" = xcross; then
@@ -6962,8 +7499,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
-echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
+echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_strerror_r+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6978,7 +7515,7 @@
 main ()
 {
 #ifndef strerror_r
-  char *p = (char *) strerror_r;
+  (void) strerror_r;
 #endif
 
   ;
@@ -6986,38 +7523,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_strerror_r=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_strerror_r=no
+	ac_cv_have_decl_strerror_r=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; }
 if test $ac_cv_have_decl_strerror_r = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7038,9 +7571,9 @@
 for ac_func in strerror_r
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7066,68 +7599,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -7136,8 +7661,8 @@
 fi
 done
 
-echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
-echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
+echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; }
 if test "${ac_cv_func_strerror_r_char_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7158,40 +7683,38 @@
 	  char buf[100];
 	  char x = *strerror_r (0, buf, sizeof buf);
 	  char *p = strerror_r (0, buf, sizeof buf);
+	  return !p || x;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_func_strerror_r_char_p=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     else
       # strerror_r is not declared.  Choose between
       # systems that have relatively inaccessible declarations for the
@@ -7215,19 +7738,28 @@
 {
 char buf[100];
 	  char x = *strerror_r (0, buf, sizeof buf);
-	  exit (!isalpha (x));
+	  return ! isalpha (x);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -7238,13 +7770,15 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
     fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
-echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
+echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; }
 if test $ac_cv_func_strerror_r_char_p = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -7271,9 +7805,9 @@
 for ac_func in bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7299,68 +7833,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -7370,10 +7896,10 @@
 done
 
 
-	echo "$as_me:$LINENO: checking if readlink conforms to POSIX 1003.1a" >&5
-echo $ECHO_N "checking if readlink conforms to POSIX 1003.1a... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking if readlink conforms to POSIX 1003.1a" >&5
+echo $ECHO_N "checking if readlink conforms to POSIX 1003.1a... $ECHO_C" >&6; }
 
-	if test "${dp_cv_readlink_is_posix_1003_1a+set}" = set; then
+	if test "${mp_cv_readlink_is_posix_1003_1a+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -7399,48 +7925,44 @@
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
-				dp_cv_readlink_is_posix_1003_1a="yes"
+				mp_cv_readlink_is_posix_1003_1a="yes"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-				dp_cv_readlink_is_posix_1003_1a="no"
+				mp_cv_readlink_is_posix_1003_1a="no"
 
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 
-	echo "$as_me:$LINENO: result: ${dp_cv_readlink_is_posix_1003_1a}" >&5
-echo "${ECHO_T}${dp_cv_readlink_is_posix_1003_1a}" >&6
+	{ echo "$as_me:$LINENO: result: ${mp_cv_readlink_is_posix_1003_1a}" >&5
+echo "${ECHO_T}${mp_cv_readlink_is_posix_1003_1a}" >&6; }
 
-	if test x"${dp_cv_readlink_is_posix_1003_1a}" = "xno"; then
+	if test x"${mp_cv_readlink_is_posix_1003_1a}" = "xno"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define READLINK_IS_NOT_P1003_1A
@@ -7455,8 +7977,8 @@
 
 
 	# Check for libmd, which is prefered
-	echo "$as_me:$LINENO: checking for MD5Update in -lmd" >&5
-echo $ECHO_N "checking for MD5Update in -lmd... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for MD5Update in -lmd" >&5
+echo $ECHO_N "checking for MD5Update in -lmd... $ECHO_C" >&6; }
 if test "${ac_cv_lib_md_MD5Update+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7469,74 +7991,72 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char MD5Update ();
 int
 main ()
 {
-MD5Update ();
+return MD5Update ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_md_MD5Update=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_md_MD5Update=no
+	ac_cv_lib_md_MD5Update=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_md_MD5Update" >&5
-echo "${ECHO_T}$ac_cv_lib_md_MD5Update" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_md_MD5Update" >&5
+echo "${ECHO_T}$ac_cv_lib_md_MD5Update" >&6; }
 if test $ac_cv_lib_md_MD5Update = yes; then
 
 
 for ac_header in md5.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7547,41 +8067,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7590,24 +8106,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7615,9 +8129,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -7641,25 +8156,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
 ## ------------------------------------------------ ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -7698,8 +8212,8 @@
 
 	if test "x$MD5_LIBS" = "x" ; then
 		# If libmd is not found, check for libcrypto from OpenSSL
-		echo "$as_me:$LINENO: checking for MD5_Update in -lcrypto" >&5
-echo $ECHO_N "checking for MD5_Update in -lcrypto... $ECHO_C" >&6
+		{ echo "$as_me:$LINENO: checking for MD5_Update in -lcrypto" >&5
+echo $ECHO_N "checking for MD5_Update in -lcrypto... $ECHO_C" >&6; }
 if test "${ac_cv_lib_crypto_MD5_Update+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7712,74 +8226,72 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char MD5_Update ();
 int
 main ()
 {
-MD5_Update ();
+return MD5_Update ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_crypto_MD5_Update=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_crypto_MD5_Update=no
+	ac_cv_lib_crypto_MD5_Update=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5_Update" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_MD5_Update" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5_Update" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_MD5_Update" >&6; }
 if test $ac_cv_lib_crypto_MD5_Update = yes; then
 
 
 for ac_header in openssl/md5.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7790,41 +8302,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7833,24 +8341,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7858,9 +8364,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -7884,25 +8391,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
 ## ------------------------------------------------ ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -7954,44 +8460,49 @@
 
 
 # Check for X11 and paraphernalia
-echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
 
 
-# Check whether --with-x or --without-x was given.
+# Check whether --with-x was given.
 if test "${with_x+set}" = set; then
-  withval="$with_x"
+  withval=$with_x;
+fi
 
-fi;
 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
 if test "x$with_x" = xno; then
   # The user explicitly disabled X.
   have_x=disabled
 else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-    if test "${ac_cv_have_x+set}" = set; then
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   # One or both of the vars are not set, and there is no cached value.
 ac_x_includes=no ac_x_libraries=no
-rm -fr conftest.dir
+rm -f -r conftest.dir
 if mkdir conftest.dir; then
   cd conftest.dir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
   cat >Imakefile <<'_ACEOF'
-acfindx:
-	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
 _ACEOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
     for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-	 test -f $ac_im_libdir/libX11.$ac_extension; then
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
 	ac_im_usrlibdir=$ac_im_libdir; break
       fi
     done
@@ -7999,7 +8510,7 @@
     # bogus both because they are the default anyway, and because
     # using them would break gcc on systems where it needs fixed includes.
     case $ac_im_incroot in
-	/usr/include) ;;
+	/usr/include) ac_x_includes= ;;
 	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
     esac
     case $ac_im_usrlibdir in
@@ -8008,7 +8519,7 @@
     esac
   fi
   cd ..
-  rm -fr conftest.dir
+  rm -f -r conftest.dir
 fi
 
 # Standard set of common directories for X headers.
@@ -8049,7 +8560,7 @@
 /usr/openwin/share/include'
 
 if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Intrinsic.h.
+  # Guess where to find include files, by looking for Xlib.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8057,26 +8568,24 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # We can compile using X headers with no special include directory.
 ac_x_includes=
 else
@@ -8084,12 +8593,13 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
   for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Intrinsic.h"; then
+  if test -r "$ac_dir/X11/Xlib.h"; then
     ac_x_includes=$ac_dir
     break
   fi
 done
 fi
+
 rm -f conftest.err conftest.$ac_ext
 fi # $ac_x_includes = no
 
@@ -8098,44 +8608,40 @@
   # See if we find them without any special options.
   # Don't add to $LIBS permanently.
   ac_save_LIBS=$LIBS
-  LIBS="-lXt $LIBS"
+  LIBS="-lX11 $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 int
 main ()
 {
-XtMalloc (0)
+XrmInitialize ()
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
 ac_x_libraries=
@@ -8143,49 +8649,54 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-LIBS=$ac_save_LIBS
+	LIBS=$ac_save_LIBS
 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
   for ac_extension in a so sl; do
-    if test -r $ac_dir/libXt.$ac_extension; then
+    if test -r "$ac_dir/libX11.$ac_extension"; then
       ac_x_libraries=$ac_dir
       break 2
     fi
   done
 done
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
 
-if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-		ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
 fi
-fi
-
-  fi
+;; #(
+    *) have_x=yes;;
+  esac
   eval "$ac_cv_have_x"
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$have_x" >&6
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
   no_x=yes
 else
   # If each of the values was on the command line, it overrides each guess.
   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
   # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
 fi
 
 
@@ -8208,12 +8719,12 @@
     X_LIBS="$X_LIBS -L$x_libraries"
     # For Solaris; some versions of Sun CC require a space after -R and
     # others require no space.  Words are not sufficient . . . .
-    case `(uname -sr) 2>/dev/null` in
-    "SunOS 5"*)
-      echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
-echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
-      ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-      cat >conftest.$ac_ext <<_ACEOF
+    { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8229,43 +8740,32 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_R_nospace=yes
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_R_nospace=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-      if test $ac_R_nospace = yes; then
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-	X_LIBS="$X_LIBS -R$x_libraries"
-      else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
-	cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8281,47 +8781,42 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_R_space=yes
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_R_space=no
+	{ echo "$as_me:$LINENO: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6; }
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-	if test $ac_R_space = yes; then
-	  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-	  X_LIBS="$X_LIBS -R $x_libraries"
-	else
-	  echo "$as_me:$LINENO: result: neither works" >&5
-echo "${ECHO_T}neither works" >&6
-	fi
-      fi
-      LIBS=$ac_xsave_LIBS
-    esac
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
   fi
 
   # Check for system-dependent libraries X programs must link with.
@@ -8342,50 +8837,46 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XOpenDisplay ();
 int
 main ()
 {
-XOpenDisplay ();
+return XOpenDisplay ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
-echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8398,63 +8889,60 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dnet_ntoa ();
 int
 main ()
 {
-dnet_ntoa ();
+return dnet_ntoa ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_dnet_dnet_ntoa=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dnet_dnet_ntoa=no
+	ac_cv_lib_dnet_dnet_ntoa=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; }
 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
 fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
-echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8467,63 +8955,61 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dnet_ntoa ();
 int
 main ()
 {
-dnet_ntoa ();
+return dnet_ntoa ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_dnet_stub_dnet_ntoa=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dnet_stub_dnet_ntoa=no
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
 fi
 
     fi
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
     LIBS="$ac_xsave_LIBS"
 
@@ -8535,8 +9021,8 @@
     # on Irix 5.2, according to T.E. Dickey.
     # The functions gethostbyname, getservbyname, and inet_addr are
     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    echo "$as_me:$LINENO: checking for gethostbyname" >&5
-echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; }
 if test "${ac_cv_func_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8563,72 +9049,63 @@
 
 #undef gethostbyname
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char gethostbyname ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
 choke me
-#else
-char (*f) () = gethostbyname;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != gethostbyname;
+return gethostbyname ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_gethostbyname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_gethostbyname=no
+	ac_cv_func_gethostbyname=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; }
 
     if test $ac_cv_func_gethostbyname = no; then
-      echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8641,63 +9118,60 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char gethostbyname ();
 int
 main ()
 {
-gethostbyname ();
+return gethostbyname ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_nsl_gethostbyname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_nsl_gethostbyname=no
+	ac_cv_lib_nsl_gethostbyname=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
 if test $ac_cv_lib_nsl_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
 fi
 
       if test $ac_cv_lib_nsl_gethostbyname = no; then
-	echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
-echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; }
 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8710,56 +9184,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char gethostbyname ();
 int
 main ()
 {
-gethostbyname ();
+return gethostbyname ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_bsd_gethostbyname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_bsd_gethostbyname=no
+	ac_cv_lib_bsd_gethostbyname=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; }
 if test $ac_cv_lib_bsd_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
 fi
@@ -8774,8 +9245,8 @@
     # variants that don't use the name server (or something).  -lsocket
     # must be given before -lnsl if both are needed.  We assume that
     # if connect needs -lnsl, so does gethostbyname.
-    echo "$as_me:$LINENO: checking for connect" >&5
-echo $ECHO_N "checking for connect... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6; }
 if test "${ac_cv_func_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8802,72 +9273,63 @@
 
 #undef connect
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char connect ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_connect) || defined (__stub___connect)
+#if defined __stub_connect || defined __stub___connect
 choke me
-#else
-char (*f) () = connect;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != connect;
+return connect ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_connect=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_connect=no
+	ac_cv_func_connect=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
-echo "${ECHO_T}$ac_cv_func_connect" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6; }
 
     if test $ac_cv_func_connect = no; then
-      echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
-echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; }
 if test "${ac_cv_lib_socket_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8880,56 +9342,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char connect ();
 int
 main ()
 {
-connect ();
+return connect ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_socket_connect=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_socket_connect=no
+	ac_cv_lib_socket_connect=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; }
 if test $ac_cv_lib_socket_connect = yes; then
   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 fi
@@ -8937,8 +9396,8 @@
     fi
 
     # Guillermo Gomez says -lposix is necessary on A/UX.
-    echo "$as_me:$LINENO: checking for remove" >&5
-echo $ECHO_N "checking for remove... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6; }
 if test "${ac_cv_func_remove+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8965,72 +9424,63 @@
 
 #undef remove
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char remove ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_remove) || defined (__stub___remove)
+#if defined __stub_remove || defined __stub___remove
 choke me
-#else
-char (*f) () = remove;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != remove;
+return remove ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_remove=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_remove=no
+	ac_cv_func_remove=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
-echo "${ECHO_T}$ac_cv_func_remove" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6; }
 
     if test $ac_cv_func_remove = no; then
-      echo "$as_me:$LINENO: checking for remove in -lposix" >&5
-echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; }
 if test "${ac_cv_lib_posix_remove+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9043,56 +9493,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char remove ();
 int
 main ()
 {
-remove ();
+return remove ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_posix_remove=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_posix_remove=no
+	ac_cv_lib_posix_remove=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
-echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; }
 if test $ac_cv_lib_posix_remove = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
 fi
@@ -9100,8 +9547,8 @@
     fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo "$as_me:$LINENO: checking for shmat" >&5
-echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6; }
 if test "${ac_cv_func_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9128,72 +9575,63 @@
 
 #undef shmat
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shmat ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shmat) || defined (__stub___shmat)
+#if defined __stub_shmat || defined __stub___shmat
 choke me
-#else
-char (*f) () = shmat;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != shmat;
+return shmat ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_shmat=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_shmat=no
+	ac_cv_func_shmat=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
-echo "${ECHO_T}$ac_cv_func_shmat" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6; }
 
     if test $ac_cv_func_shmat = no; then
-      echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
-echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9206,56 +9644,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shmat ();
 int
 main ()
 {
-shmat ();
+return shmat ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_ipc_shmat=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ipc_shmat=no
+	ac_cv_lib_ipc_shmat=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
-echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; }
 if test $ac_cv_lib_ipc_shmat = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
 fi
@@ -9272,8 +9707,8 @@
   # These have to be linked with before -lX11, unlike the other
   # libraries we check for below, so use a different variable.
   # John Interrante, Karl Berry
-  echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
-echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9286,56 +9721,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char IceConnectionNumber ();
 int
 main ()
 {
-IceConnectionNumber ();
+return IceConnectionNumber ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_ICE_IceConnectionNumber=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ICE_IceConnectionNumber=no
+	ac_cv_lib_ICE_IceConnectionNumber=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 fi
@@ -9346,8 +9778,8 @@
 
 
 	# Check for libX11
-	echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5
-echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5
+echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6; }
 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9360,56 +9792,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XOpenDisplay ();
 int
 main ()
 {
-XOpenDisplay ();
+return XOpenDisplay ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_X11_XOpenDisplay=no
+	ac_cv_lib_X11_XOpenDisplay=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5
-echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6; }
 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
 
 		has_x_runtime=yes
@@ -9436,8 +9865,8 @@
 		"__no__yes__")
 		# either the user said --without-x, or it was not found
 		# at all (runtime or headers)
-			{ echo "$as_me:$LINENO: WARNING: X11 not available. You will not be able to use dports that use X11" >&5
-echo "$as_me: WARNING: X11 not available. You will not be able to use dports that use X11" >&2;}
+			{ echo "$as_me:$LINENO: WARNING: X11 not available. You will not be able to use ports that use X11" >&5
+echo "$as_me: WARNING: X11 not available. You will not be able to use ports that use X11" >&2;}
 			state=0
 			;;
 		"__yes__yes__")
@@ -9503,8 +9932,8 @@
 
 # Check for readline
 
-echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
-echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
+echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; }
 if test "${ac_cv_lib_readline_readline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9517,56 +9946,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char readline ();
 int
 main ()
 {
-readline ();
+return readline ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_readline_readline=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_readline_readline=no
+	ac_cv_lib_readline_readline=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
+echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; }
 if test $ac_cv_lib_readline_readline = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBREADLINE 1
@@ -9576,8 +10002,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking whether rl_username_completion_function is declared" >&5
-echo $ECHO_N "checking whether rl_username_completion_function is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether rl_username_completion_function is declared" >&5
+echo $ECHO_N "checking whether rl_username_completion_function is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_rl_username_completion_function+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9598,7 +10024,7 @@
 main ()
 {
 #ifndef rl_username_completion_function
-  char *p = (char *) rl_username_completion_function;
+  (void) rl_username_completion_function;
 #endif
 
   ;
@@ -9606,38 +10032,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_rl_username_completion_function=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_rl_username_completion_function=no
+	ac_cv_have_decl_rl_username_completion_function=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_username_completion_function" >&5
-echo "${ECHO_T}$ac_cv_have_decl_rl_username_completion_function" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_username_completion_function" >&5
+echo "${ECHO_T}$ac_cv_have_decl_rl_username_completion_function" >&6; }
 if test $ac_cv_have_decl_rl_username_completion_function = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9652,8 +10074,8 @@
 
 
 fi
-echo "$as_me:$LINENO: checking whether rl_filename_completion_function is declared" >&5
-echo $ECHO_N "checking whether rl_filename_completion_function is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether rl_filename_completion_function is declared" >&5
+echo $ECHO_N "checking whether rl_filename_completion_function is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_rl_filename_completion_function+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9674,7 +10096,7 @@
 main ()
 {
 #ifndef rl_filename_completion_function
-  char *p = (char *) rl_filename_completion_function;
+  (void) rl_filename_completion_function;
 #endif
 
   ;
@@ -9682,38 +10104,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_rl_filename_completion_function=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_rl_filename_completion_function=no
+	ac_cv_have_decl_rl_filename_completion_function=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_filename_completion_function" >&5
-echo "${ECHO_T}$ac_cv_have_decl_rl_filename_completion_function" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_filename_completion_function" >&5
+echo "${ECHO_T}$ac_cv_have_decl_rl_filename_completion_function" >&6; }
 if test $ac_cv_have_decl_rl_filename_completion_function = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9728,8 +10146,8 @@
 
 
 fi
-echo "$as_me:$LINENO: checking whether rl_completion_matches is declared" >&5
-echo $ECHO_N "checking whether rl_completion_matches is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether rl_completion_matches is declared" >&5
+echo $ECHO_N "checking whether rl_completion_matches is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_rl_completion_matches+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9750,7 +10168,7 @@
 main ()
 {
 #ifndef rl_completion_matches
-  char *p = (char *) rl_completion_matches;
+  (void) rl_completion_matches;
 #endif
 
   ;
@@ -9758,38 +10176,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_rl_completion_matches=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_rl_completion_matches=no
+	ac_cv_have_decl_rl_completion_matches=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_completion_matches" >&5
-echo "${ECHO_T}$ac_cv_have_decl_rl_completion_matches" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_rl_completion_matches" >&5
+echo "${ECHO_T}$ac_cv_have_decl_rl_completion_matches" >&6; }
 if test $ac_cv_have_decl_rl_completion_matches = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9804,8 +10218,8 @@
 
 
 fi
-echo "$as_me:$LINENO: checking whether username_completion_function is declared" >&5
-echo $ECHO_N "checking whether username_completion_function is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether username_completion_function is declared" >&5
+echo $ECHO_N "checking whether username_completion_function is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_username_completion_function+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9826,7 +10240,7 @@
 main ()
 {
 #ifndef username_completion_function
-  char *p = (char *) username_completion_function;
+  (void) username_completion_function;
 #endif
 
   ;
@@ -9834,38 +10248,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_username_completion_function=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_username_completion_function=no
+	ac_cv_have_decl_username_completion_function=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_username_completion_function" >&5
-echo "${ECHO_T}$ac_cv_have_decl_username_completion_function" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_username_completion_function" >&5
+echo "${ECHO_T}$ac_cv_have_decl_username_completion_function" >&6; }
 if test $ac_cv_have_decl_username_completion_function = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9880,8 +10290,8 @@
 
 
 fi
-echo "$as_me:$LINENO: checking whether filename_completion_function is declared" >&5
-echo $ECHO_N "checking whether filename_completion_function is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether filename_completion_function is declared" >&5
+echo $ECHO_N "checking whether filename_completion_function is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_filename_completion_function+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9902,7 +10312,7 @@
 main ()
 {
 #ifndef filename_completion_function
-  char *p = (char *) filename_completion_function;
+  (void) filename_completion_function;
 #endif
 
   ;
@@ -9910,38 +10320,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_filename_completion_function=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_filename_completion_function=no
+	ac_cv_have_decl_filename_completion_function=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_filename_completion_function" >&5
-echo "${ECHO_T}$ac_cv_have_decl_filename_completion_function" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_filename_completion_function" >&5
+echo "${ECHO_T}$ac_cv_have_decl_filename_completion_function" >&6; }
 if test $ac_cv_have_decl_filename_completion_function = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9956,8 +10362,8 @@
 
 
 fi
-echo "$as_me:$LINENO: checking whether completion_matches is declared" >&5
-echo $ECHO_N "checking whether completion_matches is declared... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether completion_matches is declared" >&5
+echo $ECHO_N "checking whether completion_matches is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_completion_matches+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9978,7 +10384,7 @@
 main ()
 {
 #ifndef completion_matches
-  char *p = (char *) completion_matches;
+  (void) completion_matches;
 #endif
 
   ;
@@ -9986,38 +10392,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_completion_matches=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_completion_matches=no
+	ac_cv_have_decl_completion_matches=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_completion_matches" >&5
-echo "${ECHO_T}$ac_cv_have_decl_completion_matches" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_completion_matches" >&5
+echo "${ECHO_T}$ac_cv_have_decl_completion_matches" >&6; }
 if test $ac_cv_have_decl_completion_matches = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -10059,13 +10461,13 @@
 	# we reset no_tcl in case something fails here
 	no_tcl=true
 
-# Check whether --with-tcl or --without-tcl was given.
+# Check whether --with-tcl was given.
 if test "${with_tcl+set}" = set; then
-  withval="$with_tcl"
-  with_tclconfig=${withval}
-fi;
-	echo "$as_me:$LINENO: checking for Tcl configuration" >&5
-echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
+  withval=$with_tcl; with_tclconfig=${withval}
+fi
+
+	{ echo "$as_me:$LINENO: checking for Tcl configuration" >&5
+echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6; }
 	if test "${ac_cv_c_tclconfig+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10141,22 +10543,22 @@
 	else
 	    no_tcl=
 	    TCL_BIN_DIR=${ac_cv_c_tclconfig}
-	    echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5
-echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6
+	    { echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5
+echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6; }
 	fi
     fi
 
 
-    echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
-echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
+echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6; }
 
     if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
-        echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
+        { echo "$as_me:$LINENO: result: loading" >&5
+echo "${ECHO_T}loading" >&6; }
 	. $TCL_BIN_DIR/tclConfig.sh
     else
-        echo "$as_me:$LINENO: result: file not found" >&5
-echo "${ECHO_T}file not found" >&6
+        { echo "$as_me:$LINENO: result: file not found" >&5
+echo "${ECHO_T}file not found" >&6; }
     fi
 
     #
@@ -10202,16 +10604,16 @@
 # Check for Tcl public headers
 CYGPATH=echo
 
-    echo "$as_me:$LINENO: checking for Tcl public headers" >&5
-echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for Tcl public headers" >&5
+echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6; }
 
 
-# Check whether --with-tclinclude or --without-tclinclude was given.
+# Check whether --with-tclinclude was given.
 if test "${with_tclinclude+set}" = set; then
-  withval="$with_tclinclude"
-  with_tclinclude=${withval}
-fi;
+  withval=$with_tclinclude; with_tclinclude=${withval}
+fi
 
+
     if test x"${with_tclinclude}" != x ; then
 	if test -f "${with_tclinclude}/tcl.h" ; then
 	    ac_cv_c_tclh=${with_tclinclude}
@@ -10255,8 +10657,8 @@
 echo "$as_me: error: tcl.h not found.  Please specify its location with --with-tclinclude" >&2;}
    { (exit 1); exit 1; }; }
     else
-	echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5
-echo "${ECHO_T}${ac_cv_c_tclh}" >&6
+	{ echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5
+echo "${ECHO_T}${ac_cv_c_tclh}" >&6; }
     fi
 
     # Convert to a native path and substitute into the output files.
@@ -10273,55 +10675,12 @@
 
 
 	case $host_os in
-		freebsd*)
-			# FreeBSD installs a dummy tclsh (annoying)
-			# Look for a real versioned tclsh first
-			# Extract the first word of "tclsh${TCL_VERSION} tclsh", so it can be a program name with args.
-set dummy tclsh${TCL_VERSION} tclsh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_TCLSH+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $TCLSH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-TCLSH=$ac_cv_path_TCLSH
-
-if test -n "$TCLSH"; then
-  echo "$as_me:$LINENO: result: $TCLSH" >&5
-echo "${ECHO_T}$TCLSH" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-			;;
 		*)
 			# Otherwise, look for a non-versioned tclsh
 			# Extract the first word of "tclsh tclsh${TCL_VERSION}", so it can be a program name with args.
 set dummy tclsh tclsh${TCL_VERSION}; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_TCLSH+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10336,27 +10695,28 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 TCLSH=$ac_cv_path_TCLSH
-
 if test -n "$TCLSH"; then
-  echo "$as_me:$LINENO: result: $TCLSH" >&5
-echo "${ECHO_T}$TCLSH" >&6
+  { echo "$as_me:$LINENO: result: $TCLSH" >&5
+echo "${ECHO_T}$TCLSH" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 			;;
 	esac
 	if test "x$TCLSH" = "x" ; then
@@ -10370,16 +10730,16 @@
 
 # Check for Tcl package path
 
-    echo "$as_me:$LINENO: checking for Tcl package directory" >&5
-echo $ECHO_N "checking for Tcl package directory... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for Tcl package directory" >&5
+echo $ECHO_N "checking for Tcl package directory... $ECHO_C" >&6; }
 
 
-# Check whether --with-tclpackage or --without-tclpackage was given.
+# Check whether --with-tclpackage was given.
 if test "${with_tclpackage+set}" = set; then
-  withval="$with_tclpackage"
-  with_tclpackagedir=${withval}
-fi;
+  withval=$with_tclpackage; with_tclpackagedir=${withval}
+fi
 
+
     if test x"${with_tclpackagedir}" != x ; then
 	ac_cv_c_tclpkgd=${with_tclpackagedir}
     else
@@ -10430,8 +10790,8 @@
 echo "$as_me: error: Tcl package directory not found.  Please specify its location with --with-tclpackage" >&2;}
    { (exit 1); exit 1; }; }
     else
-	echo "$as_me:$LINENO: result: ${ac_cv_c_tclpkgd}" >&5
-echo "${ECHO_T}${ac_cv_c_tclpkgd}" >&6
+	{ echo "$as_me:$LINENO: result: ${ac_cv_c_tclpkgd}" >&5
+echo "${ECHO_T}${ac_cv_c_tclpkgd}" >&6; }
     fi
 
     # Convert to a native path and substitute into the output files.
@@ -10445,15 +10805,15 @@
 
 # Check if thread is enabled.
 
-	echo "$as_me:$LINENO: checking whether tclsh was compiled with threads" >&5
-echo $ECHO_N "checking whether tclsh was compiled with threads... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking whether tclsh was compiled with threads" >&5
+echo $ECHO_N "checking whether tclsh was compiled with threads... $ECHO_C" >&6; }
 	tcl_threadenabled=`echo 'puts -nonewline [info exists tcl_platform(threaded)]' | $TCLSH`
 	if test "$tcl_threadenabled" = "1" ; then
-		echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 	else
-		echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 		{ { echo "$as_me:$LINENO: error: tcl wasn't compiled with threads enabled" >&5
 echo "$as_me: error: tcl wasn't compiled with threads enabled" >&2;}
    { (exit 1); exit 1; }; }
@@ -10463,17 +10823,17 @@
 ## libcurl
 
 
-# Check whether --with-curlprefix or --without-curlprefix was given.
+# Check whether --with-curlprefix was given.
 if test "${with_curlprefix+set}" = set; then
-  withval="$with_curlprefix"
-    curlprefix=$withval
-fi;
+  withval=$with_curlprefix;   curlprefix=$withval
+fi
 
+
 	if test "x$curlprefix" = "x"; then
 		# Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_CURL_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10488,32 +10848,33 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 CURL_CONFIG=$ac_cv_path_CURL_CONFIG
-
 if test -n "$CURL_CONFIG"; then
-  echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5
-echo "${ECHO_T}$CURL_CONFIG" >&6
+  { echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5
+echo "${ECHO_T}$CURL_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 	else
 		# Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_CURL_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10528,27 +10889,28 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 CURL_CONFIG=$ac_cv_path_CURL_CONFIG
-
 if test -n "$CURL_CONFIG"; then
-  echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5
-echo "${ECHO_T}$CURL_CONFIG" >&6
+  { echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5
+echo "${ECHO_T}$CURL_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 	fi
 
 	if test "x$CURL_CONFIG" = "x"; then
@@ -10569,8 +10931,8 @@
 # Do we have curl_easy_strerror?
 
 
-echo "$as_me:$LINENO: checking for curl_easy_strerror in -lcurl" >&5
-echo $ECHO_N "checking for curl_easy_strerror in -lcurl... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for curl_easy_strerror in -lcurl" >&5
+echo $ECHO_N "checking for curl_easy_strerror in -lcurl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_curl_curl_easy_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10583,56 +10945,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char curl_easy_strerror ();
 int
 main ()
 {
-curl_easy_strerror ();
+return curl_easy_strerror ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_curl_curl_easy_strerror=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_curl_curl_easy_strerror=no
+	ac_cv_lib_curl_curl_easy_strerror=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_easy_strerror" >&5
-echo "${ECHO_T}$ac_cv_lib_curl_curl_easy_strerror" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_easy_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_curl_curl_easy_strerror" >&6; }
 if test $ac_cv_lib_curl_curl_easy_strerror = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURL_EASY_STRERROR 1
@@ -10646,26 +11005,26 @@
 
 ## Thread package.
 
-# Check whether --with-included-tclthread or --without-included-tclthread was given.
+# Check whether --with-included-tclthread was given.
 if test "${with_included_tclthread+set}" = set; then
-  withval="$with_included_tclthread"
-  with_included_tclthread=$withval
+  withval=$with_included_tclthread; with_included_tclthread=$withval
 else
   with_included_tclthread="unspecified"
-fi;
+fi
 
+
 # Check if thread package is already installed.
 if test "x$with_included_tclthread" = "xunspecified" ; then
 
-	echo "$as_me:$LINENO: checking for Tcl Thread package" >&5
-echo $ECHO_N "checking for Tcl Thread package... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for Tcl Thread package" >&5
+echo $ECHO_N "checking for Tcl Thread package... $ECHO_C" >&6; }
 	package_present=`echo 'if {[catch {package require Thread}]} {puts -nonewline 0} else {puts -nonewline 1}' | $TCLSH`
 	if test "$package_present" = "1"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; with_included_tclthread=no
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }; with_included_tclthread=no
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; with_included_tclthread=yes
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; with_included_tclthread=yes
 fi
 
 
@@ -10674,10 +11033,8 @@
 # If thread package isn't installed, configure and install thread package.
 if test "$with_included_tclthread" = "yes"; then
 	OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
+	subdirs="$subdirs src/thread2.6"
 
-
-subdirs="$subdirs src/thread2.6"
-
 	# Extract thread package
 	(cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
 	# Patch thread package (so thread2.6 is the vanilla distribution directory)
@@ -10686,18 +11043,18 @@
 
 ## sqlite3 package.
 
-# Check whether --with-included-sqlite3 or --without-included-sqlite3 was given.
+# Check whether --with-included-sqlite3 was given.
 if test "${with_included_sqlite3+set}" = set; then
-  withval="$with_included_sqlite3"
-  with_included_sqlite3=$withval
+  withval=$with_included_sqlite3; with_included_sqlite3=$withval
 else
   with_included_sqlite3="unspecified"
-fi;
+fi
 
+
 # Check if sqlite3 package is already installed.
 if test "x$with_included_sqlite3" = "xunspecified" ; then
-	echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
-echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
+echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; }
 if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10710,56 +11067,53 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char sqlite3_open ();
 int
 main ()
 {
-sqlite3_open ();
+return sqlite3_open ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_sqlite3_sqlite3_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_sqlite3_sqlite3_open=no
+	ac_cv_lib_sqlite3_sqlite3_open=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
-echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
+echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
 if test $ac_cv_lib_sqlite3_sqlite3_open = yes; then
   with_included_sqlite3=no
 else
@@ -10769,21 +11123,19 @@
 fi
 
 
-# Check whether --with-tcl-sqlite3 or --without-tcl-sqlite3 was given.
+# Check whether --with-tcl-sqlite3 was given.
 if test "${with_tcl_sqlite3+set}" = set; then
-  withval="$with_tcl_sqlite3"
-  od_sqlite3_dir=$withval
+  withval=$with_tcl_sqlite3; mp_sqlite3_dir=$withval
 else
-  od_sqlite3_dir=/usr/lib/sqlite3
-fi;
+  mp_sqlite3_dir=/usr/lib/sqlite3
+fi
 
+
 # If sqlite3 package isn't installed, configure and install sqlite3 package.
 if test "$with_included_sqlite3" = "yes"; then
 	OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES sqlite-3.1.3"
+	subdirs="$subdirs src/sqlite-3.1.3"
 
-
-subdirs="$subdirs src/sqlite-3.1.3"
-
 	# Extract sqlite3 package
 	(cd src/; gzip -d < sqlite-3.1.3.tar.gz | tar xf -)
 	# patch sqlite3 with desired configure options
@@ -10792,26 +11144,26 @@
 	mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
 	SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
 	if test "x$prefix" = "xNONE" ; then
-		SQLITE3_DIR=$ac_default_prefix/share/darwinports/Tcl/sqlite3
+		SQLITE3_DIR=$ac_default_prefix/share/macports/Tcl/sqlite3
 	else
-		SQLITE3_DIR=$prefix/share/darwinports/Tcl/sqlite3
+		SQLITE3_DIR=$prefix/share/macports/Tcl/sqlite3
 	fi
 else
 	SQLITE3_LIBS="-lsqlite3"
 
-	echo "$as_me:$LINENO: checking for Tcl sqlite3 location" >&5
-echo $ECHO_N "checking for Tcl sqlite3 location... $ECHO_C" >&6
-if test "${od_cv_sqlite3_dir+set}" = set; then
+	{ echo "$as_me:$LINENO: checking for Tcl sqlite3 location" >&5
+echo $ECHO_N "checking for Tcl sqlite3 location... $ECHO_C" >&6; }
+if test "${mp_cv_sqlite3_dir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  od_cv_sqlite3_dir=
-		test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
+  mp_cv_sqlite3_dir=
+		test -r "${mp_sqlite3_dir}/pkgIndex.tcl" && mp_cv_sqlite3_dir=$mp_sqlite3_dir
 
 fi
-echo "$as_me:$LINENO: result: $od_cv_sqlite3_dir" >&5
-echo "${ECHO_T}$od_cv_sqlite3_dir" >&6
+{ echo "$as_me:$LINENO: result: $mp_cv_sqlite3_dir" >&5
+echo "${ECHO_T}$mp_cv_sqlite3_dir" >&6; }
 
-	SQLITE3_DIR=$od_cv_sqlite3_dir
+	SQLITE3_DIR=$mp_cv_sqlite3_dir
 fi
 
 
@@ -10821,16 +11173,16 @@
 
 # Allows building of shared libraries
 
-    echo "$as_me:$LINENO: checking how to build libraries" >&5
-echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6
-    # Check whether --enable-shared or --disable-shared was given.
+    { echo "$as_me:$LINENO: checking how to build libraries" >&5
+echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6; }
+    # Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  tcl_ok=$enableval
+  enableval=$enable_shared; tcl_ok=$enableval
 else
   tcl_ok=yes
-fi;
+fi
 
+
     if test "${enable_shared+set}" = set; then
 	enableval="$enable_shared"
 	tcl_ok=$enableval
@@ -10839,12 +11191,12 @@
     fi
 
     if test "$tcl_ok" = "yes" ; then
-	echo "$as_me:$LINENO: result: shared" >&5
-echo "${ECHO_T}shared" >&6
+	{ echo "$as_me:$LINENO: result: shared" >&5
+echo "${ECHO_T}shared" >&6; }
 	SHARED_BUILD=1
     else
-	echo "$as_me:$LINENO: result: static" >&5
-echo "${ECHO_T}static" >&6
+	{ echo "$as_me:$LINENO: result: static" >&5
+echo "${ECHO_T}static" >&6; }
 	SHARED_BUILD=0
 
 cat >>confdefs.h <<\_ACEOF
@@ -10876,7 +11228,7 @@
 
 
 
-#misc variables that need to be expanded for substitution into tcl
+# misc variables that need to be expanded for substitution into tcl
 
 oldprefix=$prefix
 if test "x$prefix" = "xNONE" ; then
@@ -10887,8 +11239,8 @@
 
 # do this twice, since there is a nested variable of
 # ${prefix} inside of ${sysconfdir}
-eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
-eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
+eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
+eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
 
 eval "localstatedir_expanded=$localstatedir"
 
@@ -10897,10 +11249,9 @@
 
 
 # Output
+ac_config_files="$ac_config_files Makefile Mk/macports.autoconf.mk doc/prefix.mtree doc/macosx.mtree doc/macports.conf src/Makefile src/macports1.0/macports_autoconf.tcl src/tclobjc1.0/Makefile src/port1.0/port_autoconf.tcl src/registry1.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl"
 
-                                                                                                                        ac_config_files="$ac_config_files Makefile Mk/dports.autoconf.mk doc/prefix.mtree doc/macosx.mtree doc/ports.conf src/Makefile src/darwinports1.0/darwinports_autoconf.tcl src/tclobjc1.0/Makefile src/port1.0/port_autoconf.tcl src/registry1.0/registry_autoconf.tcl src/programs/Makefile src/darwinports1.0/darwinports_fastload.tcl"
 
-
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -10919,39 +11270,58 @@
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -10960,32 +11330,18 @@
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -11016,18 +11372,46 @@
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -11036,8 +11420,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -11051,18 +11470,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -11070,159 +11490,120 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
 
-
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -11231,7 +11612,28 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -11240,62 +11642,34 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
+# values after options handling.
+ac_log="
+This file was extended by MacPorts $as_me 1.6, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
-This file was extended by MacPorts $as_me 1.5, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -11303,7 +11677,7 @@
 Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
+  -V, --version    print version number and configuration settings, then exit
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -11319,19 +11693,21 @@
 $config_headers
 
 Report bugs to <bug-autoconf at gnu.org>."
+
 _ACEOF
-
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-MacPorts config.status 1.5
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+MacPorts config.status 1.6
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -11342,39 +11718,24 @@
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -11384,18 +11745,24 @@
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -11411,41 +11778,55 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "src/programs/daemondo/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/programs/daemondo/Makefile" ;;
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "Mk/dports.autoconf.mk" ) CONFIG_FILES="$CONFIG_FILES Mk/dports.autoconf.mk" ;;
-  "doc/prefix.mtree" ) CONFIG_FILES="$CONFIG_FILES doc/prefix.mtree" ;;
-  "doc/macosx.mtree" ) CONFIG_FILES="$CONFIG_FILES doc/macosx.mtree" ;;
-  "doc/ports.conf" ) CONFIG_FILES="$CONFIG_FILES doc/ports.conf" ;;
-  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-  "src/darwinports1.0/darwinports_autoconf.tcl" ) CONFIG_FILES="$CONFIG_FILES src/darwinports1.0/darwinports_autoconf.tcl" ;;
-  "src/tclobjc1.0/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tclobjc1.0/Makefile" ;;
-  "src/port1.0/port_autoconf.tcl" ) CONFIG_FILES="$CONFIG_FILES src/port1.0/port_autoconf.tcl" ;;
-  "src/registry1.0/registry_autoconf.tcl" ) CONFIG_FILES="$CONFIG_FILES src/registry1.0/registry_autoconf.tcl" ;;
-  "src/programs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/programs/Makefile" ;;
-  "src/darwinports1.0/darwinports_fastload.tcl" ) CONFIG_FILES="$CONFIG_FILES src/darwinports1.0/darwinports_fastload.tcl" ;;
-  "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+  case $ac_config_target in
+    "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+    "src/programs/daemondo/Makefile") CONFIG_FILES="$CONFIG_FILES src/programs/daemondo/Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "Mk/macports.autoconf.mk") CONFIG_FILES="$CONFIG_FILES Mk/macports.autoconf.mk" ;;
+    "doc/prefix.mtree") CONFIG_FILES="$CONFIG_FILES doc/prefix.mtree" ;;
+    "doc/macosx.mtree") CONFIG_FILES="$CONFIG_FILES doc/macosx.mtree" ;;
+    "doc/macports.conf") CONFIG_FILES="$CONFIG_FILES doc/macports.conf" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/macports1.0/macports_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/macports1.0/macports_autoconf.tcl" ;;
+    "src/tclobjc1.0/Makefile") CONFIG_FILES="$CONFIG_FILES src/tclobjc1.0/Makefile" ;;
+    "src/port1.0/port_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/port1.0/port_autoconf.tcl" ;;
+    "src/registry1.0/registry_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/registry1.0/registry_autoconf.tcl" ;;
+    "src/programs/Makefile") CONFIG_FILES="$CONFIG_FILES src/programs/Makefile" ;;
+    "src/macports1.0/macports_fastload.tcl") CONFIG_FILES="$CONFIG_FILES src/macports1.0/macports_fastload.tcl" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -11456,639 +11837,634 @@
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at target@,$target,;t t
-s, at target_cpu@,$target_cpu,;t t
-s, at target_vendor@,$target_vendor,;t t
-s, at target_os@,$target_os,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at OBJC@,$OBJC,;t t
-s, at OBJCFLAGS@,$OBJCFLAGS,;t t
-s, at ac_ct_OBJC@,$ac_ct_OBJC,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at SET_MAKE@,$SET_MAKE,;t t
-s, at LN_S@,$LN_S,;t t
-s, at MTREE@,$MTREE,;t t
-s, at CVS@,$CVS,;t t
-s, at SVN@,$SVN,;t t
-s, at RSYNC@,$RSYNC,;t t
-s, at HAVE_LAUNCHD@,$HAVE_LAUNCHD,;t t
-s, at LAUNCHCTL@,$LAUNCHCTL,;t t
-s, at XCODEBUILD@,$XCODEBUILD,;t t
-s, at BZIP2@,$BZIP2,;t t
-s, at XAR@,$XAR,;t t
-s, at OPEN@,$OPEN,;t t
-s, at TAR@,$TAR,;t t
-s, at GNUTAR@,$GNUTAR,;t t
-s, at TAR_CMD@,$TAR_CMD,;t t
-s, at CFLAGS_QUICHEEATERS@,$CFLAGS_QUICHEEATERS,;t t
-s, at CFLAGS_WERROR@,$CFLAGS_WERROR,;t t
-s, at OBJCPP@,$OBJCPP,;t t
-s, at EGREP@,$EGREP,;t t
-s, at OBJC_RUNTIME@,$OBJC_RUNTIME,;t t
-s, at OBJC_RUNTIME_FLAGS@,$OBJC_RUNTIME_FLAGS,;t t
-s, at OBJC_LIBS@,$OBJC_LIBS,;t t
-s, at OBJC_PTHREAD_LIBS@,$OBJC_PTHREAD_LIBS,;t t
-s, at OBJC_PTHREAD_CFLAGS@,$OBJC_PTHREAD_CFLAGS,;t t
-s, at HAVE_FRAMEWORK_COREFOUNDATION@,$HAVE_FRAMEWORK_COREFOUNDATION,;t t
-s, at HAVE_FRAMEWORK_SYSTEMCONFIGURATION@,$HAVE_FRAMEWORK_SYSTEMCONFIGURATION,;t t
-s, at HAVE_FRAMEWORK_IOKIT@,$HAVE_FRAMEWORK_IOKIT,;t t
-s, at HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER@,$HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER,;t t
-s, at REPLACEMENT_PROGS@,$REPLACEMENT_PROGS,;t t
-s, at EXTRA_PROGS@,$EXTRA_PROGS,;t t
-s, at DPORTSDIR@,$DPORTSDIR,;t t
-s, at PORTCONFIGDIR@,$PORTCONFIGDIR,;t t
-s, at DSTUSR@,$DSTUSR,;t t
-s, at DSTGRP@,$DSTGRP,;t t
-s, at DSTMODE@,$DSTMODE,;t t
-s, at CPP@,$CPP,;t t
-s, at READLINK_IS_NOT_P1003_1A@,$READLINK_IS_NOT_P1003_1A,;t t
-s, at MD5_LIBS@,$MD5_LIBS,;t t
-s, at X_CFLAGS@,$X_CFLAGS,;t t
-s, at X_PRE_LIBS@,$X_PRE_LIBS,;t t
-s, at X_LIBS@,$X_LIBS,;t t
-s, at X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
-s, at TCL_VERSION@,$TCL_VERSION,;t t
-s, at TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
-s, at TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
-s, at TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
-s, at TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
-s, at TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
-s, at TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
-s, at TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
-s, at TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
-s, at TCL_INCLUDES@,$TCL_INCLUDES,;t t
-s, at TCLSH@,$TCLSH,;t t
-s, at TCL_PACKAGE_DIR@,$TCL_PACKAGE_DIR,;t t
-s, at CURL_CONFIG@,$CURL_CONFIG,;t t
-s, at CFLAGS_LIBCURL@,$CFLAGS_LIBCURL,;t t
-s, at LDFLAGS_LIBCURL@,$LDFLAGS_LIBCURL,;t t
-s, at subdirs@,$subdirs,;t t
-s, at SQLITE3_LIBS@,$SQLITE3_LIBS,;t t
-s, at SQLITE3_DIR@,$SQLITE3_DIR,;t t
-s, at OUR_INCLUDED_PACKAGES@,$OUR_INCLUDED_PACKAGES,;t t
-s, at INCLUDES@,$INCLUDES,;t t
-s, at CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t
-s, at CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t
-s, at TCL_DEFS@,$TCL_DEFS,;t t
-s, at STLIB_LD@,$STLIB_LD,;t t
-s, at SHLIB_LD@,$SHLIB_LD,;t t
-s, at SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
-s, at SHLIB_LDFLAGS@,$SHLIB_LDFLAGS,;t t
-s, at SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
-s, at TCL_CC@,$TCL_CC,;t t
-s, at prefix_expanded@,$prefix_expanded,;t t
-s, at PORTCONFIGDIR_EXPANDED@,$PORTCONFIGDIR_EXPANDED,;t t
-s, at localstatedir_expanded@,$localstatedir_expanded,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+if test -n "$CONFIG_FILES"; then
 
 _ACEOF
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+OBJC!$OBJC$ac_delim
+OBJCFLAGS!$OBJCFLAGS$ac_delim
+ac_ct_OBJC!$ac_ct_OBJC$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+LN_S!$LN_S$ac_delim
+MTREE!$MTREE$ac_delim
+CVS!$CVS$ac_delim
+SVN!$SVN$ac_delim
+RSYNC!$RSYNC$ac_delim
+HAVE_LAUNCHD!$HAVE_LAUNCHD$ac_delim
+LAUNCHCTL!$LAUNCHCTL$ac_delim
+XCODEBUILD!$XCODEBUILD$ac_delim
+BZIP2!$BZIP2$ac_delim
+XAR!$XAR$ac_delim
+OPEN!$OPEN$ac_delim
+TAR!$TAR$ac_delim
+GNUTAR!$GNUTAR$ac_delim
+TAR_CMD!$TAR_CMD$ac_delim
+CFLAGS_QUICHEEATERS!$CFLAGS_QUICHEEATERS$ac_delim
+CFLAGS_WERROR!$CFLAGS_WERROR$ac_delim
+OBJCPP!$OBJCPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+OBJC_RUNTIME!$OBJC_RUNTIME$ac_delim
+OBJC_RUNTIME_FLAGS!$OBJC_RUNTIME_FLAGS$ac_delim
+OBJC_LIBS!$OBJC_LIBS$ac_delim
+OBJC_PTHREAD_LIBS!$OBJC_PTHREAD_LIBS$ac_delim
+OBJC_PTHREAD_CFLAGS!$OBJC_PTHREAD_CFLAGS$ac_delim
+HAVE_FRAMEWORK_COREFOUNDATION!$HAVE_FRAMEWORK_COREFOUNDATION$ac_delim
+HAVE_FRAMEWORK_SYSTEMCONFIGURATION!$HAVE_FRAMEWORK_SYSTEMCONFIGURATION$ac_delim
+HAVE_FRAMEWORK_IOKIT!$HAVE_FRAMEWORK_IOKIT$ac_delim
+HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER!$HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER$ac_delim
+REPLACEMENT_PROGS!$REPLACEMENT_PROGS$ac_delim
+EXTRA_PROGS!$EXTRA_PROGS$ac_delim
+PORTSDIR!$PORTSDIR$ac_delim
+MPCONFIGDIR!$MPCONFIGDIR$ac_delim
+DSTUSR!$DSTUSR$ac_delim
+DSTGRP!$DSTGRP$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
 
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 _ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+DSTMODE!$DSTMODE$ac_delim
+CPP!$CPP$ac_delim
+READLINK_IS_NOT_P1003_1A!$READLINK_IS_NOT_P1003_1A$ac_delim
+MD5_LIBS!$MD5_LIBS$ac_delim
+XMKMF!$XMKMF$ac_delim
+X_CFLAGS!$X_CFLAGS$ac_delim
+X_PRE_LIBS!$X_PRE_LIBS$ac_delim
+X_LIBS!$X_LIBS$ac_delim
+X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim
+TCL_VERSION!$TCL_VERSION$ac_delim
+TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
+TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
+TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim
+TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim
+TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim
+TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim
+TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim
+TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim
+TCL_INCLUDES!$TCL_INCLUDES$ac_delim
+TCLSH!$TCLSH$ac_delim
+TCL_PACKAGE_DIR!$TCL_PACKAGE_DIR$ac_delim
+CURL_CONFIG!$CURL_CONFIG$ac_delim
+CFLAGS_LIBCURL!$CFLAGS_LIBCURL$ac_delim
+LDFLAGS_LIBCURL!$LDFLAGS_LIBCURL$ac_delim
+subdirs!$subdirs$ac_delim
+SQLITE3_LIBS!$SQLITE3_LIBS$ac_delim
+SQLITE3_DIR!$SQLITE3_DIR$ac_delim
+OUR_INCLUDED_PACKAGES!$OUR_INCLUDED_PACKAGES$ac_delim
+INCLUDES!$INCLUDES$ac_delim
+CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim
+CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim
+TCL_DEFS!$TCL_DEFS$ac_delim
+STLIB_LD!$STLIB_LD$ac_delim
+SHLIB_LD!$SHLIB_LD$ac_delim
+SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim
+SHLIB_LDFLAGS!$SHLIB_LDFLAGS$ac_delim
+SHLIB_SUFFIX!$SHLIB_SUFFIX$ac_delim
+TCL_CC!$TCL_CC$ac_delim
+prefix_expanded!$prefix_expanded$ac_delim
+MPCONFIGDIR_EXPANDED!$MPCONFIGDIR_EXPANDED$ac_delim
+localstatedir_expanded!$localstatedir_expanded$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+_ACEOF
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
 
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
 
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
 
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  rm -f "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
 
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
 
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
 
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
 do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
+rm -f conftest.defines conftest.tail
 
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
-done
-_ACEOF
+  rm -f "$tmp/out12"
+ ;;
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
+  esac
+
+done # for ac_tag
+
+
 { (exit 0); exit 0; }
 _ACEOF
 chmod +x $CONFIG_STATUS
@@ -12124,7 +12500,10 @@
   # Remove --cache-file and --srcdir arguments so they do not pile up.
   ac_sub_configure_args=
   ac_prev=
-  for ac_arg in $ac_configure_args; do
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
     if test -n "$ac_prev"; then
       ac_prev=
       continue
@@ -12147,123 +12526,123 @@
       ac_prev=prefix ;;
     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
       ;;
-    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
     esac
   done
 
   # Always prepend --prefix to ensure using the same prefix
   # in subdir configurations.
-  ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
 
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
   ac_popdir=`pwd`
   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
 
     # Do not complain, so a configure script can configure whichever
     # parts of a large source tree are present.
-    test -d $srcdir/$ac_dir || continue
+    test -d "$srcdir/$ac_dir" || continue
 
-    { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
-echo "$as_me: configuring in $ac_dir" >&6;}
-    { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    echo "$as_me:$LINENO: $ac_msg" >&5
+    echo "$ac_msg" >&6
+    { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+    cd "$ac_dir"
 
-    cd $ac_dir
-
     # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
-    elif test -f $ac_srcdir/configure; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure'"
-    elif test -f $ac_srcdir/configure.in; then
-      ac_sub_configure=$ac_configure
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
     else
       { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
@@ -12275,21 +12654,21 @@
       # Make the cache file name correct relative to the subdirectory.
       case $cache_file in
       [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
-      *) # Relative path.
-	ac_sub_cache_file=$ac_top_builddir$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
       esac
 
-      { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
       # The eval makes quoting arguments work.
-      eval $ac_sub_configure $ac_sub_configure_args \
-	   --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
 	{ { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
    { (exit 1); exit 1; }; }
     fi
 
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/configure.ac	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,12 +1,12 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([MacPorts], [1.5], [macports-dev at lists.macosforge.org], [macports])
+AC_INIT([MacPorts], [1.6], [macports-dev at lists.macosforge.org], [macports])
 AC_CONFIG_SRCDIR([src/pextlib1.0/Pextlib.c])
 AC_CONFIG_HEADERS([src/config.h])
 AC_CANONICAL_SYSTEM
 
-# Check user PATH for DP paths, and remove as necessary.
-OD_PATH_SCAN
+# Check user PATH for MP paths, and remove as necessary.
+MP_PATH_SCAN
 
 # Checks for programs.
 AC_PROG_CC
@@ -36,7 +36,7 @@
 AC_ARG_VAR(XAR, [path to xar command])
 AC_ARG_VAR(OPEN, [path to open command])
 
-OD_TAR_NO_SAME_OWNER
+MP_TAR_NO_SAME_OWNER
 
 # Quiche eaters options.
 if test x$GCC = xyes; then
@@ -45,31 +45,31 @@
 AC_SUBST(CFLAGS_QUICHEEATERS)
 MP_WERROR
 
-OD_COMPILER_ATTRIBUTE_UNUSED
+MP_COMPILER_ATTRIBUTE_UNUSED
 MP_COMPILER_ATTRIBUTE_LF_PRIVATE
 
 # Foundation checks
 MP_OBJC_RUNTIME
 MP_OBJC_FOUNDATION
 
-OD_PROG_DAEMONDO
-#OD_PROG_XAR
+MP_PROG_DAEMONDO
+#MP_PROG_XAR
 
 AC_SUBST(REPLACEMENT_PROGS)
 AC_SUBST(EXTRA_PROGS)
 
-# set default dports-directory
-DPORTS_DIR_DEFAULT=`pwd | sed -e "s/base/dports/"`
+# set default ports-directory
+PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
 
 # Check for paths
 AC_PREFIX_DEFAULT(/opt/local)
-OD_PATH_DPORTSDIR([$DPORTS_DIR_DEFAULT])
-OD_PATH_PORTCONFIGDIR
+MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
+MP_PATH_MPCONFIGDIR
 
 # Check for install ownership
-OD_CHECK_INSTALLUSER
-OD_CHECK_INSTALLGROUP
-OD_DIRECTORY_MODE
+MP_CHECK_INSTALLUSER
+MP_CHECK_INSTALLGROUP
+MP_DIRECTORY_MODE
 
 # Check for standard header files.
 AC_HEADER_STDC
@@ -86,12 +86,12 @@
 AC_FUNC_FORK
 AC_FUNC_STRERROR_R
 AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile])
-DP_CHECK_READLINK_IS_P1003_1A
+MP_CHECK_READLINK_IS_P1003_1A
 
 # Check for md5 implementation
-OD_LIB_MD5
+MP_LIB_MD5
 # Check for X11 and paraphernalia
-OD_CHECK_X11
+MP_CHECK_X11
 
 # Check for readline
 AC_CHECK_LIB([readline], [readline])
@@ -117,16 +117,16 @@
 SC_PUBLIC_TCL_HEADERS
 
 # Check for tclsh binary
-OD_PROG_TCLSH
+MP_PROG_TCLSH
 
 # Check for Tcl package path
-OD_TCL_PACKAGE_DIR
+MP_TCL_PACKAGE_DIR
 
 # Check if thread is enabled.
-OD_TCL_THREAD_SUPPORT
+MP_TCL_THREAD_SUPPORT
 
 ## libcurl
-OD_LIBCURL_FLAGS
+MP_LIBCURL_FLAGS
 
 # Do we have curl_easy_strerror?
 AH_TEMPLATE([HAVE_CURL_EASY_STRERROR],
@@ -148,7 +148,7 @@
 
 # Check if thread package is already installed.
 if test "x$with_included_tclthread" = "xunspecified" ; then
-	OD_TCL_PACKAGE(
+	MP_TCL_PACKAGE(
 		[Thread],
 		[AC_MSG_RESULT([yes]); with_included_tclthread=no],
 		[AC_MSG_RESULT([no]); with_included_tclthread=yes])
@@ -183,8 +183,8 @@
 		tcl-sqlite3,
 		AS_HELP_STRING([--with-tcl-sqlite3=DIR],
 			[directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
-		[od_sqlite3_dir=$withval],
-		[od_sqlite3_dir=/usr/lib/sqlite3])
+		[mp_sqlite3_dir=$withval],
+		[mp_sqlite3_dir=/usr/lib/sqlite3])
 
 # If sqlite3 package isn't installed, configure and install sqlite3 package.
 if test "$with_included_sqlite3" = "yes"; then
@@ -198,19 +198,19 @@
 	mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
 	SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
 	if test "x$prefix" = "xNONE" ; then
-		SQLITE3_DIR=$ac_default_prefix/share/darwinports/Tcl/sqlite3
+		SQLITE3_DIR=$ac_default_prefix/share/macports/Tcl/sqlite3
 	else
-		SQLITE3_DIR=$prefix/share/darwinports/Tcl/sqlite3
+		SQLITE3_DIR=$prefix/share/macports/Tcl/sqlite3
 	fi
 else
 	SQLITE3_LIBS="-lsqlite3"
 
-	AC_CACHE_CHECK([for Tcl sqlite3 location], [od_cv_sqlite3_dir],
-		[od_cv_sqlite3_dir=
-		test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
+	AC_CACHE_CHECK([for Tcl sqlite3 location], [mp_cv_sqlite3_dir],
+		[mp_cv_sqlite3_dir=
+		test -r "${mp_sqlite3_dir}/pkgIndex.tcl" && mp_cv_sqlite3_dir=$mp_sqlite3_dir
 		])
 
-	SQLITE3_DIR=$od_cv_sqlite3_dir
+	SQLITE3_DIR=$mp_cv_sqlite3_dir
 fi
 
 AC_SUBST(SQLITE3_LIBS)
@@ -243,7 +243,7 @@
 AC_SUBST(TCL_STUB_LIB_SPEC)
 AC_SUBST(TCL_CC)
 
-#misc variables that need to be expanded for substitution into tcl
+# misc variables that need to be expanded for substitution into tcl
 
 oldprefix=$prefix
 if test "x$prefix" = "xNONE" ; then
@@ -254,9 +254,9 @@
 AC_SUBST(prefix_expanded)
 # do this twice, since there is a nested variable of
 # ${prefix} inside of ${sysconfdir}
-eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
-eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
-AC_SUBST(PORTCONFIGDIR_EXPANDED)
+eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
+eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
+AC_SUBST(MPCONFIGDIR_EXPANDED)
 eval "localstatedir_expanded=$localstatedir"
 AC_SUBST(localstatedir_expanded)
 
@@ -267,20 +267,19 @@
 dnl SC_CONFIG_MANPAGES
 
 # Output
-
 AC_CONFIG_FILES([
 	Makefile
-	Mk/dports.autoconf.mk
+	Mk/macports.autoconf.mk
 	doc/prefix.mtree
 	doc/macosx.mtree
-	doc/ports.conf
+	doc/macports.conf
 	src/Makefile
-	src/darwinports1.0/darwinports_autoconf.tcl
+	src/macports1.0/macports_autoconf.tcl
 	src/tclobjc1.0/Makefile
 	src/port1.0/port_autoconf.tcl
 	src/registry1.0/registry_autoconf.tcl
 	src/programs/Makefile
-	src/darwinports1.0/darwinports_fastload.tcl
+	src/macports1.0/macports_fastload.tcl
 ])
 
 AC_OUTPUT

Modified: trunk/base/doc/INTERNALS
===================================================================
--- trunk/base/doc/INTERNALS	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/INTERNALS	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
-DARWIN PORTS INTERNALS
+MacPorts Internals:
 
-The DarwinPorts system is composed of three TCL libraries:
-	darwinports - public API
+The MacPorts system is composed of three TCL libraries:
+	macports - public API
 	port - portfile parsing and execution
 	pextlib - necessary C extensions to TCL
 
@@ -9,36 +9,36 @@
 for complex versioning and have a provide/require model of use, making
 them well suited for maintaining a backwards compatable ports system.
 
-    The "darwinports" TCL Library provides a public API into the MarwinPorts
+    The "macports" TCL Library provides a public API into the MacPorts
 system. Any external application wishing to manipulate a port can
-load the "darwinports" TCL library. 'port', the included command line port
-utility, uses only the exported "darwinports" API.
+load the "macports" TCL library. 'port', the included command line port
+utility, uses only the exported "macports" API.
 
-    The "darwinports" API provides very simple primitives for dealing with
-ports (ie, dportexec/dportopen/dportget). Also, the API has very little
+    The "macports" API provides very simple primitives for dealing with
+ports (ie, mportexec/mportopen/mportget). Also, the API has very little
 knowledge of the contents of a portfile; instead, it relies entirely upon
 the "port" TCL library. By keeping the high level API simple and generic,
 a revision of the underlying ports system will not necessarily require
-a revision of the high level "darwinports" API.
+a revision of the high level "macports" API.
 
     TCL packages allow for complex versioning with a strong requires/provides
 model; this means that a revision of the API at any level will not break
 backwards compatibility.
 
-    When parsing a port, the "darwinports" library loads the Portfile into a
+    When parsing a port, the "macports" library loads the Portfile into a
 sub-interpreter. The "port" library and all port-specific code is run
 entirely within this sub-interpreter, and thus can never pollute the TCL
-space of other ports, the "darwinports" library, or the calling application.
+space of other ports, the "macports" library, or the calling application.
 
-    The "darwinports" library is also responsible for loading user specified
+    The "macports" library is also responsible for loading user specified
 options into the sub-interpreter to be evaluated by the "ports" library. In
 that case it sets the variable name in the sub-interpreter and adds the
 option to the sub-interpreter's global array user_options(). User options
-are passed as part of the call to dportopen.
+are passed as part of the call to mportopen.
 
-    The "port" TCL package provides all the primitives required for a darwin
+    The "port" TCL package provides all the primitives required for a mac
 portfile to be parsed, queried, and its actions executed. It also provides
-a single procedure call that the "darwinports" TCL package uses to kick off
+a single procedure call that the "macports" TCL package uses to kick off
 execution: "eval_targets".
 
     The port TCL package is loaded by every Portfile with the following line

Modified: trunk/base/doc/Makefile
===================================================================
--- trunk/base/doc/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,10 +1,10 @@
-MAN5=		ports.conf.5
+MAN5=		macports.conf.5
 MAN7=		portfile.7 portstyle.7 porthier.7 portgroup.7
 INSTALLDIR=	${DESTDIR}${prefix}
 TOPSRCDIR=	..
 
 ifneq ($(MAKECMDGOALS),distclean)
-include ../Mk/dports.autoconf.mk
+include ../Mk/macports.autoconf.mk
 endif
 
 all:
@@ -14,11 +14,11 @@
 test:
 
 distclean: clean
-	rm -f prefix.mtree ports.conf macosx.mtree
+	rm -f prefix.mtree macports.conf macosx.mtree
 
 install:
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${portconfigdir}
+	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${mpconfigdir}
 
 	cat prefix.mtree | $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
 	if test -L "${INSTALLDIR}/man" ; then \
@@ -28,33 +28,25 @@
 	if test ! -e "${INSTALLDIR}/man" ; then \
 		$(LN_S) share/man ${INSTALLDIR}/man; \
 	fi
-	# Install the ports.conf file. If it's already installed, upgrade it
-	if test ! -e ${DESTDIR}/${portconfigdir}/ports.conf ; then \
+
+	if test ! -e ${DESTDIR}${mpconfigdir}/macports.conf ; then \
 		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 ports.conf ${DESTDIR}${portconfigdir}; \
-	else \
-		sed -e s/rsync.opendarwin.org/rsync.darwinports.org/ ${DESTDIR}${portconfigdir}/ports.conf > ${DESTDIR}${portconfigdir}/ports.conf.tmp && \
-			mv ${DESTDIR}${portconfigdir}/ports.conf.tmp ${DESTDIR}${portconfigdir}/ports.conf; \
+		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macports.conf ${DESTDIR}${mpconfigdir}; \
 	fi
-
-	# Install the sources.conf file. If it's already installed, upgrade it
-	if test ! -e ${DESTDIR}${portconfigdir}/sources.conf ; then \
+	if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
 		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${portconfigdir}; \
-	else \
-		sed -e s/rsync.opendarwin.org/rsync.darwinports.org/ ${DESTDIR}${portconfigdir}/sources.conf > ${DESTDIR}${portconfigdir}/sources.conf.tmp && \
-			mv ${DESTDIR}${portconfigdir}/sources.conf.tmp ${DESTDIR}${portconfigdir}/sources.conf; \
+		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${mpconfigdir}; \
 	fi
-
-	$(SILENT)if test ! -e ${DESTDIR}${portconfigdir}/variants.conf ; then \
+	if test ! -e ${DESTDIR}${mpconfigdir}/variants.conf ; then \
 		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${portconfigdir}; \
+		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${mpconfigdir}; \
 	fi
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${DESTDIR}${portconfigdir}
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/darwinports/resources/port1.0/install
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${INSTALLDIR}/share/darwinports/resources/port1.0/install/
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macosx.mtree ${INSTALLDIR}/share/darwinports/resources/port1.0/install/
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ports.conf.5 ${INSTALLDIR}/share/man/man5
+
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${DESTDIR}${mpconfigdir}
+	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/macports/resources/port1.0/install
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${INSTALLDIR}/share/macports/resources/port1.0/install/
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macosx.mtree ${INSTALLDIR}/share/macports/resources/port1.0/install/
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports.conf.5 ${INSTALLDIR}/share/man/man5
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 portfile.7 ${INSTALLDIR}/share/man/man7
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 portstyle.7 ${INSTALLDIR}/share/man/man7
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 porthier.7 ${INSTALLDIR}/share/man/man7

Deleted: trunk/base/doc/README.platforms
===================================================================
--- trunk/base/doc/README.platforms	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/README.platforms	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,62 +0,0 @@
-DarwinPorts can be used on platforms other than Mac OS X 10.2 and 10.3,
-but requires bootstrapping of various requirements.
-
-Currently, DarwinPorts has been verified to work on the following
-platforms:
-
-Solaris (Sparc) 8 & 9 (tcl, curl, openssl, bzip2 need to be installed manually)
-FreeBSD >= 4.8 (tcl and curl need to be installed manually)
-OpenBSD >= 3.3 (tcl, curl and bzip2 need to be installed manually)
-
-We will be assuming that you are installing into PREFIX=/opt/local,
-although any path can be used. Further, we are assuming a sh-based shell
-
-The following compilers have been tested:
-
-Solaris:
-Sunsoft Forte Developer 7 C 5.4
-
-0)
-PREFIX=/opt/local
-export PREFIX
-
-INSTALL REQUIREMENTS
-1) Tcl. Use the Portfile as a template
-gzip -c -d tcl8.4.6-src.tar.gz | tar xf -
-cd tcl8.4.6
-cd unix
-./configure --prefix=$PREFIX --mandir=$PREFIX/share/man
-make
-make install
-cd $PREFIX/bin
-ln -s tclsh8.4 tclsh
-$ echo puts foo | tclsh
-foo
-
-2) OpenSSL
-gzip -c -d openssl-0.9.7d.tar.gz | tar xf -
-cd openssl-0.9.7d
-./config --prefix=$PREFIX --openssldir=$PREFIX/etc/openssl no-asm no-krb5 shared
-make
-make install
-export LD_LIBRARY_PATH=$PREFIX/lib
-
-3) Curl
-gzip -c -d curl-7.11.1.tar.gz | tar xf -
-cd curl-7.11.1
-./configure --prefix=$PREFIX --mandir=$PREFIX/share/man --with-ssl=$PREFIX
-make
-make install
-curl --version
-
-4) GNU coreutils
-gzip -c -d coreutils-5.2.1.tar.gz | tar xf -
-cd coreutils-5.2.1
-./configure --prefix=$PREFIX --mandir=$PREFIX/share/man
-make
-make install
-
-5) darwinports
-./configure --prefix=$PREFIX --with-install-user=ssen --with-install-group=mit --with-tcl=$PREFIX/lib --with-tclinclude=$PREFIX/include CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib"
-make
-make install

Modified: trunk/base/doc/exampleport/Portfile
===================================================================
--- trunk/base/doc/exampleport/Portfile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/exampleport/Portfile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,52 +1,60 @@
-# All ports must start with a RCS Id tag and a PortSystem declaration
-# Ensure that the RCS Id tag is commented out in your Portfile
-# RCS Id tag:
+# All ports must have the "svn:keywords : Id" and "svn:eol-style : native"
+# svn props set on them and start with a commented out Id tag, which
+# the server will expand:
 # $Id$
 
+# Following that comes the PortSystem declaration:
 # PortSystem <version>
 # where version is the version of the ports system your port relies upon.
 # This can NOT be commented out.
 PortSystem 1.0
 
 # The name of the port
-name		fetch
+name		glib2
 
 # Its version information
-version		4.6.2-RELEASE
+version	      2.12.11
 
 # Categories and identifying keywords
-categories	net
+categories	devel
 
 # Email address(es) of the port's Maintainer(s)
-maintainers	eric at opendarwin.org
+maintainers	ryandesign at macports.org
 
 # A short description of this port
-description	"A utility for fetching files by URL"
+description	Library with data structure functions and other constructs
 
 # A long description, with more details
-long_description "fetch is a utility to fetch files by their URL, \
-                  fetch originally comes from FreeBSD."
+long_description      Glib is a library which includes support routines for \
+		      C, such as lists, trees, hashes, memory allocation, and \
+		      many other things.
 
+# Homepage for the port:
+http://www.gtk.org/
+
 # Master download sites for port's distribution file(s)
-master_sites	http://www.opendarwin.org/~eric/
+master_sites	ftp://ftp.gtk.org/pub/glib/2.12 \
+		gnome:sources/glib/2.12
 
 # Name of the distribution file, minus extract suffix (see below)
-distname	${portname}-${portversion}
+distname	glib-${version}
 
 # (Optional) Explicitly set suffix (default: .tar.gz)
 #extract.suffix	.tar.bz2
 
 # (Optional) Use bzip2 instead of gzip for uncompressing distribution file
-#use_bzip2	yes
+use_bzip2	yes
 
 # List of checksums for files to be fetched
 # <file name> <checksum type> <checksum>
-# Currently the only supported checksum type is md5
-checksums	${distname}${extract.suffix} md5 45627db03b6cf89b8dabae6d815dcd9b
+checksums	${distname}${extract.suffix} md5 077a9917b673a9a0bc63f351786dde24 \
+		${distname}${extract.suffix} sha1 02d344295ddaeafeec6bc6824b71e12bbf1b0394 \
+		${distname}${extract.suffix} rmd160 8680d27e630643e6653d88537907d06e3ba6e91a
 
 # Any patches which should be applied after extracting this port.  These
+
 # should go in the files/ subdirectory of the port.
-#patchfiles	patch-Makefiles patch-configure
+patchfiles	patch-glib-2.0.pc.in patch-glib__gutils.c
 
 # Dependencies are defined by three settings:
 #    depends_lib:	installed at build time and at install time
@@ -64,10 +72,22 @@
 #		    must be a complete regexp.
 #	portname must be the name of a valid port to build and install
 #	if the depspec is not matched.
-depends_lib	lib:libfetch.3:libfetch
+#	An alternative dependency depspec is the port:<portname> syntax,
+#	used when you want to insure the given dependency is satisfied
+#	exclusively by MacPorts.
+depends_build	    port:pkgconfig
+depends_lib	    port:gettext
 
 # The type of configuration script this port uses.
-#configure.type	gnu
+#configure.type     gnu
 
+# A list of configuration time arguments you might want to pass to the configure script:
+configure.args   --mandir=${prefix}/share/man
+
 # The directory name of the subdirectory of work/ where this port extracts
-#worksrcdir	fetch
+#worksrcdir	glib
+
+# Alternative ways to build the port, packed as 'variants'
+variant puredarwin { depends_run bin:perl:perl5.8 }
+
+

Copied: trunk/base/doc/macports.conf.5 (from rev 26176, branches/dp2mp-move/base/doc/macports.conf.5)
===================================================================
--- trunk/base/doc/macports.conf.5	                        (rev 0)
+++ trunk/base/doc/macports.conf.5	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,184 @@
+.\" Copyright (c) 2005 Matt Anton <matt at opendarwin.org>
+.\" Copyright (c) 2007 Juan Manuel Palacios <jmpp at macports.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY Eric Melville AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd May 22, 2007
+.Dt MACPORTS.CONF 5 "MacPorts"
+.Os 
+.Sh NAME
+macports.conf
+.Nd Configuration file of the MacPorts system
+.Sh DESCRIPTION
+.Nm macports.conf
+is the configuration file used to bootstrap the MacPorts system. This file is read by the
+.Nm port
+command and determines how it behaves. Lines beginning with '#' are comments, empty lines are ignored.
+The format is that of a simple key/value space or tab separated pair.
+.Pp
+The file contains entries of the form:
+.Pp
+.Dl Va "<key> <value>"
+.Pp
+The value of any given key can be referred to by the '${<keyname>}' abstraction, where <keyname> expands
+to the key in question.
+.Pp
+.Sh KEYS
+The following keys are used by
+.Nm port
+itself:
+.Pp
+.Bl -tag -width lc
+.It Va prefix
+Sets the directory where ports are installed. Any path may be used but those with spaces and/or non ascii
+characters should be avoided, as this can broke some ports. This key is often referred to as '${prefix}'.
+.br
+.Ic Default:
+/opt/local
+.It Va x11prefix
+Path containing an X11 installation on your system.
+.br
+.Ic Default:
+/usr/X11R6
+.It Va portdbpath
+Directory where MacPorts keeps working data as downloaded sources, installed ports receipts
+and the main registry. Same path restrictions apply as for '${prefix}'.
+.br
+.Ic Default:
+${prefix}/var/macports
+.It Va portdbformat
+Storage type to use for the MacPorts registry. Currently the only supportted format is "flat".
+.br
+.Ic Default:
+flat
+.It Va portinstalltype
+Sets the mode in which ports are installed by MacPorts. Supported values are 'direct' or 'image'.
+The 'direct' mode is often used on systems that do not support 'image' due to limitations in their
+installed version of TCL. In 'direct' more ports are installed directly into '${prefix}' and only
+one flavor of a port can be installed at any given time. In 'image' mode multiple flavors of a port
+(i.e., different versions and/or any possible combination of its variants) can be installed concurrently
+into '${portdbpath}/software/${portname}' and only one can be "activated" onto '${prefix}' via soft or
+hard links from the former to the latter.
+.br
+.Ic Default:
+image
+.\" I think Paul wrote code to suppot image on Jaguar, so the following comment may no longer be needed.
+.\" is this the case?
+.Pp
+NOTE. Mac OS X 10.2 and Darwin 6.x users should switch to 'direct' mode to have MacPorts working properly
+on their systems.
+.It Va sources_conf
+Location of the sources file. This file enables rsync synchronization of the default ports tree with the
+MacPorts rsync server (through the "sync" target of the
+.Nm port
+commnand) and any other local tree(s) you might have.
+.br
+.Ic Default:
+${prefix}/etc/macports/sources.conf
+.It Va variants_conf
+Location of the optional global variants definition file, listing those that should be used in all installed
+ports if available.
+.br
+.Ic Default:
+${prefix}/etc/macports/variants.conf
+.It Va portarchivemode
+Key governing the creation of binary archives of installed ports for installation/reinstallation ease.
+.br
+.Ic Default:
+yes
+.It Va portarchivepath
+Location where to store/retrieve ports binary archive files from when archive mode is active.
+.br
+.Ic Default:
+${portdbpath}/packages
+.It Va portarchivetype
+Colon or comma separated, space free list of supported formats of archives to create or read from when
+\&'${archivemode}' is set to 'yes'. Use of multiple types will cause archive creation to build all the
+specified types in one step. Unarchive uses multiple types as a search list to locate any existing archive,
+with the first found match being used.
+.br
+Supported types are: tgz, tar, tbz, tbz2, xar, zip, cpgz, cpio
+.br
+.Ic Default:
+tgz
+.It Va portautoclean
+Automatic cleaning of the build directory of a given port after it has been installed.
+.br
+.Ic Default:
+yes
+.It Va startupitem_type
+Set the default type of startupitems to be generated, overridable by Portfiles that explicitly state a
+startupitem.type key. If set to "default", then a type will be selected that's appropriate to the OS.
+Supported types are: SystemStarter, launchd, default, rcNG.
+.br
+.Ic Default:
+default
+.It Va destroot_umask
+Umask value to use during the destrooting or a port.
+.br
+.Ic Default:
+022
+.It Va rsync_server
+Default rsync server to connect to when running "selfupdate" through the
+.Nm port
+command to update your entire MacPorts
+installation (spanning both the MacPorts infrastucture and the ports tree).
+.br
+.Ic Default:
+rsync.macports.org
+.It Va rsync_dir
+Rsync directory from which to pull MacPorts sources from the rsync server.
+.br
+.Ic Default:
+release/base/ (which pulls sources for the currently shipping MacPorts release)
+.It Va rsync_options
+Default rsync options to use when connecting to the rsync server.
+.br
+.Ic Default:
+-rtzv --delete-after
+.It Va binpath
+Sets the directory search path for locating system executables used by MacPorts. This variable should contain
+the paths for locating utilities such as rsync, tar, cvs and others.
+.br
+.Ic Default:
+${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+.It Va extra_env
+List of extra environment variables MacPorts should keep in the user's environment when sanitizing it.
+.El
+.Sh FILES
+.Bl -tag -width
+.It Va ${prefix}/etc/macports/macports.conf
+Standard system-wide MacPorts configuration file.
+.It Va ~/.macports/macports.conf
+User-specific configuration override. This file, if found, will be used instead of the default file at
+${prefix}/etc/macports/macports.conf.
+.El
+.Sh SEE ALSO
+.Xr port 1 ,
+.Xr portfile 7 ,
+.Xr portgroup 7 ,
+.Xr portstyle 7
+.Xr porthier 7 ,
+.Sh AUTHORS
+.An "Juan Manuel Palacios" Aq jmpp at macports.org
+.An "Matt Anton" Aq matt at opendarwin.org

Copied: trunk/base/doc/macports.conf.in (from rev 26176, branches/dp2mp-move/base/doc/macports.conf.in)
===================================================================
--- trunk/base/doc/macports.conf.in	                        (rev 0)
+++ trunk/base/doc/macports.conf.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,65 @@
+# MacPorts system wide configuration file
+# $Id$
+
+# Set the directory in which to install ports
+prefix			@prefix_expanded@
+
+# Where to store MacPorts working data
+portdbpath		@localstatedir_expanded@/macports
+
+# Type of storage to use for the port registry information, "flat" or "sqlite"
+# NOTE: sqlite not yet supported.
+portdbformat		flat
+
+# Type of installation to do for ports, "direct" or "image".  See macports.conf(5) and online documentation.
+portinstalltype		image
+
+# Directory containing the X11 installation.
+x11prefix		/usr/X11R6
+
+# Where to find the sources list.
+sources_conf		@MPCONFIGDIR_EXPANDED@/sources.conf
+
+# Where to find global variants definition file (optional)
+variants_conf		@MPCONFIGDIR_EXPANDED@/variants.conf
+
+# Create and use binary archive packages for installation/reinstallation ease
+portarchivemode		no
+
+# Where to store/retrieve ports binary archive files
+portarchivepath		@localstatedir_expanded@/macports/packages
+
+# Type of binary archive packages to create when using archive mode
+#
+# Note: Multiple types ARE allowed and must be a colon or comma
+# separated list of choices (NO spaces). Use of multiple types will
+# cause archive creation to build all the specified types in one step.
+# Unarchive uses multiple types as a search list to locate the archive,
+# first archive to match one of the specified types in order is used.
+#
+# Supported types: tgz (default), tar, tbz, tbz2, xar, zip, cpgz, cpio
+portarchivetype		tgz
+
+# Set whether to automatically execute "clean" after "install" of ports
+portautoclean		yes
+
+# Rsync server to fetch MacPorts sources from
+rsync_server		rsync.macports.org
+
+# Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
+rsync_dir			release/base/
+
+# Rsync options
+rsync_options		-rtzv --delete-after
+
+# Options for generated startup items
+# startupitem_type may be "default", "systemstarter", or "launchd";
+# if the option is empty or "default" then a startupitem type appropriate
+# to the platform will be chosen. Tiger will default to launchd, while
+# older Mac OS X systems will default to systemstarter.
+startupitem_type	default
+
+# Extra environment variables to keep. Any variables listed here are added
+# to the list of variables that are not removed from the environment used
+# while processing ports
+# extra_env			KEEP_THIS THIS_TOO

Modified: trunk/base/doc/portfile.7
===================================================================
--- trunk/base/doc/portfile.7	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/portfile.7	2007-06-15 10:11:22 UTC (rev 26177)
@@ -28,7 +28,7 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .Dd February 13, 2007
-.Dt PORTFILE 7 "Apple Inc."
+.Dt PORTFILE 7 "MacPorts"
 .Os Darwin
 .Sh NAME
 .Nm Portfile
@@ -157,7 +157,7 @@
 .Em required
 .br
 .Sy Example:
-.Dl maintainers landonf at opendarwin.org kevin at opendarwin.org
+.Dl maintainers landonf at macports.org
 .It Ic platforms
 Declares which platforms are supported by the port.
 .br
@@ -1836,7 +1836,7 @@
 .El
 .Sh SEE ALSO
 .Xr port 1 ,
-.Xr ports.conf 5 ,
+.Xr macports.conf 5 ,
 .Xr portgroup 7 ,
 .Xr portstyle 7 ,
 .Xr porthier 7 ,
@@ -1846,6 +1846,6 @@
 .An "Juan Manuel Palacios" Aq jmpp at macports.org
 .An "Mark Duling" Aq markd at macports.org
 .An "Kevin Van Vechten" Aq kevin at opendarwin.org
-.An "Jordan K. Hubbard" Aq jkh at opendarwin.org
+.An "Jordan K. Hubbard" Aq jkh at macports.org
 .An "Chris Ridd" Aq cjr at opendarwin.org
 .An "Kevin Ballard" Aq eridius at macports.org

Modified: trunk/base/doc/portgroup.7
===================================================================
--- trunk/base/doc/portgroup.7	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/portgroup.7	2007-06-15 10:11:22 UTC (rev 26177)
@@ -271,7 +271,7 @@
 .Em no
 .It Ic configure.args
 .Sy Default:
-.Em CC=gcc-dp-4.1
+.Em CC=gcc-mp-4.1
 .br
 .It Ic build.type
 .Sy Default:

Modified: trunk/base/doc/porthier.7
===================================================================
--- trunk/base/doc/porthier.7	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/porthier.7	2007-06-15 10:11:22 UTC (rev 26177)
@@ -30,7 +30,7 @@
 .\" $Id$
 .\"
 .\" Take from FreeBSD and adjusted to MacPortss' needs.
-.Dd August 31, 2005
+.Dd June 1, 2007
 .Dt PORTHIER 7
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Sh DESCRIPTION
 A sketch of the filesystem hierarchy as it is applied on ports being distributed by MacPorts.
 .Bl -tag -width "/Applications/"
-.It Pa /${prefix}/
+.It Pa ${prefix}/
 The base of the MacPorts filesystem hierarchy. By default set to "/opt/local/"
 .Pp
 .Bl -tag -width "include/"
@@ -81,10 +81,9 @@
 .Bl -tag -width "spool/" -compact
 .It Pa db/
 misc. automatically generated system-specific database files
-.Bl -tag -width "dports/"
-.It Pa dports/
+.It Pa macports/
 MacPorts runtime data
-.Bl -tag -width "build/"
+.Bl -tag -width "build/" -compact
 .It Pa build/
 Where ports are build and destrooted
 .It Pa distfiles/
@@ -127,7 +126,7 @@
 .El
 .Sh SEE ALSO
 .Xr port 1 ,
-.Xr ports.conf 5 ,
+.Xr macports.conf 5 ,
 .Xr portfile 7 ,
 .Xr portgroup 7 ,
 .Xr portstyle 7 ,
@@ -138,3 +137,4 @@
 manual page appeared first in MacPorts. Lots of it is based on hier(7).
 .Sh AUTHORS
 .An "Felix Kronlage" Aq fkr at opendarwin.org
+.An "Juan Manuel Palacios" Aq jmpp at macports.org

Deleted: trunk/base/doc/ports.conf.5
===================================================================
--- trunk/base/doc/ports.conf.5	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/ports.conf.5	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,183 +0,0 @@
-.\" Copyright (c) 2005 Matt Anton <matt at opendarwin.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Eric Melville AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.Dd August 31, 2005
-.Dt PORTS.CONF 5 "MacPorts.org"
-.Os 
-.Sh NAME
-ports.conf
-.Nd Configuration file of the MacPorts system
-.Sh DESCRIPTION
-.Nm ports.conf
-is the configuration file used to bootstrap the MacPorts system. This file is read by the
-.Nm port
-command and determines how it behaves. Lines beginning with '#' are comments, empty lines are ignored.
-The format is that of a simple key/value space or tab separated pair.
-.Pp
-The file contains entries of the form:
-.Pp
-.Dl Va "<key> <value>"
-.Pp
-The value of any given key can be referred to by the '${<keyname>}' abstraction, where <keyname> expands
-to the key in question.
-.Pp
-.Sh KEYS
-The following keys are used by
-.Nm port
-itself:
-.Pp
-.Bl -tag -width lc
-.It Va prefix
-Sets the directory where ports are installed. Any path may be used but those with spaces and/or non ascii
-characters should be avoided, as this can broke some ports. This key is often referred to as '${prefix}'.
-.br
-.Ic Default:
-/opt/local
-.It Va x11prefix
-Path containing an X11 installation on your system.
-.br
-.Ic Default:
-/usr/X11R6
-.It Va portdbpath
-Directory where MacPorts keeps working data as downloaded sources, installed ports receipts
-and the main registry. Same path restrictions apply as for '${prefix}'.
-.br
-.Ic Default:
-${prefix}/var/db/dports
-.It Va portdbformat
-Storage type to use for the MacPorts registry. Currently the only supportted format is "flat".
-.br
-.Ic Default:
-flat
-.It Va portinstalltype
-Sets the mode in which ports are installed by MacPorts. Supported values are 'direct' or 'image'.
-The 'direct' mode is often used on systems that do not support 'image' due to limitations in their
-installed version of TCL. In 'direct' more ports are installed directly into '${prefix}' and only
-one flavor of a port can be installed at any given time. In 'image' mode multiple flavors of a port
-(i.e., different versions and/or any possible combination of its variants) can be installed concurrently
-into '${portdbpath}/software/${portname}' and only one can be "activated" onto '${prefix}' via soft or
-hard links from the former to the latter.
-.br
-.Ic Default:
-image
-.\" I think Paul wrote code to suppot image on Jaguar, so the following comment may no longer be needed.
-.\" is this the case?
-.Pp
-NOTE. Mac OS X 10.2 and Darwin 6.x users should switch to 'direct' mode to have MacPorts working properly
-on their systems.
-.It Va sources_conf
-Location of the sources file. This file enables rsync synchronization of the default dports tree with the
-MacPorts rsync server (through the "sync" target of the
-.Nm port
-commnand) and any other local tree(s) you might have.
-.br
-.Ic Default:
-${prefix}/etc/ports/sources.conf
-.It Va variants_conf
-Location of the optional global variants definition file, listing those that should be used in all installed
-ports if available.
-.br
-.Ic Default:
-${prefix}/etc/ports/variants.conf
-.It Va portarchivemode
-Key governing the creation of binary archives of installed ports for installation/reinstallation ease.
-.br
-.Ic Default:
-yes
-.It Va portarchivepath
-Location where to store/retrieve ports binary archive files from when archive mode is active.
-.br
-.Ic Default:
-${prefix}/var/db/dports/packages
-.It Va portarchivetype
-Colon or comma separated, space free list of supported formats of archives to create or read from when
-\&'${archivemode}' is set to 'yes'. Use of multiple types will cause archive creation to build all the
-specified types in one step. Unarchive uses multiple types as a search list to locate any existing archive,
-with the first found match being used.
-.br
-Supported types are: tgz, tar, tbz, tbz2, xar, zip, cpgz, cpio
-.br
-.Ic Default:
-tgz
-.It Va portautoclean
-Automatic cleaning of the build directory of a given port after it has been installed.
-.br
-.Ic Default:
-yes
-.It Va startupitem_type
-Set the default type of startupitems to be generated, overridable by Portfiles that explicitly state a
-startupitem.type key. If set to "default", then a type will be selected that's appropriate to the OS.
-Supported types are: SystemStarter, launchd, default, rcNG.
-.br
-.Ic Default:
-default
-.It Va destroot_umask
-Umask value to use during the destrooting or a port.
-.br
-.Ic Default:
-022
-.It Va rsync_server
-Default rsync server to connect to when running "selfupdate" through the
-.Nm port
-command to update your entire MacPorts
-installation (spanning both the MacPorts infrastucture and the dports tree).
-.br
-.Ic Default:
-rsync.darwinports.org
-.It Va rsync_dir
-Rsync directory from which to pull MacPorts sources from the rsync server.
-.br
-.Ic Default:
-dpupdate1/base/ (which pulls sources for the currently shipping MacPorts release)
-.It Va rsync_options
-Default rsync options to use when connecting to the rsync server.
-.br
-.Ic Default:
--rtzv --delete --delete-after
-.It Va binpath
-Sets the directory search path for locating system executables used by MacPorts. This variable should contain
-the paths for locating utilities such as rsync, tar, cvs and others.
-.br
-.Ic Default:
-${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
-.It Va extra_env
-List of extra environment variables MacPorts should keep in the user's environment when sanitizing it.
-.El
-.Sh FILES
-.Bl -tag -width
-.It Va ${prefix}/etc/ports/ports.conf
-Standard system-wide MacPorts configuration file.
-.It Va ~/.macports/ports.conf
-User-specific configuration override. This file, if found, will be used instead of the default file at
-${prefix}/etc/ports/ports.conf.
-.El
-.Sh SEE ALSO
-.Xr port 1 ,
-.Xr portfile 7 ,
-.Xr portgroup 7 ,
-.Xr portstyle 7
-.Xr porthier 7 ,
-.Sh AUTHORS
-.An "Juan Manuel Palacios" Aq jmpp at macports.org
-.An "Matt Anton" Aq matt at opendarwin.org

Deleted: trunk/base/doc/ports.conf.in
===================================================================
--- trunk/base/doc/ports.conf.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/ports.conf.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,65 +0,0 @@
-# MacPorts system wide configuration file
-# $Id$
-
-# Set the directory in which to install ports
-prefix			@prefix_expanded@
-
-# Where to store MacPorts working data
-portdbpath		@localstatedir_expanded@/db/dports
-
-# Type of storage to use for the port registry information, "flat" or "sqlite"
-# NOTE: sqlite not yet supported.
-portdbformat		flat
-
-# Type of installation to do for ports, "direct" or "image".  See ports.conf(5) and online documentation.
-portinstalltype		image
-
-# Directory containing the X11 installation.
-x11prefix		/usr/X11R6
-
-# Where to find the sources list.
-sources_conf		@PORTCONFIGDIR_EXPANDED@/sources.conf
-
-# Where to find global variants definition file (optional)
-variants_conf		@PORTCONFIGDIR_EXPANDED@/variants.conf
-
-# Create and use binary archive packages for installation/reinstallation ease
-portarchivemode		no
-
-# Where to store/retrieve ports binary archive files
-portarchivepath		@localstatedir_expanded@/db/dports/packages
-
-# Type of binary archive packages to create when using archive mode
-#
-# Note: Multiple types ARE allowed and must be a colon or comma
-# separated list of choices (NO spaces). Use of multiple types will
-# cause archive creation to build all the specified types in one step.
-# Unarchive uses multiple types as a search list to locate the archive,
-# first archive to match one of the specified types in order is used.
-#
-# Supported types: tgz (default), tar, tbz, tbz2, xar, zip, cpgz, cpio
-portarchivetype		tgz
-
-# Set whether to automatically execute "clean" after "install" of ports
-portautoclean		yes
-
-# Rsync server to use
-rsync_server		rsync.darwinports.org
-
-# Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
-rsync_dir			dpupdate1/base/
-
-# Rsync options
-rsync_options		-rtzv --delete --delete-after
-
-# Options for generated startup items
-# startupitem_type may be "default", "systemstarter", or "launchd";
-# if the option is empty or "default" then a startupitem type appropriate
-# to the platform will be chosen. Tiger will default to launchd, while
-# older Mac OS X systems will default to systemstarter.
-startupitem_type	default
-
-# Extra environment variables to keep. Any variables listed here are added
-# to the list of variables that are not removed from the environment used
-# while processing ports
-# extra_env			KEEP_THIS THIS_TOO

Modified: trunk/base/doc/portstyle.7
===================================================================
--- trunk/base/doc/portstyle.7	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/portstyle.7	2007-06-15 10:11:22 UTC (rev 26177)
@@ -119,7 +119,7 @@
 solution is to break the rules.
 .Sh SEE ALSO
 .Xr port 1 ,
-.Xr ports.conf 5 ,
+.Xr macports.conf 5 ,
 .Xr portfile 7 ,
 .Xr portgroup 7 ,
 .Xr porthier 7

Modified: trunk/base/doc/prefix.mtree.in
===================================================================
--- trunk/base/doc/prefix.mtree.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/prefix.mtree.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -236,12 +236,10 @@
         ..
     ..
     var
-        db
-            dports
-                distfiles
-                ..
-                receipts
-                ..
+        macports
+            distfiles
+	    ..
+            receipts
             ..
         ..
     ..

Modified: trunk/base/doc/sources.conf
===================================================================
--- trunk/base/doc/sources.conf	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/sources.conf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,13 +2,13 @@
 # $Id$
 #
 # To enable your local ports repository, uncomment and customize the
-# following line to point at your local dports directory
-# Example: file:///Users/landonf/misc/MacPorts/dports
+# following line to point at your local ports directory
+# Example: file:///Users/landonf/misc/MacPorts/ports
 #
 # To prevent a source from synchronizing when `port sync` is used,
 # append [nosync] to the end of the line
 # Example: file:///Users/landonf/misc/MacPorts/dports [nosync]
 #
-# To get MacPorts from the rsync.macports.org server use:
-# rsync://rsync.darwinports.org/dpupdate/dports
-rsync://rsync.darwinports.org/dpupdate/dports
+# To get the ports tree from the MacPorts rsync.macports.org server use:
+# rsync://rsync.macports.org/release/ports/
+rsync://rsync.macports.org/release/ports/

Modified: trunk/base/doc/variants.conf
===================================================================
--- trunk/base/doc/variants.conf	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/doc/variants.conf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,8 +2,9 @@
 # customize this file to list variant settings you want.
 #
 # Be sure to uncomment/define the variants_conf setting
-# in your ports.conf or ~/.portsrc file to point to this
-# file to enable this feature.
+# in the system wide ${prefix}/etc/macports/macports.conf
+# file or in your personal ~/.macports/macports.conf to
+# point to this file to enable this feature.
 #
 # Any variants specified here that are not supported by
 # a port will just be ignored. Multiple variants can be

Deleted: trunk/base/foundation.m4
===================================================================
--- trunk/base/foundation.m4	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/foundation.m4	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,408 +0,0 @@
-#------------------------------------------------------------------------
-# MP_COMPILER_ATTRIBUTE_LF_PRIVATE
-#
-#	Determines whether the compiler supports the symbol
-#	'visibility("hidden")' attribute
-#
-# Arguments:
-#	None.
-#
-# Requires:
-#	none
-#
-# Depends:
-#	none
-#
-# Results:
-#
-#	Defines the following macros:
-#		LF_PRIVATE
-#
-#------------------------------------------------------------------------
-
-AC_DEFUN([MP_COMPILER_ATTRIBUTE_LF_PRIVATE], [
-	AC_MSG_CHECKING([for gcc symbol visibility attribute])
-	AC_CACHE_VAL(mp_cv_attribute_mp_private, [
-		AC_COMPILE_IFELSE([
-			AC_LANG_SOURCE([
-				#if defined(__GNUC__) && defined(__APPLE__) && __GNUC__ < 4
-				# error Darwin does not support the visibility attribute with gcc releases prior to 4
-				#elif defined(WIN32) && __GNUC__ < 4
-				# error MinGW/Cygwin do not support the visibility attribute with gcc releases prior to 4.
-				#endif
-				int a __attribute__ ((visibility("hidden")));
-			])
-		],[
-			mp_cv_attribute_mp_private="__attribute__((visibility(\"hidden\")))"
-		],[
-			mp_cv_attribute_mp_private="no"
-		])
-	])
-
-	AC_MSG_RESULT([$mp_cv_attribute_mp_private])
-	
-	if test x"$mp_cv_attribute_mp_private" = "xno"; then
-		MP_PRIVATE=""
-	else
-		MP_PRIVATE="$mp_cv_attribute_mp_private"
-	fi
-
-	AC_DEFINE_UNQUOTED(MP_PRIVATE, $MP_PRIVATE, [Mark private symbols])
-])
-
-
-#------------------------------------------------------------------------
-# MP_OBJC_RUNTIME --
-#
-#	Determine the default, working Objective C runtime
-#
-# Arguments:
-#	None.
-#
-# Requires:
-#	none
-#
-# Depends:
-#	AC_PROG_OBJC from objc.m4
-#
-# Results:
-#
-#	Adds a --with-objc-runtime switch to configure.
-#	Result is cached.
-#
-#	Defines one of the following preprocessor macros:
-#		APPLE_RUNTIME GNU_RUNTIME
-#
-#	Substitutes the following variables:
-#		OBJC_RUNTIME OBJC_RUNTIME_FLAGS OBJC_LIBS
-#		OBJC_PTHREAD_CFLAGS OBJC_PTHREAD_LIBS
-#------------------------------------------------------------------------
-AC_DEFUN([MP_OBJC_RUNTIME],[
-	AC_REQUIRE([AC_PROG_OBJC])
-	AC_ARG_WITH(objc-runtime, AC_HELP_STRING([--with-objc-runtime], [Specify either "GNU" or "apple"]), [with_objc_runtime=${withval}])
-
-	if test x"${with_objc_runtime}" != x; then
-		case "${with_objc_runtime}" in
-			GNU)
-				;;
-			apple)
-				;;
-			*)
-				AC_MSG_ERROR([${with_objc_runtime} is not a valid argument to --with-objc-runtime. Please specify either "GNU" or "apple"])
-				;;
-		esac
-	fi
-
-	AC_LANG_PUSH([Objective C])
-
-	# Check for common header, objc/objc.h
-	AC_CHECK_HEADERS([objc/objc.h], ,[AC_MSG_ERROR([Can't locate Objective C runtime headers])])
-
-	# Save LIBS & OBJCFLAGS 
-	# depending on whether the cache is used,
-	# the variables may or may not be modified.
-	OLD_LIBS="${LIBS}"
-	OLD_OBJCFLAGS="${OBJCFLAGS}"
-
-	# Add -lobjc. The following tests will ensure that the library exists and functions with the detected Objective C compiler
-	LIBS="${LIBS} -lobjc"
-
-	# Test if pthreads are required to link against
-	# libobjc - this is the case on FreeBSD.
-
-	AC_MSG_CHECKING([if linking libobjc requires pthreads])
-	AC_CACHE_VAL(od_cv_objc_req_pthread, [
-		# First, test if objc links without pthreads
-		# The following uses quadrigraphs
-		# '@<:@' = '['
-		# '@:>@' = ']'
-		AC_LINK_IFELSE([
-				AC_LANG_PROGRAM([
-						#include <objc/objc.h>
-						#include <objc/Object.h>
-					], [
-						Object *obj = @<:@Object alloc@:>@;
-						puts(@<:@obj name@:>@);
-					])
-				], [
-					# Linked without -pthread
-					od_cv_objc_req_pthread="no"
-				], [
-					# Failed to link without -pthread
-					od_cv_objc_req_pthread="yes"
-				]
-		)
-
-		# If the above failed, try with pthreads
-		if test x"${od_cv_objc_req_pthread}" = x"yes"; then
-			LIBS="${LIBS} ${PTHREAD_LIBS}"
-			OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
-			AC_LINK_IFELSE([
-					AC_LANG_PROGRAM([
-							#include <objc/objc.h>
-							#include <objc/Object.h>
-						], [
-							Object *obj = @<:@Object alloc@:>@;
-							puts(@<:@obj name@:>@);
-						])
-					], [
-						# Linked with -lpthread 
-						od_cv_objc_req_pthread="yes"
-					], [
-						# Failed to link against objc at all
-						# This will be caught in the runtime
-						# checks below
-						od_cv_objc_req_pthread="no"
-					]
-			)
-		fi
-	])
-	AC_MSG_RESULT(${od_cv_objc_req_pthread})
-
-	if test x"${od_cv_objc_req_pthread}" = x"no"; then
-		OBJC_LIBS="-lobjc"
-		OBJC_PTHREAD_LIBS="${PTHREAD_LIBS}"
-		OBJC_PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
-	elif test x"${od_cv_objc_req_pthread}" = x"yes"; then
-		OBJC_LIBS="-lobjc ${PTHREAD_LIBS}"
-		OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
-	fi
-
-	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"apple"; then
-		AC_MSG_CHECKING([for Apple Objective-C runtime])
-		AC_CACHE_VAL(od_cv_objc_runtime_apple, [
-			# The following uses quadrigraphs
-			# '@<:@' = '['
-			# '@:>@' = ']'
-			AC_LINK_IFELSE([
-					AC_LANG_PROGRAM([
-							#include <objc/objc.h>
-							#include <objc/objc-api.h>
-						], [
-							id class = objc_lookUpClass("Object");
-							id obj = @<:@class alloc@:>@;
-							puts(@<:@obj name@:>@);
-						])
-					], [
-						od_cv_objc_runtime_apple="yes"
-					], [
-						od_cv_objc_runtime_apple="no"
-					]
-			)
-		])
-		AC_MSG_RESULT(${od_cv_objc_runtime_apple})
-	else
-		od_cv_objc_runtime_apple="no"
-	fi
-
-	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"GNU"; then
-		AC_MSG_CHECKING([for GNU Objective C runtime])
-		AC_CACHE_VAL(od_cv_objc_runtime_gnu, [
-			# The following uses quadrigraphs
-			# '@<:@' = '['
-			# '@:>@' = ']'
-			AC_LINK_IFELSE([
-					AC_LANG_PROGRAM([
-							#include <objc/objc.h>
-							#include <objc/objc-api.h>
-						], [
-							id class = objc_lookup_class("Object");
-							id obj = @<:@class alloc@:>@;
-							puts(@<:@obj name@:>@);
-						])
-					], [
-						od_cv_objc_runtime_gnu="yes"
-					], [
-						od_cv_objc_runtime_gnu="no"
-					]
-			)
-		])
-		AC_MSG_RESULT(${od_cv_objc_runtime_gnu})
-	else
-		od_cv_objc_runtime_gnu="no"
-	fi
-
-	# Apple runtime is prefered
-	if test x"${od_cv_objc_runtime_apple}" = x"yes"; then
-			OBJC_RUNTIME="APPLE_RUNTIME"
-			OBJC_RUNTIME_FLAGS="-fnext-runtime"
-			AC_MSG_NOTICE([Using Apple Objective-C runtime])
-			AC_DEFINE([APPLE_RUNTIME], 1, [Define if using the Apple Objective-C runtime and compiler.]) 
-	elif test x"${od_cv_objc_runtime_gnu}" = x"yes"; then
-			OBJC_RUNTIME="GNU_RUNTIME"
-			OBJC_RUNTIME_FLAGS="-fgnu-runtime"
-			AC_MSG_NOTICE([Using GNU Objective-C runtime])
-			AC_DEFINE([GNU_RUNTIME], 1, [Define if using the GNU Objective-C runtime and compiler.]) 
-	else
-			AC_MSG_FAILURE([Could not locate a working Objective-C runtime.])
-	fi
-
-	# Restore LIBS & OBJCFLAGS
-	LIBS="${OLD_LIBS}"
-	OBJCFLAGS="${OLD_OBJCFLAGS}"
-
-	AC_SUBST([OBJC_RUNTIME])
-	AC_SUBST([OBJC_RUNTIME_FLAGS])
-	AC_SUBST([OBJC_LIBS])
-
-	AC_SUBST([OBJC_PTHREAD_LIBS])
-	AC_SUBST([OBJC_PTHREAD_CFLAGS])
-
-	AC_LANG_POP([Objective C])
-])
-
-#------------------------------------------------------------------------
-# MP_OBJC_FOUNDATION --
-#
-#	Find a functional Foundation implementation.
-#	The NeXT Foundation implementation is prefered,
-#	as it is most likely to be the system provided
-#	Foundation.
-#
-# Arguments:
-#	None.
-#
-# Requires:
-#	OBJC_RUNTIME
-#
-# Depends:
-#	AC_PROG_OBJC from objc.m4
-#
-# Results:
-#
-#	Adds a --with-objc-foundation switch to configure.
-#	Result is cached.
-#
-#	Defines one of the following preprocessor macros:
-#		APPLE_FOUNDATION GNUSTEP_FOUNDATION
-#------------------------------------------------------------------------
-AC_DEFUN([MP_OBJC_FOUNDATION],[
-	AC_REQUIRE([AC_PROG_OBJC])
-	AC_ARG_WITH(objc-foundation, [  --with-objc-foundation  Specify either "GNUstep" or "apple"], [with_objc_foundation=${withval}])
-
-	if test x"${with_objc_foundation}" != x; then
-		case "${with_objc_foundation}" in
-			GNUstep)
-				;;
-			GNU)
-				with_objc_foundation="GNUstep"
-				;;
-			apple)
-				;;
-			*)
-				AC_MSG_ERROR([${with_objc_foundation} is not a valid argument to --with-objc-foundation. Please specify either "GNU" or "apple"])
-				;;
-		esac
-	fi
-
-	AC_LANG_PUSH([Objective C])
-
-	if test x"${with_objc_foundation}" == x || test x"${with_objc_foundation}" == x"apple"; then
-		# '@<:@' = '['
-		# '@:>@' = ']'
-		AC_MSG_CHECKING([for Apple Foundation library])
-
-		# Set NeXT LIBS and CFLAGS
-		APPLE_FOUNDATION_CFLAGS="-framework Foundation"
-		APPLE_FOUNDATION_LIBS="-framework Foundation"
-
-		AC_CACHE_VAL(ac_cv_objc_foundation_apple, [
-			# Save old LIBS and CFLAGS
-			LIBS_OLD="${LIBS}"
-			CFLAGS_OLD="${CFLAGS}"
-
-			CFLAGS="${APPLE_FOUNDATION_CFLAGS} ${CFLAGS}"
-			LIBS="${APPLE_FOUNDATION_LIBS} ${LIBS}"
-
-			AC_LINK_IFELSE([
-					AC_LANG_PROGRAM([
-								#include <Foundation/Foundation.h>
-							], [
-								NSString *string = @<:@@<:@NSString alloc@:>@ initWithCString: "Hello World"@:>@;
-								@<:@NSString length@:>@;
-							])
-					],[
-						ac_cv_objc_foundation_apple="yes"
-					],[
-						ac_cv_objc_foundation_apple="no"
-					]
-			)
-			# Restore LIBS and CFLAGS
-			LIBS="${LIBS_OLD}"
-			CFLAGS="${CFLAGS_OLD}"
-		])
-		AC_MSG_RESULT(${ac_cv_objc_foundation_apple})
-	else
-		ac_cv_objc_foundation_apple="no"
-	fi
-
-	if test x"${with_objc_foundation}" == x || test x${with_objc_foundation} == x"GNUstep"; then
-		if test x"${GNUSTEP_SYSTEM_ROOT}" == x; then
-			if test x"${with_objc_foundation}" == x"GNUstep"; then
-				AC_MSG_ERROR([GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library])
-			else
-				AC_MSG_WARN([GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library])
-			fi
-		else
-
-			AC_MSG_CHECKING([for GNUstep Foundation library])
-
-			# Set GNUstep LDFLAGS, CPPFLAGS, and LIBS
-			GNUSTEP_LDFLAGS="-L${GNUSTEP_SYSTEM_ROOT}/Library/Libraries/"
-			GNUSTEP_CPPFLAGS="-I${GNUSTEP_SYSTEM_ROOT}/Library/Headers/"
-			GNUSTEP_LIBS="-lgnustep-base"
-
-			AC_CACHE_VAL(ac_cv_objc_foundation_gnustep, [
-				# Save old LDFLAGS, CPPFLAGS, and LIBS
-				LDFLAGS_OLD="${LDFLAGS}"
-				CPPFLAGS_OLD="${CPPFLAGS}"
-				LIBS_OLD="${LIBS}"
-
-				LDFLAGS="${GNUSTEP_LDFLAGS} ${LDFLAGS}"
-				CPPFLAGS="${GNUSTEP_CPPFLAGS} ${CPPFLAGS}"
-				LIBS="${GNUSTEP_LIBS} ${LIBS}"
-
-				AC_LINK_IFELSE([
-						AC_LANG_PROGRAM([
-									#include <Foundation/Foundation.h>
-								], [
-									NSString *string = @<:@@<:@NSString alloc@:>@ initWithCString: "Hello World"@:>@;
-									@<:@NSString length@:>@;
-								])
-						],[
-							ac_cv_objc_foundation_gnustep="yes"
-						],[
-							ac_cv_objc_foundation_gnustep="no"
-						]
-				)
-				# Restore LDFLAGS, CPPFLAGS, and LIBS
-				LDFLAGS="${LDFLAGS_OLD}"
-				CPPFLAGS="${CPPFLAGS_OLD}"
-				LIBS="${LIBS_OLD}"
-			])
-			AC_MSG_RESULT(${ac_cv_objc_foundation_gnustep})
-		fi
-	else
-		ac_cv_objc_foundation_gnustep="no"
-	fi
-
-	# NeXT Foundation is prefered
-	if test x"${ac_cv_objc_foundation_apple}" == x"yes"; then
-		OBJC_FOUNDATION="Apple"
-		CPPFLAGS="${APPLE_FOUNDATION_CPPFLAGS} ${CPPFLAGS}"
-		LIBS="${APPLE_FOUNDATION_LIBS} ${LIBS}"
-		AC_DEFINE([APPLE_FOUNDATION], 1, [Define if using the Apple Foundation framework]) 
-		AC_MSG_NOTICE([Using Apple Foundation library])
-	elif test x"${ac_cv_objc_foundation_gnustep}" == x"yes"; then
-		OBJC_FOUNDATION="GNUstep"
-		CPPFLAGS="${GNUSTEP_CPPFLAGS} ${CPPFLAGS}"
-		LIBS="${GNUSTEP_LIBS} ${LIBS}"
-		LDFLAGS="${GNUSTEP_LDFLAGS} ${LDFLAGS}"
-		AC_DEFINE([GNUSTEP_FOUNDATION], 1, [Define if using the GNUstep Foundation library]) 
-		AC_MSG_NOTICE([Using GNUstep Foundation library])
-	else
-		AC_MSG_ERROR([Could not find a working Foundation implementation])
-	fi
-
-	AC_LANG_POP([Objective C])
-])

Copied: trunk/base/foundation.m4 (from rev 26176, branches/dp2mp-move/base/foundation.m4)
===================================================================
--- trunk/base/foundation.m4	                        (rev 0)
+++ trunk/base/foundation.m4	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,408 @@
+#------------------------------------------------------------------------
+# MP_COMPILER_ATTRIBUTE_LF_PRIVATE
+#
+#	Determines whether the compiler supports the symbol
+#	'visibility("hidden")' attribute
+#
+# Arguments:
+#	None.
+#
+# Requires:
+#	none
+#
+# Depends:
+#	none
+#
+# Results:
+#
+#	Defines the following macros:
+#		LF_PRIVATE
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([MP_COMPILER_ATTRIBUTE_LF_PRIVATE], [
+	AC_MSG_CHECKING([for gcc symbol visibility attribute])
+	AC_CACHE_VAL(mp_cv_attribute_mp_private, [
+		AC_COMPILE_IFELSE([
+			AC_LANG_SOURCE([
+				#if defined(__GNUC__) && defined(__APPLE__) && __GNUC__ < 4
+				# error Darwin does not support the visibility attribute with gcc releases prior to 4
+				#elif defined(WIN32) && __GNUC__ < 4
+				# error MinGW/Cygwin do not support the visibility attribute with gcc releases prior to 4.
+				#endif
+				int a __attribute__ ((visibility("hidden")));
+			])
+		],[
+			mp_cv_attribute_mp_private="__attribute__((visibility(\"hidden\")))"
+		],[
+			mp_cv_attribute_mp_private="no"
+		])
+	])
+
+	AC_MSG_RESULT([$mp_cv_attribute_mp_private])
+	
+	if test x"$mp_cv_attribute_mp_private" = "xno"; then
+		MP_PRIVATE=""
+	else
+		MP_PRIVATE="$mp_cv_attribute_mp_private"
+	fi
+
+	AC_DEFINE_UNQUOTED(MP_PRIVATE, $MP_PRIVATE, [Mark private symbols])
+])
+
+
+#------------------------------------------------------------------------
+# MP_OBJC_RUNTIME --
+#
+#	Determine the default, working Objective C runtime
+#
+# Arguments:
+#	None.
+#
+# Requires:
+#	none
+#
+# Depends:
+#	AC_PROG_OBJC from objc.m4
+#
+# Results:
+#
+#	Adds a --with-objc-runtime switch to configure.
+#	Result is cached.
+#
+#	Defines one of the following preprocessor macros:
+#		APPLE_RUNTIME GNU_RUNTIME
+#
+#	Substitutes the following variables:
+#		OBJC_RUNTIME OBJC_RUNTIME_FLAGS OBJC_LIBS
+#		OBJC_PTHREAD_CFLAGS OBJC_PTHREAD_LIBS
+#------------------------------------------------------------------------
+AC_DEFUN([MP_OBJC_RUNTIME],[
+	AC_REQUIRE([AC_PROG_OBJC])
+	AC_ARG_WITH(objc-runtime, AC_HELP_STRING([--with-objc-runtime], [Specify either "GNU" or "apple"]), [with_objc_runtime=${withval}])
+
+	if test x"${with_objc_runtime}" != x; then
+		case "${with_objc_runtime}" in
+			GNU)
+				;;
+			apple)
+				;;
+			*)
+				AC_MSG_ERROR([${with_objc_runtime} is not a valid argument to --with-objc-runtime. Please specify either "GNU" or "apple"])
+				;;
+		esac
+	fi
+
+	AC_LANG_PUSH([Objective C])
+
+	# Check for common header, objc/objc.h
+	AC_CHECK_HEADERS([objc/objc.h], ,[AC_MSG_ERROR([Can't locate Objective C runtime headers])])
+
+	# Save LIBS & OBJCFLAGS 
+	# depending on whether the cache is used,
+	# the variables may or may not be modified.
+	OLD_LIBS="${LIBS}"
+	OLD_OBJCFLAGS="${OBJCFLAGS}"
+
+	# Add -lobjc. The following tests will ensure that the library exists and functions with the detected Objective C compiler
+	LIBS="${LIBS} -lobjc"
+
+	# Test if pthreads are required to link against
+	# libobjc - this is the case on FreeBSD.
+
+	AC_MSG_CHECKING([if linking libobjc requires pthreads])
+	AC_CACHE_VAL(mp_cv_objc_req_pthread, [
+		# First, test if objc links without pthreads
+		# The following uses quadrigraphs
+		# '@<:@' = '['
+		# '@:>@' = ']'
+		AC_LINK_IFELSE([
+				AC_LANG_PROGRAM([
+						#include <objc/objc.h>
+						#include <objc/Object.h>
+					], [
+						Object *obj = @<:@Object alloc@:>@;
+						puts(@<:@obj name@:>@);
+					])
+				], [
+					# Linked without -pthread
+					mp_cv_objc_req_pthread="no"
+				], [
+					# Failed to link without -pthread
+					mp_cv_objc_req_pthread="yes"
+				]
+		)
+
+		# If the above failed, try with pthreads
+		if test x"${mp_cv_objc_req_pthread}" = x"yes"; then
+			LIBS="${LIBS} ${PTHREAD_LIBS}"
+			OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
+			AC_LINK_IFELSE([
+					AC_LANG_PROGRAM([
+							#include <objc/objc.h>
+							#include <objc/Object.h>
+						], [
+							Object *obj = @<:@Object alloc@:>@;
+							puts(@<:@obj name@:>@);
+						])
+					], [
+						# Linked with -lpthread 
+						mp_cv_objc_req_pthread="yes"
+					], [
+						# Failed to link against objc at all
+						# This will be caught in the runtime
+						# checks below
+						mp_cv_objc_req_pthread="no"
+					]
+			)
+		fi
+	])
+	AC_MSG_RESULT(${mp_cv_objc_req_pthread})
+
+	if test x"${mp_cv_objc_req_pthread}" = x"no"; then
+		OBJC_LIBS="-lobjc"
+		OBJC_PTHREAD_LIBS="${PTHREAD_LIBS}"
+		OBJC_PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
+	elif test x"${mp_cv_objc_req_pthread}" = x"yes"; then
+		OBJC_LIBS="-lobjc ${PTHREAD_LIBS}"
+		OBJCFLAGS="${OBJCFLAGS} ${PTHREAD_CFLAGS}"
+	fi
+
+	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"apple"; then
+		AC_MSG_CHECKING([for Apple Objective-C runtime])
+		AC_CACHE_VAL(mp_cv_objc_runtime_apple, [
+			# The following uses quadrigraphs
+			# '@<:@' = '['
+			# '@:>@' = ']'
+			AC_LINK_IFELSE([
+					AC_LANG_PROGRAM([
+							#include <objc/objc.h>
+							#include <objc/objc-api.h>
+						], [
+							id class = objc_lookUpClass("Object");
+							id obj = @<:@class alloc@:>@;
+							puts(@<:@obj name@:>@);
+						])
+					], [
+						mp_cv_objc_runtime_apple="yes"
+					], [
+						mp_cv_objc_runtime_apple="no"
+					]
+			)
+		])
+		AC_MSG_RESULT(${mp_cv_objc_runtime_apple})
+	else
+		mp_cv_objc_runtime_apple="no"
+	fi
+
+	if test x"${with_objc_runtime}" = x || test x"${with_objc_runtime}" = x"GNU"; then
+		AC_MSG_CHECKING([for GNU Objective C runtime])
+		AC_CACHE_VAL(mp_cv_objc_runtime_gnu, [
+			# The following uses quadrigraphs
+			# '@<:@' = '['
+			# '@:>@' = ']'
+			AC_LINK_IFELSE([
+					AC_LANG_PROGRAM([
+							#include <objc/objc.h>
+							#include <objc/objc-api.h>
+						], [
+							id class = objc_lookup_class("Object");
+							id obj = @<:@class alloc@:>@;
+							puts(@<:@obj name@:>@);
+						])
+					], [
+						mp_cv_objc_runtime_gnu="yes"
+					], [
+						mp_cv_objc_runtime_gnu="no"
+					]
+			)
+		])
+		AC_MSG_RESULT(${mp_cv_objc_runtime_gnu})
+	else
+		mp_cv_objc_runtime_gnu="no"
+	fi
+
+	# Apple runtime is prefered
+	if test x"${mp_cv_objc_runtime_apple}" = x"yes"; then
+			OBJC_RUNTIME="APPLE_RUNTIME"
+			OBJC_RUNTIME_FLAGS="-fnext-runtime"
+			AC_MSG_NOTICE([Using Apple Objective-C runtime])
+			AC_DEFINE([APPLE_RUNTIME], 1, [Define if using the Apple Objective-C runtime and compiler.]) 
+	elif test x"${mp_cv_objc_runtime_gnu}" = x"yes"; then
+			OBJC_RUNTIME="GNU_RUNTIME"
+			OBJC_RUNTIME_FLAGS="-fgnu-runtime"
+			AC_MSG_NOTICE([Using GNU Objective-C runtime])
+			AC_DEFINE([GNU_RUNTIME], 1, [Define if using the GNU Objective-C runtime and compiler.]) 
+	else
+			AC_MSG_FAILURE([Could not locate a working Objective-C runtime.])
+	fi
+
+	# Restore LIBS & OBJCFLAGS
+	LIBS="${OLD_LIBS}"
+	OBJCFLAGS="${OLD_OBJCFLAGS}"
+
+	AC_SUBST([OBJC_RUNTIME])
+	AC_SUBST([OBJC_RUNTIME_FLAGS])
+	AC_SUBST([OBJC_LIBS])
+
+	AC_SUBST([OBJC_PTHREAD_LIBS])
+	AC_SUBST([OBJC_PTHREAD_CFLAGS])
+
+	AC_LANG_POP([Objective C])
+])
+
+#------------------------------------------------------------------------
+# MP_OBJC_FOUNDATION --
+#
+#	Find a functional Foundation implementation.
+#	The NeXT Foundation implementation is prefered,
+#	as it is most likely to be the system provided
+#	Foundation.
+#
+# Arguments:
+#	None.
+#
+# Requires:
+#	OBJC_RUNTIME
+#
+# Depends:
+#	AC_PROG_OBJC from objc.m4
+#
+# Results:
+#
+#	Adds a --with-objc-foundation switch to configure.
+#	Result is cached.
+#
+#	Defines one of the following preprocessor macros:
+#		APPLE_FOUNDATION GNUSTEP_FOUNDATION
+#------------------------------------------------------------------------
+AC_DEFUN([MP_OBJC_FOUNDATION],[
+	AC_REQUIRE([AC_PROG_OBJC])
+	AC_ARG_WITH(objc-foundation, [  --with-objc-foundation  Specify either "GNUstep" or "apple"], [with_objc_foundation=${withval}])
+
+	if test x"${with_objc_foundation}" != x; then
+		case "${with_objc_foundation}" in
+			GNUstep)
+				;;
+			GNU)
+				with_objc_foundation="GNUstep"
+				;;
+			apple)
+				;;
+			*)
+				AC_MSG_ERROR([${with_objc_foundation} is not a valid argument to --with-objc-foundation. Please specify either "GNU" or "apple"])
+				;;
+		esac
+	fi
+
+	AC_LANG_PUSH([Objective C])
+
+	if test x"${with_objc_foundation}" == x || test x"${with_objc_foundation}" == x"apple"; then
+		# '@<:@' = '['
+		# '@:>@' = ']'
+		AC_MSG_CHECKING([for Apple Foundation library])
+
+		# Set NeXT LIBS and CFLAGS
+		APPLE_FOUNDATION_CFLAGS="-framework Foundation"
+		APPLE_FOUNDATION_LIBS="-framework Foundation"
+
+		AC_CACHE_VAL(ac_cv_objc_foundation_apple, [
+			# Save old LIBS and CFLAGS
+			LIBS_OLD="${LIBS}"
+			CFLAGS_OLD="${CFLAGS}"
+
+			CFLAGS="${APPLE_FOUNDATION_CFLAGS} ${CFLAGS}"
+			LIBS="${APPLE_FOUNDATION_LIBS} ${LIBS}"
+
+			AC_LINK_IFELSE([
+					AC_LANG_PROGRAM([
+								#include <Foundation/Foundation.h>
+							], [
+								NSString *string = @<:@@<:@NSString alloc@:>@ initWithCString: "Hello World"@:>@;
+								@<:@NSString length@:>@;
+							])
+					],[
+						ac_cv_objc_foundation_apple="yes"
+					],[
+						ac_cv_objc_foundation_apple="no"
+					]
+			)
+			# Restore LIBS and CFLAGS
+			LIBS="${LIBS_OLD}"
+			CFLAGS="${CFLAGS_OLD}"
+		])
+		AC_MSG_RESULT(${ac_cv_objc_foundation_apple})
+	else
+		ac_cv_objc_foundation_apple="no"
+	fi
+
+	if test x"${with_objc_foundation}" == x || test x${with_objc_foundation} == x"GNUstep"; then
+		if test x"${GNUSTEP_SYSTEM_ROOT}" == x; then
+			if test x"${with_objc_foundation}" == x"GNUstep"; then
+				AC_MSG_ERROR([GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library])
+			else
+				AC_MSG_WARN([GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library])
+			fi
+		else
+
+			AC_MSG_CHECKING([for GNUstep Foundation library])
+
+			# Set GNUstep LDFLAGS, CPPFLAGS, and LIBS
+			GNUSTEP_LDFLAGS="-L${GNUSTEP_SYSTEM_ROOT}/Library/Libraries/"
+			GNUSTEP_CPPFLAGS="-I${GNUSTEP_SYSTEM_ROOT}/Library/Headers/"
+			GNUSTEP_LIBS="-lgnustep-base"
+
+			AC_CACHE_VAL(ac_cv_objc_foundation_gnustep, [
+				# Save old LDFLAGS, CPPFLAGS, and LIBS
+				LDFLAGS_OLD="${LDFLAGS}"
+				CPPFLAGS_OLD="${CPPFLAGS}"
+				LIBS_OLD="${LIBS}"
+
+				LDFLAGS="${GNUSTEP_LDFLAGS} ${LDFLAGS}"
+				CPPFLAGS="${GNUSTEP_CPPFLAGS} ${CPPFLAGS}"
+				LIBS="${GNUSTEP_LIBS} ${LIBS}"
+
+				AC_LINK_IFELSE([
+						AC_LANG_PROGRAM([
+									#include <Foundation/Foundation.h>
+								], [
+									NSString *string = @<:@@<:@NSString alloc@:>@ initWithCString: "Hello World"@:>@;
+									@<:@NSString length@:>@;
+								])
+						],[
+							ac_cv_objc_foundation_gnustep="yes"
+						],[
+							ac_cv_objc_foundation_gnustep="no"
+						]
+				)
+				# Restore LDFLAGS, CPPFLAGS, and LIBS
+				LDFLAGS="${LDFLAGS_OLD}"
+				CPPFLAGS="${CPPFLAGS_OLD}"
+				LIBS="${LIBS_OLD}"
+			])
+			AC_MSG_RESULT(${ac_cv_objc_foundation_gnustep})
+		fi
+	else
+		ac_cv_objc_foundation_gnustep="no"
+	fi
+
+	# NeXT Foundation is prefered
+	if test x"${ac_cv_objc_foundation_apple}" == x"yes"; then
+		OBJC_FOUNDATION="Apple"
+		CPPFLAGS="${APPLE_FOUNDATION_CPPFLAGS} ${CPPFLAGS}"
+		LIBS="${APPLE_FOUNDATION_LIBS} ${LIBS}"
+		AC_DEFINE([APPLE_FOUNDATION], 1, [Define if using the Apple Foundation framework]) 
+		AC_MSG_NOTICE([Using Apple Foundation library])
+	elif test x"${ac_cv_objc_foundation_gnustep}" == x"yes"; then
+		OBJC_FOUNDATION="GNUstep"
+		CPPFLAGS="${GNUSTEP_CPPFLAGS} ${CPPFLAGS}"
+		LIBS="${GNUSTEP_LIBS} ${LIBS}"
+		LDFLAGS="${GNUSTEP_LDFLAGS} ${LDFLAGS}"
+		AC_DEFINE([GNUSTEP_FOUNDATION], 1, [Define if using the GNUstep Foundation library]) 
+		AC_MSG_NOTICE([Using GNUstep Foundation library])
+	else
+		AC_MSG_ERROR([Could not find a working Foundation implementation])
+	fi
+
+	AC_LANG_POP([Objective C])
+])

Deleted: trunk/base/objc.m4
===================================================================
--- trunk/base/objc.m4	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/objc.m4	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,623 +0,0 @@
-# objc.m4
-# Based on c.m4 from GNU Autoconf
-# The Objective C support, added by Landon Fuller <landonf at opendarwin.org>
-# on March 10th, 2004, is heavily based on Autoconf's existing C++ support.
-#
-########### Copyright and Licensing terms ##########
-#
-# This file is part of Autoconf.                       -*- Autoconf -*-
-# Programming languages support.
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-#
-# 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, 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.
-#
-# As a special exception, the Free Software Foundation gives unlimited
-# permission to copy, distribute and modify the configure scripts that
-# are the output of Autoconf.  You need not follow the terms of the GNU
-# General Public License when using or distributing such scripts, even
-# though portions of the text of Autoconf appear in them.  The GNU
-# General Public License (GPL) does govern all other use of the material
-# that constitutes the Autoconf program.
-#
-# Certain portions of the Autoconf source text are designed to be copied
-# (in certain cases, depending on the input) into the output of
-# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
-# source text consists of comments plus executable code that decides which
-# of the data portions to output in any given case.  We call these
-# comments and executable code the "non-data" portions.  Autoconf never
-# copies any of the non-data portions into its output.
-#
-# This special exception to the GPL applies to versions of Autoconf
-# released by the Free Software Foundation.  When you make and
-# distribute a modified version of Autoconf, you may extend this special
-# exception to the GPL to apply to your modified version as well, *unless*
-# your modified version has the potential to copy into its output some
-# of the text that was the non-data portion of the version that you started
-# with.  (In other words, unless your change moves or copies text from
-# the non-data portions to the data portions.)  If your modification has
-# such potential, you must delete any notice of this special exception
-# to the GPL from your modified version.
-#
-# Written by David MacKenzie, with help from
-# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-# Roland McGrath, Noah Friedman, david d zuhn, and many others.
-#
-########## GNU General Public License (GPL), version 2  ##########
-#
-#		    GNU GENERAL PUBLIC LICENSE
-#		       Version 2, June 1991
-#
-#  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-#      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#  Everyone is permitted to copy and distribute verbatim copies
-#  of this license document, but changing it is not allowed.
-#
-# 			    Preamble
-# 
-#  The licenses for most software are designed to take away your
-# freedom to share and change it.  By contrast, the GNU General Public
-# License is intended to guarantee your freedom to share and change free
-# software--to make sure the software is free for all its users.  This
-# General Public License applies to most of the Free Software
-# Foundation's software and to any other program whose authors commit to
-# using it.  (Some other Free Software Foundation software is covered by
-# the GNU Library General Public License instead.)  You can apply it to
-# your programs, too.
-#
-#  When we speak of free software, we are referring to freedom, not
-# price.  Our General Public Licenses are designed to make sure that you
-# have the freedom to distribute copies of free software (and charge for
-# this service if you wish), that you receive source code or can get it
-# if you want it, that you can change the software or use pieces of it
-# in new free programs; and that you know you can do these things.
-#
-#  To protect your rights, we need to make restrictions that forbid
-# anyone to deny you these rights or to ask you to surrender the rights.
-# These restrictions translate to certain responsibilities for you if you
-# distribute copies of the software, or if you modify it.
-#
-#  For example, if you distribute copies of such a program, whether
-# gratis or for a fee, you must give the recipients all the rights that
-# you have.  You must make sure that they, too, receive or can get the
-# source code.  And you must show them these terms so they know their
-# rights.
-#
-#  We protect your rights with two steps: (1) copyright the software, and
-# (2) offer you this license which gives you legal permission to copy,
-# distribute and/or modify the software.
-#
-#  Also, for each author's protection and ours, we want to make certain
-# that everyone understands that there is no warranty for this free
-# software.  If the software is modified by someone else and passed on, we
-# want its recipients to know that what they have is not the original, so
-# that any problems introduced by others will not reflect on the original
-# authors' reputations.
-#
-#  Finally, any free program is threatened constantly by software
-# patents.  We wish to avoid the danger that redistributors of a free
-# program will individually obtain patent licenses, in effect making the
-# program proprietary.  To prevent this, we have made it clear that any
-# patent must be licensed for everyone's free use or not licensed at all.
-#
-#  The precise terms and conditions for copying, distribution and
-# modification follow.
-#
-#		    GNU GENERAL PUBLIC LICENSE
-#  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-#
-#  0. This License applies to any program or other work which contains
-# a notice placed by the copyright holder saying it may be distributed
-# under the terms of this General Public License.  The "Program", below,
-# refers to any such program or work, and a "work based on the Program"
-# means either the Program or any derivative work under copyright law:
-# that is to say, a work containing the Program or a portion of it,
-# either verbatim or with modifications and/or translated into another
-# language.  (Hereinafter, translation is included without limitation in
-# the term "modification".)  Each licensee is addressed as "you".
-#
-# Activities other than copying, distribution and modification are not
-# covered by this License; they are outside its scope.  The act of
-# running the Program is not restricted, and the output from the Program
-# is covered only if its contents constitute a work based on the
-# Program (independent of having been made by running the Program).
-# Whether that is true depends on what the Program does.
-#
-#  1. You may copy and distribute verbatim copies of the Program's
-# source code as you receive it, in any medium, provided that you
-# conspicuously and appropriately publish on each copy an appropriate
-# copyright notice and disclaimer of warranty; keep intact all the
-# notices that refer to this License and to the absence of any warranty;
-# and give any other recipients of the Program a copy of this License
-# along with the Program.
-#
-# You may charge a fee for the physical act of transferring a copy, and
-# you may at your option offer warranty protection in exchange for a fee.
-#
-#  2. You may modify your copy or copies of the Program or any portion
-# of it, thus forming a work based on the Program, and copy and
-# distribute such modifications or work under the terms of Section 1
-# above, provided that you also meet all of these conditions:
-#
-#    a) You must cause the modified files to carry prominent notices
-#    stating that you changed the files and the date of any change.
-#
-#    b) You must cause any work that you distribute or publish, that in
-#    whole or in part contains or is derived from the Program or any
-#    part thereof, to be licensed as a whole at no charge to all third
-#    parties under the terms of this License.
-#
-#    c) If the modified program normally reads commands interactively
-#    when run, you must cause it, when started running for such
-#    interactive use in the most ordinary way, to print or display an
-#    announcement including an appropriate copyright notice and a
-#    notice that there is no warranty (or else, saying that you provide
-#    a warranty) and that users may redistribute the program under
-#    these conditions, and telling the user how to view a copy of this
-#    License.  (Exception: if the Program itself is interactive but
-#    does not normally print such an announcement, your work based on
-#    the Program is not required to print an announcement.)
-#
-# These requirements apply to the modified work as a whole.  If
-# identifiable sections of that work are not derived from the Program,
-# and can be reasonably considered independent and separate works in
-# themselves, then this License, and its terms, do not apply to those
-# sections when you distribute them as separate works.  But when you
-# distribute the same sections as part of a whole which is a work based
-# on the Program, the distribution of the whole must be on the terms of
-# this License, whose permissions for other licensees extend to the
-# entire whole, and thus to each and every part regardless of who wrote it.
-#
-# Thus, it is not the intent of this section to claim rights or contest
-# your rights to work written entirely by you; rather, the intent is to
-# exercise the right to control the distribution of derivative or
-# collective works based on the Program.
-#
-# In addition, mere aggregation of another work not based on the Program
-# with the Program (or with a work based on the Program) on a volume of
-# a storage or distribution medium does not bring the other work under
-# the scope of this License.
-#
-#  3. You may copy and distribute the Program (or a work based on it,
-# under Section 2) in object code or executable form under the terms of
-# Sections 1 and 2 above provided that you also do one of the following:
-#
-#    a) Accompany it with the complete corresponding machine-readable
-#    source code, which must be distributed under the terms of Sections
-#    1 and 2 above on a medium customarily used for software interchange; or,
-#
-#    b) Accompany it with a written offer, valid for at least three
-#    years, to give any third party, for a charge no more than your
-#    cost of physically performing source distribution, a complete
-#    machine-readable copy of the corresponding source code, to be
-#    distributed under the terms of Sections 1 and 2 above on a medium
-#    customarily used for software interchange; or,
-#
-#    c) Accompany it with the information you received as to the offer
-#    to distribute corresponding source code.  (This alternative is
-#    allowed only for noncommercial distribution and only if you
-#    received the program in object code or executable form with such
-#    an offer, in accord with Subsection b above.)
-#
-# The source code for a work means the preferred form of the work for
-# making modifications to it.  For an executable work, complete source
-# code means all the source code for all modules it contains, plus any
-# associated interface definition files, plus the scripts used to
-# control compilation and installation of the executable.  However, as a
-# special exception, the source code distributed need not include
-# anything that is normally distributed (in either source or binary
-# form) with the major components (compiler, kernel, and so on) of the
-# operating system on which the executable runs, unless that component
-# itself accompanies the executable.
-#
-# If distribution of executable or object code is made by offering
-# access to copy from a designated place, then offering equivalent
-# access to copy the source code from the same place counts as
-# distribution of the source code, even though third parties are not
-# compelled to copy the source along with the object code.
-#
-#  4. You may not copy, modify, sublicense, or distribute the Program
-# except as expressly provided under this License.  Any attempt
-# otherwise to copy, modify, sublicense or distribute the Program is
-# void, and will automatically terminate your rights under this License.
-# However, parties who have received copies, or rights, from you under
-# this License will not have their licenses terminated so long as such
-# parties remain in full compliance.
-#
-#  5. You are not required to accept this License, since you have not
-# signed it.  However, nothing else grants you permission to modify or
-# distribute the Program or its derivative works.  These actions are
-# prohibited by law if you do not accept this License.  Therefore, by
-# modifying or distributing the Program (or any work based on the
-# Program), you indicate your acceptance of this License to do so, and
-# all its terms and conditions for copying, distributing or modifying
-# the Program or works based on it.
-
-#  6. Each time you redistribute the Program (or any work based on the
-# Program), the recipient automatically receives a license from the
-# original licensor to copy, distribute or modify the Program subject to
-# these terms and conditions.  You may not impose any further
-# restrictions on the recipients' exercise of the rights granted herein.
-# You are not responsible for enforcing compliance by third parties to
-# this License.
-#
-#  7. If, as a consequence of a court judgment or allegation of patent
-# infringement or for any other reason (not limited to patent issues),
-# conditions are imposed on you (whether by court order, agreement or
-# otherwise) that contradict the conditions of this License, they do not
-# excuse you from the conditions of this License.  If you cannot
-# distribute so as to satisfy simultaneously your obligations under this
-# License and any other pertinent obligations, then as a consequence you
-# may not distribute the Program at all.  For example, if a patent
-# license would not permit royalty-free redistribution of the Program by
-# all those who receive copies directly or indirectly through you, then
-# the only way you could satisfy both it and this License would be to
-# refrain entirely from distribution of the Program.
-#
-# If any portion of this section is held invalid or unenforceable under
-# any particular circumstance, the balance of the section is intended to
-# apply and the section as a whole is intended to apply in other
-# circumstances.
-#
-# It is not the purpose of this section to induce you to infringe any
-# patents or other property right claims or to contest validity of any
-# such claims; this section has the sole purpose of protecting the
-# integrity of the free software distribution system, which is
-# implemented by public license practices.  Many people have made
-# generous contributions to the wide range of software distributed
-# through that system in reliance on consistent application of that
-# system; it is up to the author/donor to decide if he or she is willing
-# to distribute software through any other system and a licensee cannot
-# impose that choice.
-#
-# This section is intended to make thoroughly clear what is believed to
-# be a consequence of the rest of this License.
-#
-#  8. If the distribution and/or use of the Program is restricted in
-# certain countries either by patents or by copyrighted interfaces, the
-# original copyright holder who places the Program under this License
-# may add an explicit geographical distribution limitation excluding
-# those countries, so that distribution is permitted only in or among
-# countries not thus excluded.  In such case, this License incorporates
-# the limitation as if written in the body of this License.
-#
-#  9. The Free Software Foundation may publish revised and/or new versions
-# of the General Public License from time to time.  Such new versions will
-# be similar in spirit to the present version, but may differ in detail to
-# address new problems or concerns.
-#
-# Each version is given a distinguishing version number.  If the Program
-# specifies a version number of this License which applies to it and "any
-# later version", you have the option of following the terms and conditions
-# either of that version or of any later version published by the Free
-# Software Foundation.  If the Program does not specify a version number of
-# this License, you may choose any version ever published by the Free Software
-# Foundation.
-#
-#  10. If you wish to incorporate parts of the Program into other free
-# programs whose distribution conditions are different, write to the author
-# to ask for permission.  For software which is copyrighted by the Free
-# Software Foundation, write to the Free Software Foundation; we sometimes
-# make exceptions for this.  Our decision will be guided by the two goals
-# of preserving the free status of all derivatives of our free software and
-# of promoting the sharing and reuse of software generally.
-#
-#			    NO WARRANTY
-#
-#  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-# FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-# OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-# PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-# OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-# TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-# PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-# REPAIR OR CORRECTION.
-#
-#  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-# WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-# REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-# INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-# OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-# TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-# YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-# PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGES.
-#
-#		     END OF TERMS AND CONDITIONS
-#
-#	    How to Apply These Terms to Your New Programs
-#
-#  If you develop a new program, and you want it to be of the greatest
-# possible use to the public, the best way to achieve this is to make it
-# free software which everyone can redistribute and change under these terms.
-#
-#  To do so, attach the following notices to the program.  It is safest
-# to attach them to the start of each source file to most effectively
-# convey the exclusion of warranty; and each file should have at least
-# the "copyright" line and a pointer to where the full notice is found.
-#
-#    <one line to give the program's name and a brief idea of what it does.>
-#    Copyright (C) <year>  <name of author>
-#
-#    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
-#
-#
-# Also add information on how to contact you by electronic and paper mail.
-#
-# If the program is interactive, make it output a short notice like this
-# when it starts in an interactive mode:
-#
-#    Gnomovision version 69, Copyright (C) year  name of author
-#    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-#    This is free software, and you are welcome to redistribute it
-#    under certain conditions; type `show c' for details.
-#
-# The hypothetical commands `show w' and `show c' should show the appropriate
-# parts of the General Public License.  Of course, the commands you use may
-# be called something other than `show w' and `show c'; they could even be
-# mouse-clicks or menu items--whatever suits your program.
-#
-# You should also get your employer (if you work as a programmer) or your
-# school, if any, to sign a "copyright disclaimer" for the program, if
-# necessary.  Here is a sample; alter the names:
-#
-#  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-#  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-#
-#  <signature of Ty Coon>, 1 April 1989
-#  Ty Coon, President of Vice
-#
-# This General Public License does not permit incorporating your program into
-# proprietary programs.  If your program is a subroutine library, you may
-# consider it more useful to permit linking proprietary applications with the
-# library.  If this is what you want to do, use the GNU Library General
-# Public License instead of this License.
-#
-########## End of GNU General Public License (GPL), version 2 ##########
-
-## ----------------------- ##
-## 1. Language selection.  ##
-## ----------------------- ##
-
-
-# ------------------------------ #
-# 1d. The Objective C language.  #
-# ------------------------------ #
-
-# AC_LANG(Objective C)
-# --------------------
-# OBJCFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-m4_define([AC_LANG(Objective C)],
-[ac_ext=m
-ac_cpp='$OBJCPP $CPPFLAGS'
-ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-ac_compiler_gnu=$ac_cv_objc_compiler_gnu
-])
-
-
-# AC_LANG_OBJC
-# -------------------------
-AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
-
-
-# _AC_LANG_ABBREV(Objective C)
-# ----------------------------
-m4_define([_AC_LANG_ABBREV(Objective C)], [objc])
-
-
-# _AC_LANG_PREFIX(Objective C)
-# ----------------------------
-m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC])
-
-
-
-## ---------------------- ##
-## 2.Producing programs.  ##
-## ---------------------- ##
-
-
-# ------------------------- #
-# 2d. Objective C sources.  #
-# ------------------------- #
-
-# AC_LANG_SOURCE(Objective C)(BODY)
-# ---------------------------------
-m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
-
-
-# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY])
-# ------------------------------------------------
-m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)])
-
-
-# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION)
-# ---------------------------------------------
-m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)])
-
-
-# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION)
-# --------------------------------------------
-m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)])
-
-
-# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION)
-# -----------------------------------------------------------
-m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)])
-
-
-# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION)
-# ---------------------------------------------------
-m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)])
-
-
-
-## -------------------------------------------- ##
-## 3. Looking for Compilers and Preprocessors.  ##
-## -------------------------------------------- ##
-
-
-# ------------------------------ #
-# 3d. The Objective C compiler.  #
-# ------------------------------ #
-
-
-# AC_LANG_PREPROC(Objecitve C)
-# ----------------------------
-# Find the Objective C preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Objective C)],
-[AC_REQUIRE([AC_PROG_OBJCPP])])
-
-
-# AC_PROG_OBJCPP
-# --------------
-# Find a working Objective C preprocessor.
-# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
-# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_OBJC.
-AC_DEFUN([AC_PROG_OBJCPP],
-[AC_REQUIRE([AC_PROG_OBJC])dnl
-AC_ARG_VAR([OBJCPP],   [Objective C preprocessor])dnl
-_AC_ARG_VAR_CPPFLAGS()dnl
-AC_LANG_PUSH(Objective C)dnl
-AC_MSG_CHECKING([how to run the Objective C preprocessor])
-if test -z "$OBJCPP"; then
-  AC_CACHE_VAL(ac_cv_prog_OBJCPP,
-  [dnl
-    # Double quotes because OBJCPP needs to be expanded
-    for OBJCPP in "$OBJC -E" "/lib/cpp"
-    do
-      _AC_PROG_PREPROC_WORKS_IFELSE([break])
-    done
-    ac_cv_prog_OBJCPP=$OBJCPP
-  ])dnl
-  OBJCPP=$ac_cv_prog_OBJCPP
-else
-  ac_cv_prog_OBJCPP=$OBJCPP
-fi
-AC_MSG_RESULT([$OBJCPP])
-_AC_PROG_PREPROC_WORKS_IFELSE([],
-	  [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
-AC_SUBST(OBJCPP)dnl
-AC_LANG_POP(Objective C)dnl
-])# AC_PROG_OBJCPP
-
-
-# AC_LANG_COMPILER(Objective C)
-# -----------------------------
-# Find the Objective C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Objective C)],
-[AC_REQUIRE([AC_PROG_OBJC])])
-
-
-# ac_cv_prog_objc
-# ---------------
-# We used to name the cache variable this way.
-AU_DEFUN([ac_cv_prog_objc],
-[ac_cv_objc_compiler_gnu])
-
-
-# AC_PROG_OBJC([LIST-OF-COMPILERS])
-# ---------------------------------
-# LIST-OF-COMPILERS is a space separated list of Objective C compilers
-# to search for (if not specified, a default list is used).  This just gives
-# the user an opportunity to specify an alternative search list for the
-# Objective C compiler.
-# cc    Native compiler
-# objc  David Stes' Portable Object Compiler
-AN_MAKEVAR([OBJC],  [AC_PROG_OBJC])
-AN_PROGRAM([gcc],   [AC_PROG_OBJC])
-AN_PROGRAM([cc],    [AC_PROG_OBJC])
-AC_DEFUN([AC_PROG_OBJC],
-[AC_LANG_PUSH(Objective C)dnl
-AC_ARG_VAR([OBJC],      [Objective C compiler command])dnl
-AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-_AC_ARG_VAR_CPPFLAGS()dnl
-AC_CHECK_TOOLS(OBJC,
-	       [$CCC m4_default([$1],
-			  [gcc cc objc])],
-	       gcc)
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
-ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
-
-m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
-m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
-_AC_LANG_COMPILER_GNU
-GOBJC=`test $ac_compiler_gnu = yes && echo yes`
-_AC_PROG_OBJC_G
-AC_LANG_POP(Objective C)dnl
-])# AC_PROG_OBJC
-
-
-# _AC_PROG_OBJC_G
-# ---------------
-# Check whether -g works, even if OBJCFLAGS is set, in case the package
-# plays around with OBJCFLAGS (such as to build both debugging and
-# normal versions of a library), tasteless as that idea is.
-m4_define([_AC_PROG_OBJC_G],
-[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
-ac_save_OBJCFLAGS=$OBJCFLAGS
-OBJCFLAGS="-g"
-AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
-	       [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-				   [ac_cv_prog_objc_g=yes],
-				   [ac_cv_prog_objc_g=no])])
-if test "$ac_test_OBJCFLAGS" = set; then
-  OBJCFLAGS=$ac_save_OBJCFLAGS
-elif test $ac_cv_prog_objc_g = yes; then
-  if test "$GOBJC" = yes; then
-    OBJCFLAGS="-g -O2"
-  else
-    OBJCFLAGS="-g"
-  fi
-else
-  if test "$GOBJC" = yes; then
-    OBJCFLAGS="-O2"
-  else
-    OBJCFLAGS=
-  fi
-fi[]dnl
-])# _AC_PROG_OBJC_G
-
-
-## ------------------------------- ##
-## 4. Compilers' characteristics.  ##
-## ------------------------------- ##
-
-
-# -------------------------------- #
-# 4b. C compiler characteristics.  #
-# -------------------------------- #
-
-# libobjc and objc header tests shere?

Copied: trunk/base/objc.m4 (from rev 26176, branches/dp2mp-move/base/objc.m4)
===================================================================
--- trunk/base/objc.m4	                        (rev 0)
+++ trunk/base/objc.m4	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,623 @@
+# objc.m4
+# Based on c.m4 from GNU Autoconf
+# The Objective C support, added by Landon Fuller <landonf at opendarwin.org>
+# on March 10th, 2004, is heavily based on Autoconf's existing C++ support.
+#
+########### Copyright and Licensing terms ##########
+#
+# This file is part of Autoconf.                       -*- Autoconf -*-
+# Programming languages support.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+#
+# 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, 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.
+#
+# As a special exception, the Free Software Foundation gives unlimited
+# permission to copy, distribute and modify the configure scripts that
+# are the output of Autoconf.  You need not follow the terms of the GNU
+# General Public License when using or distributing such scripts, even
+# though portions of the text of Autoconf appear in them.  The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the Autoconf program.
+#
+# Certain portions of the Autoconf source text are designed to be copied
+# (in certain cases, depending on the input) into the output of
+# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
+# source text consists of comments plus executable code that decides which
+# of the data portions to output in any given case.  We call these
+# comments and executable code the "non-data" portions.  Autoconf never
+# copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of Autoconf
+# released by the Free Software Foundation.  When you make and
+# distribute a modified version of Autoconf, you may extend this special
+# exception to the GPL to apply to your modified version as well, *unless*
+# your modified version has the potential to copy into its output some
+# of the text that was the non-data portion of the version that you started
+# with.  (In other words, unless your change moves or copies text from
+# the non-data portions to the data portions.)  If your modification has
+# such potential, you must delete any notice of this special exception
+# to the GPL from your modified version.
+#
+# Written by David MacKenzie, with help from
+# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+#
+########## GNU General Public License (GPL), version 2  ##########
+#
+#		    GNU GENERAL PUBLIC LICENSE
+#		       Version 2, June 1991
+#
+#  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+#      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#  Everyone is permitted to copy and distribute verbatim copies
+#  of this license document, but changing it is not allowed.
+#
+# 			    Preamble
+# 
+#  The licenses for most software are designed to take away your
+# freedom to share and change it.  By contrast, the GNU General Public
+# License is intended to guarantee your freedom to share and change free
+# software--to make sure the software is free for all its users.  This
+# General Public License applies to most of the Free Software
+# Foundation's software and to any other program whose authors commit to
+# using it.  (Some other Free Software Foundation software is covered by
+# the GNU Library General Public License instead.)  You can apply it to
+# your programs, too.
+#
+#  When we speak of free software, we are referring to freedom, not
+# price.  Our General Public Licenses are designed to make sure that you
+# have the freedom to distribute copies of free software (and charge for
+# this service if you wish), that you receive source code or can get it
+# if you want it, that you can change the software or use pieces of it
+# in new free programs; and that you know you can do these things.
+#
+#  To protect your rights, we need to make restrictions that forbid
+# anyone to deny you these rights or to ask you to surrender the rights.
+# These restrictions translate to certain responsibilities for you if you
+# distribute copies of the software, or if you modify it.
+#
+#  For example, if you distribute copies of such a program, whether
+# gratis or for a fee, you must give the recipients all the rights that
+# you have.  You must make sure that they, too, receive or can get the
+# source code.  And you must show them these terms so they know their
+# rights.
+#
+#  We protect your rights with two steps: (1) copyright the software, and
+# (2) offer you this license which gives you legal permission to copy,
+# distribute and/or modify the software.
+#
+#  Also, for each author's protection and ours, we want to make certain
+# that everyone understands that there is no warranty for this free
+# software.  If the software is modified by someone else and passed on, we
+# want its recipients to know that what they have is not the original, so
+# that any problems introduced by others will not reflect on the original
+# authors' reputations.
+#
+#  Finally, any free program is threatened constantly by software
+# patents.  We wish to avoid the danger that redistributors of a free
+# program will individually obtain patent licenses, in effect making the
+# program proprietary.  To prevent this, we have made it clear that any
+# patent must be licensed for everyone's free use or not licensed at all.
+#
+#  The precise terms and conditions for copying, distribution and
+# modification follow.
+#
+#		    GNU GENERAL PUBLIC LICENSE
+#  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+#
+#  0. This License applies to any program or other work which contains
+# a notice placed by the copyright holder saying it may be distributed
+# under the terms of this General Public License.  The "Program", below,
+# refers to any such program or work, and a "work based on the Program"
+# means either the Program or any derivative work under copyright law:
+# that is to say, a work containing the Program or a portion of it,
+# either verbatim or with modifications and/or translated into another
+# language.  (Hereinafter, translation is included without limitation in
+# the term "modification".)  Each licensee is addressed as "you".
+#
+# Activities other than copying, distribution and modification are not
+# covered by this License; they are outside its scope.  The act of
+# running the Program is not restricted, and the output from the Program
+# is covered only if its contents constitute a work based on the
+# Program (independent of having been made by running the Program).
+# Whether that is true depends on what the Program does.
+#
+#  1. You may copy and distribute verbatim copies of the Program's
+# source code as you receive it, in any medium, provided that you
+# conspicuously and appropriately publish on each copy an appropriate
+# copyright notice and disclaimer of warranty; keep intact all the
+# notices that refer to this License and to the absence of any warranty;
+# and give any other recipients of the Program a copy of this License
+# along with the Program.
+#
+# You may charge a fee for the physical act of transferring a copy, and
+# you may at your option offer warranty protection in exchange for a fee.
+#
+#  2. You may modify your copy or copies of the Program or any portion
+# of it, thus forming a work based on the Program, and copy and
+# distribute such modifications or work under the terms of Section 1
+# above, provided that you also meet all of these conditions:
+#
+#    a) You must cause the modified files to carry prominent notices
+#    stating that you changed the files and the date of any change.
+#
+#    b) You must cause any work that you distribute or publish, that in
+#    whole or in part contains or is derived from the Program or any
+#    part thereof, to be licensed as a whole at no charge to all third
+#    parties under the terms of this License.
+#
+#    c) If the modified program normally reads commands interactively
+#    when run, you must cause it, when started running for such
+#    interactive use in the most ordinary way, to print or display an
+#    announcement including an appropriate copyright notice and a
+#    notice that there is no warranty (or else, saying that you provide
+#    a warranty) and that users may redistribute the program under
+#    these conditions, and telling the user how to view a copy of this
+#    License.  (Exception: if the Program itself is interactive but
+#    does not normally print such an announcement, your work based on
+#    the Program is not required to print an announcement.)
+#
+# These requirements apply to the modified work as a whole.  If
+# identifiable sections of that work are not derived from the Program,
+# and can be reasonably considered independent and separate works in
+# themselves, then this License, and its terms, do not apply to those
+# sections when you distribute them as separate works.  But when you
+# distribute the same sections as part of a whole which is a work based
+# on the Program, the distribution of the whole must be on the terms of
+# this License, whose permissions for other licensees extend to the
+# entire whole, and thus to each and every part regardless of who wrote it.
+#
+# Thus, it is not the intent of this section to claim rights or contest
+# your rights to work written entirely by you; rather, the intent is to
+# exercise the right to control the distribution of derivative or
+# collective works based on the Program.
+#
+# In addition, mere aggregation of another work not based on the Program
+# with the Program (or with a work based on the Program) on a volume of
+# a storage or distribution medium does not bring the other work under
+# the scope of this License.
+#
+#  3. You may copy and distribute the Program (or a work based on it,
+# under Section 2) in object code or executable form under the terms of
+# Sections 1 and 2 above provided that you also do one of the following:
+#
+#    a) Accompany it with the complete corresponding machine-readable
+#    source code, which must be distributed under the terms of Sections
+#    1 and 2 above on a medium customarily used for software interchange; or,
+#
+#    b) Accompany it with a written offer, valid for at least three
+#    years, to give any third party, for a charge no more than your
+#    cost of physically performing source distribution, a complete
+#    machine-readable copy of the corresponding source code, to be
+#    distributed under the terms of Sections 1 and 2 above on a medium
+#    customarily used for software interchange; or,
+#
+#    c) Accompany it with the information you received as to the offer
+#    to distribute corresponding source code.  (This alternative is
+#    allowed only for noncommercial distribution and only if you
+#    received the program in object code or executable form with such
+#    an offer, in accord with Subsection b above.)
+#
+# The source code for a work means the preferred form of the work for
+# making modifications to it.  For an executable work, complete source
+# code means all the source code for all modules it contains, plus any
+# associated interface definition files, plus the scripts used to
+# control compilation and installation of the executable.  However, as a
+# special exception, the source code distributed need not include
+# anything that is normally distributed (in either source or binary
+# form) with the major components (compiler, kernel, and so on) of the
+# operating system on which the executable runs, unless that component
+# itself accompanies the executable.
+#
+# If distribution of executable or object code is made by offering
+# access to copy from a designated place, then offering equivalent
+# access to copy the source code from the same place counts as
+# distribution of the source code, even though third parties are not
+# compelled to copy the source along with the object code.
+#
+#  4. You may not copy, modify, sublicense, or distribute the Program
+# except as expressly provided under this License.  Any attempt
+# otherwise to copy, modify, sublicense or distribute the Program is
+# void, and will automatically terminate your rights under this License.
+# However, parties who have received copies, or rights, from you under
+# this License will not have their licenses terminated so long as such
+# parties remain in full compliance.
+#
+#  5. You are not required to accept this License, since you have not
+# signed it.  However, nothing else grants you permission to modify or
+# distribute the Program or its derivative works.  These actions are
+# prohibited by law if you do not accept this License.  Therefore, by
+# modifying or distributing the Program (or any work based on the
+# Program), you indicate your acceptance of this License to do so, and
+# all its terms and conditions for copying, distributing or modifying
+# the Program or works based on it.
+
+#  6. Each time you redistribute the Program (or any work based on the
+# Program), the recipient automatically receives a license from the
+# original licensor to copy, distribute or modify the Program subject to
+# these terms and conditions.  You may not impose any further
+# restrictions on the recipients' exercise of the rights granted herein.
+# You are not responsible for enforcing compliance by third parties to
+# this License.
+#
+#  7. If, as a consequence of a court judgment or allegation of patent
+# infringement or for any other reason (not limited to patent issues),
+# conditions are imposed on you (whether by court order, agreement or
+# otherwise) that contradict the conditions of this License, they do not
+# excuse you from the conditions of this License.  If you cannot
+# distribute so as to satisfy simultaneously your obligations under this
+# License and any other pertinent obligations, then as a consequence you
+# may not distribute the Program at all.  For example, if a patent
+# license would not permit royalty-free redistribution of the Program by
+# all those who receive copies directly or indirectly through you, then
+# the only way you could satisfy both it and this License would be to
+# refrain entirely from distribution of the Program.
+#
+# If any portion of this section is held invalid or unenforceable under
+# any particular circumstance, the balance of the section is intended to
+# apply and the section as a whole is intended to apply in other
+# circumstances.
+#
+# It is not the purpose of this section to induce you to infringe any
+# patents or other property right claims or to contest validity of any
+# such claims; this section has the sole purpose of protecting the
+# integrity of the free software distribution system, which is
+# implemented by public license practices.  Many people have made
+# generous contributions to the wide range of software distributed
+# through that system in reliance on consistent application of that
+# system; it is up to the author/donor to decide if he or she is willing
+# to distribute software through any other system and a licensee cannot
+# impose that choice.
+#
+# This section is intended to make thoroughly clear what is believed to
+# be a consequence of the rest of this License.
+#
+#  8. If the distribution and/or use of the Program is restricted in
+# certain countries either by patents or by copyrighted interfaces, the
+# original copyright holder who places the Program under this License
+# may add an explicit geographical distribution limitation excluding
+# those countries, so that distribution is permitted only in or among
+# countries not thus excluded.  In such case, this License incorporates
+# the limitation as if written in the body of this License.
+#
+#  9. The Free Software Foundation may publish revised and/or new versions
+# of the General Public License from time to time.  Such new versions will
+# be similar in spirit to the present version, but may differ in detail to
+# address new problems or concerns.
+#
+# Each version is given a distinguishing version number.  If the Program
+# specifies a version number of this License which applies to it and "any
+# later version", you have the option of following the terms and conditions
+# either of that version or of any later version published by the Free
+# Software Foundation.  If the Program does not specify a version number of
+# this License, you may choose any version ever published by the Free Software
+# Foundation.
+#
+#  10. If you wish to incorporate parts of the Program into other free
+# programs whose distribution conditions are different, write to the author
+# to ask for permission.  For software which is copyrighted by the Free
+# Software Foundation, write to the Free Software Foundation; we sometimes
+# make exceptions for this.  Our decision will be guided by the two goals
+# of preserving the free status of all derivatives of our free software and
+# of promoting the sharing and reuse of software generally.
+#
+#			    NO WARRANTY
+#
+#  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+# FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+# OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+# PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+# OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+# TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+# PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+# REPAIR OR CORRECTION.
+#
+#  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+# WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+# REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+# INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+# OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+# TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+# YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+# PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGES.
+#
+#		     END OF TERMS AND CONDITIONS
+#
+#	    How to Apply These Terms to Your New Programs
+#
+#  If you develop a new program, and you want it to be of the greatest
+# possible use to the public, the best way to achieve this is to make it
+# free software which everyone can redistribute and change under these terms.
+#
+#  To do so, attach the following notices to the program.  It is safest
+# to attach them to the start of each source file to most effectively
+# convey the exclusion of warranty; and each file should have at least
+# the "copyright" line and a pointer to where the full notice is found.
+#
+#    <one line to give the program's name and a brief idea of what it does.>
+#    Copyright (C) <year>  <name of author>
+#
+#    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
+#
+#
+# Also add information on how to contact you by electronic and paper mail.
+#
+# If the program is interactive, make it output a short notice like this
+# when it starts in an interactive mode:
+#
+#    Gnomovision version 69, Copyright (C) year  name of author
+#    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+#    This is free software, and you are welcome to redistribute it
+#    under certain conditions; type `show c' for details.
+#
+# The hypothetical commands `show w' and `show c' should show the appropriate
+# parts of the General Public License.  Of course, the commands you use may
+# be called something other than `show w' and `show c'; they could even be
+# mouse-clicks or menu items--whatever suits your program.
+#
+# You should also get your employer (if you work as a programmer) or your
+# school, if any, to sign a "copyright disclaimer" for the program, if
+# necessary.  Here is a sample; alter the names:
+#
+#  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+#  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+#
+#  <signature of Ty Coon>, 1 April 1989
+#  Ty Coon, President of Vice
+#
+# This General Public License does not permit incorporating your program into
+# proprietary programs.  If your program is a subroutine library, you may
+# consider it more useful to permit linking proprietary applications with the
+# library.  If this is what you want to do, use the GNU Library General
+# Public License instead of this License.
+#
+########## End of GNU General Public License (GPL), version 2 ##########
+
+## ----------------------- ##
+## 1. Language selection.  ##
+## ----------------------- ##
+
+
+# ------------------------------ #
+# 1d. The Objective C language.  #
+# ------------------------------ #
+
+# AC_LANG(Objective C)
+# --------------------
+# OBJCFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+m4_define([AC_LANG(Objective C)],
+[ac_ext=m
+ac_cpp='$OBJCPP $CPPFLAGS'
+ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
+ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
+ac_compiler_gnu=$ac_cv_objc_compiler_gnu
+])
+
+
+# AC_LANG_OBJC
+# -------------------------
+AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
+
+
+# _AC_LANG_ABBREV(Objective C)
+# ----------------------------
+m4_define([_AC_LANG_ABBREV(Objective C)], [objc])
+
+
+# _AC_LANG_PREFIX(Objective C)
+# ----------------------------
+m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC])
+
+
+
+## ---------------------- ##
+## 2.Producing programs.  ##
+## ---------------------- ##
+
+
+# ------------------------- #
+# 2d. Objective C sources.  #
+# ------------------------- #
+
+# AC_LANG_SOURCE(Objective C)(BODY)
+# ---------------------------------
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
+
+
+# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY])
+# ------------------------------------------------
+m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)])
+
+
+# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION)
+# ---------------------------------------------
+m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)])
+
+
+# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION)
+# --------------------------------------------
+m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)])
+
+
+# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION)
+# -----------------------------------------------------------
+m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)])
+
+
+# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION)
+# ---------------------------------------------------
+m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)])
+
+
+
+## -------------------------------------------- ##
+## 3. Looking for Compilers and Preprocessors.  ##
+## -------------------------------------------- ##
+
+
+# ------------------------------ #
+# 3d. The Objective C compiler.  #
+# ------------------------------ #
+
+
+# AC_LANG_PREPROC(Objecitve C)
+# ----------------------------
+# Find the Objective C preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
+AC_DEFUN([AC_LANG_PREPROC(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJCPP])])
+
+
+# AC_PROG_OBJCPP
+# --------------
+# Find a working Objective C preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_OBJC.
+AC_DEFUN([AC_PROG_OBJCPP],
+[AC_REQUIRE([AC_PROG_OBJC])dnl
+AC_ARG_VAR([OBJCPP],   [Objective C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+AC_LANG_PUSH(Objective C)dnl
+AC_MSG_CHECKING([how to run the Objective C preprocessor])
+if test -z "$OBJCPP"; then
+  AC_CACHE_VAL(ac_cv_prog_OBJCPP,
+  [dnl
+    # Double quotes because OBJCPP needs to be expanded
+    for OBJCPP in "$OBJC -E" "/lib/cpp"
+    do
+      _AC_PROG_PREPROC_WORKS_IFELSE([break])
+    done
+    ac_cv_prog_OBJCPP=$OBJCPP
+  ])dnl
+  OBJCPP=$ac_cv_prog_OBJCPP
+else
+  ac_cv_prog_OBJCPP=$OBJCPP
+fi
+AC_MSG_RESULT([$OBJCPP])
+_AC_PROG_PREPROC_WORKS_IFELSE([],
+	  [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
+AC_SUBST(OBJCPP)dnl
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJCPP
+
+
+# AC_LANG_COMPILER(Objective C)
+# -----------------------------
+# Find the Objective C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
+AC_DEFUN([AC_LANG_COMPILER(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJC])])
+
+
+# ac_cv_prog_objc
+# ---------------
+# We used to name the cache variable this way.
+AU_DEFUN([ac_cv_prog_objc],
+[ac_cv_objc_compiler_gnu])
+
+
+# AC_PROG_OBJC([LIST-OF-COMPILERS])
+# ---------------------------------
+# LIST-OF-COMPILERS is a space separated list of Objective C compilers
+# to search for (if not specified, a default list is used).  This just gives
+# the user an opportunity to specify an alternative search list for the
+# Objective C compiler.
+# cc    Native compiler
+# objc  David Stes' Portable Object Compiler
+AN_MAKEVAR([OBJC],  [AC_PROG_OBJC])
+AN_PROGRAM([gcc],   [AC_PROG_OBJC])
+AN_PROGRAM([cc],    [AC_PROG_OBJC])
+AC_DEFUN([AC_PROG_OBJC],
+[AC_LANG_PUSH(Objective C)dnl
+AC_ARG_VAR([OBJC],      [Objective C compiler command])dnl
+AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+AC_CHECK_TOOLS(OBJC,
+	       [$CCC m4_default([$1],
+			  [gcc cc objc])],
+	       gcc)
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
+ac_compiler=`set X $ac_compile; echo $[2]`
+_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+GOBJC=`test $ac_compiler_gnu = yes && echo yes`
+_AC_PROG_OBJC_G
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJC
+
+
+# _AC_PROG_OBJC_G
+# ---------------
+# Check whether -g works, even if OBJCFLAGS is set, in case the package
+# plays around with OBJCFLAGS (such as to build both debugging and
+# normal versions of a library), tasteless as that idea is.
+m4_define([_AC_PROG_OBJC_G],
+[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
+ac_save_OBJCFLAGS=$OBJCFLAGS
+OBJCFLAGS="-g"
+AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
+	       [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+				   [ac_cv_prog_objc_g=yes],
+				   [ac_cv_prog_objc_g=no])])
+if test "$ac_test_OBJCFLAGS" = set; then
+  OBJCFLAGS=$ac_save_OBJCFLAGS
+elif test $ac_cv_prog_objc_g = yes; then
+  if test "$GOBJC" = yes; then
+    OBJCFLAGS="-g -O2"
+  else
+    OBJCFLAGS="-g"
+  fi
+else
+  if test "$GOBJC" = yes; then
+    OBJCFLAGS="-O2"
+  else
+    OBJCFLAGS=
+  fi
+fi[]dnl
+])# _AC_PROG_OBJC_G
+
+
+## ------------------------------- ##
+## 4. Compilers' characteristics.  ##
+## ------------------------------- ##
+
+
+# -------------------------------- #
+# 4b. C compiler characteristics.  #
+# -------------------------------- #
+
+# libobjc and objc header tests shere?

Modified: trunk/base/portmgr/IndexRegen.sh
===================================================================
--- trunk/base/portmgr/IndexRegen.sh	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/IndexRegen.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -29,7 +29,7 @@
 SRCTREE=${ROOT}/source
 # Where MP will install its world. This gets created.
 PREFIX=${ROOT}/opt/local
-# Where MP installs darwinports1.0. This gets created.
+# Where MP installs macports1.0. This gets created.
 TCLPKG=${PREFIX}/lib/tcl
 # Path.
 PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
@@ -61,25 +61,25 @@
     exit 1
 fi
 
-# Checkout/update the dports tree
+# Checkout/update the ports tree
 if [ -d ${SRCTREE}/dports ]; then
     $SVN update ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-        || { echo "Updating the dports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG; bail ; }
+	|| { echo "Updating the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG; bail ; }
 else
     $SVN checkout ${REPO_BASE}/trunk/dports ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-        || { echo "Checking out the dports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG; bail ; }
+	|| { echo "Checking out the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG ; bail ; }
 fi
+echo `date -u +%s` > ${ROOT}/PORTS-TIMESTAMP
 
 # Checkout/update HEAD
 TMPDIR=mp_trunk/base
 if [ -d ${ROOT}/${TMPDIR} ]; then
     $SVN update ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-        || { echo "Updating the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG; bail ; }
+	|| { echo "Updating the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG; bail ; }
 else
     $SVN checkout ${REPO_BASE}/trunk/base ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-        || { echo "Checking out the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG; bail ; }
+       || { echo "Checking out the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG ; bail ; }
 fi
-echo `date -u +%s` > ${ROOT}/DPORTS-TIMESTAMP
 
 # Extract the release URL from HEAD
 read RELEASE_URL < ${ROOT}/${TMPDIR}/${RELEASE_URL_FILE}
@@ -87,11 +87,11 @@
 
 # Checkout/update the release base
 if [ -d ${SRCTREE}/base ]; then
-    $SVN switch ${RELEASE_URL}/base ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-        || { echo "Updating base from ${RELEASE_URL}/base failed." >> $FAILURE_LOG; bail ; }
+    $SVN switch ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
+	|| { echo "Updating base from ${RELEASE_URL} failed." >> $FAILURE_LOG; bail ; }
 else
-    $SVN checkout $RELEASE_URL/base ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-        || { echo "Checking out base from ${RELEASE_URL}/base failed." >> $FAILURE_LOG ; bail ; }
+    $SVN checkout ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
+	|| { echo "Checking out base from ${RELEASE_URL} failed." >> $FAILURE_LOG ; bail ; }
 fi
 echo `date -u +%s` > ${ROOT}/BASE-TIMESTAMP
 
@@ -132,4 +132,4 @@
     || { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
 
 # At this point the index was committed successfuly, so we cleanup before we exit.
-cleanup
+cleanup && exit 0

Deleted: trunk/base/portmgr/Makefile
===================================================================
--- trunk/base/portmgr/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,27 +0,0 @@
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/resources/portmgr
-
-SCRIPTS=	PortIndex2MySQL
-
-edit = sed \
-	-e 's, at PREFIX\@,$(prefix),g' \
-	-e 's, at TCL_PACKAGE_DIR\@,$(TCL_PACKAGE_DIR),g'
-
-include ../Mk/dports.autoconf.mk
-
-all: ${SCRIPTS}
-
-PortIndex2MySQL: PortIndex2MySQL.tcl
-	${edit} PortIndex2MySQL.tcl > $@
-
-clean:
-	rm -f ${SCRIPTS}
-
-test:
-
-distclean: clean
-
-install:
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
-	$(SILENT)set -x; for file in ${SCRIPTS}; do \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 544 $$file ${INSTALLDIR}; \
-	done

Deleted: trunk/base/portmgr/PortIndex2MySQL.tcl
===================================================================
--- trunk/base/portmgr/PortIndex2MySQL.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/PortIndex2MySQL.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,214 +0,0 @@
-#!/usr/bin/env tclsh
-# PortIndex2MySQL.tcl
-# Kevin Van Vechten | kevin at opendarwin.org
-# 3-Oct-2002
-# $Id$
-#
-# Copyright (c) 2003 Apple Computer, Inc.
-# Copyright (c) 2002 Kevin Van Vechten. 
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-catch {source \
-	   [file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
-package require darwinports
-
-proc ui_prefix {priority} {
-	return ""
-}
-
-proc ui_channels {priority} {
-	return {}
-}
-
-# This should be a command line argument.
-# if true, use_db insructs the script to insert directly into a database
-# otherwise, sql statements will be printed to stdout.
-set use_db ""
-
-array set ui_options {}
-array set global_options {}
-array set global_variations {}
-dportinit ui_options global_options global_variations
-
-if {$use_db != ""} {
-    load @PREFIX@/lib/libmysqltcl.dylib
-    set db [mysqlconnect -user darwinports -password woot -db darwinports]
-} else {
-    set db ""
-}
-
-proc sql_exec {db sql} {
-    if {$db != ""} {
-        mysqlexec $db $sql
-    } else {
-        puts "${sql};"
-    }
-}
-
-proc sql_escape {str} {
-    global use_db
-    if {$use_db != ""} {
-        return [msyqlescape $str]
-    } else {
-        regsub -all -- {'} $str {\\'} str
-        regsub -all -- {"} $str {\\"} str
-        regsub -all -- {\n} $str {\\n} str
-        return $str
-    }
-}
-
-# CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, 
-#  path VARCHAR(255),
-#  version VARCHAR(255),
-#  description TEXT);
-
-# CREATE TABLE categories (portfile VARCHAR(255), 
-#  category VARCHAR(255), 
-#  primary INTEGER);
-
-# CREATE TABLE maintainers (portfile VARCHAR(255),
-#  maintainer VARCHAR(255),
-#  primary INTEGER);
-
-sql_exec $db "DROP TABLE log"
-sql_exec $db "CREATE TABLE IF NOT EXISTS log (activity VARCHAR(255), activity_time TIMESTAMP(14))"
-sql_exec $db "INSERT INTO log VALUES ('update', NOW())"
-
-sql_exec $db "DROP TABLE portfiles"
-sql_exec $db "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255),  description TEXT)"
-
-sql_exec $db "DROP TABLE IF EXISTS categories"
-sql_exec $db "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER)"
-
-sql_exec $db "DROP TABLE IF EXISTS maintainers"
-sql_exec $db "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER)"
-
-sql_exec $db "DROP TABLE IF EXISTS dependencies"
-sql_exec $db "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255))"
-
-sql_exec $db "DROP TABLE IF EXISTS variants"
-sql_exec $db "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255))"
-
-sql_exec $db "DROP TABLE IF EXISTS platforms"
-sql_exec $db "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255))"
-
-if {[catch {set ports [dportsearch ".+"]} errstr]} {
-	puts "port search failed: $errstr"
-	exit 1
-}
-
-foreach {name array} $ports {
-	array unset portinfo
-	array set portinfo $array
-	set portname [sql_escape $portinfo(name)]
-	if {[info exists portinfo(version)]} {
-		set portversion [sql_escape $portinfo(version)]
-	} else {
-		set portversion ""
-	}
-	set portdir [sql_escape $portinfo(portdir)]
-	if {[info exists portinfo(description)]} {
-		set description [sql_escape $portinfo(description)]
-	} else {
-		set description ""
-	}
-	if {[info exists portinfo(categories)]} {
-		set categories $portinfo(categories)
-	} else {
-		set categories ""
-	}
-	if {[info exists portinfo(maintainers)]} {
-		set maintainers $portinfo(maintainers)
-	} else {
-		set maintainers ""
-	}
-	if {[info exists portinfo(variants)]} {
-		set variants $portinfo(variants)
-	} else {
-		set variants ""
-	}
-	if {[info exists portinfo(depends_lib)]} {
-		set depends_lib $portinfo(depends_lib)
-	} else {
-		set depends_lib ""
-	}
-	if {[info exists portinfo(platforms)]} {
-		set platforms $portinfo(platforms)
-	} else {
-		set platforms ""
-	}
-		
-	set sql "INSERT INTO portfiles VALUES ('$portname', '$portdir', '$portversion', '$description')"
-	#puts "$sql"
-	sql_exec $db $sql
-
-	set primary 1
-	foreach category $categories {
-		set category [sql_escape $category]
-		set sql "INSERT INTO categories VALUES ('$portname', '$category', $primary)"
-		#puts "$sql"
-		sql_exec $db $sql
-		set primary 0
-	}
-	
-	set primary 1
-	foreach maintainer $maintainers {
-		set maintainer [sql_escape $maintainer]
-		set sql "INSERT INTO maintainers VALUES ('$portname', '$maintainer', $primary)"
-		#puts "$sql"
-		sql_exec $db $sql
-		set primary 0
-	}
-
-	foreach lib $depends_lib {
-		set lib [sql_escape $lib]
-		set sql "INSERT INTO dependencies VALUES ('$portname', '$lib')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-	foreach variant $variants {
-		set variant [sql_escape $variant]
-		set sql "INSERT INTO variants VALUES ('$portname', '$variant')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-	foreach platform $platforms {
-		set platform [sql_escape $platform]
-		set sql "INSERT INTO platforms VALUES ('$portname', '$platform')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-}
-
-if {$db != ""} {
-    mysqlclose $db
-    mysqlclose
-}

Deleted: trunk/base/portmgr/SETUP.chroot.sh
===================================================================
--- trunk/base/portmgr/SETUP.chroot.sh	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/SETUP.chroot.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,39 +0,0 @@
-# !/bin/sh
-
-# DarwinPorts chrooted automated build system setup.
-# kevin at opendarwin.org
-# 21-Feb-2003
-
-# This should be run as uid 0, gid 0 from within the chroot.
-
-# Set up some necessary environment variables.
-
-export PATH=/opt/local/bin:/usr/X11R6/bin:${PATH}
-export HOME=/Users/Shared
-export CVSROOT=:pserver:anoncvs at anoncvs.opendarwin.org:/Volumes/src/cvs/od
-
-export MACOSX_DEPLOYMENT_TARGET=10.2
-export UNAME_RELEASE=6.0
-
-# Update the copy of darwinports from cvs,
-# sync the ports tree, and re-index.
-
-cd $HOME/darwinports
-cvs update
-make
-make install
-port sync
-cd dports
-portindex
-
-# Start building ports
-mkdir -p /darwinports/distfiles
-mkdir -p /darwinports/logs
-mkdir -p /darwinports/pkgs
-mkdir -p /darwinports/mpkgs
-mkdir -p /darwinports/rpms
-
-cd $HOME/darwinports
-#tclsh base/src/portmgr/packageall.tcl
-
-bash

Modified: trunk/base/portmgr/autosubmit.tcl
===================================================================
--- trunk/base/portmgr/autosubmit.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/autosubmit.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tclsh
 
-package require darwinports
+package require macports
 package require sqlite3
 
 proc open_db { db_file } {
@@ -34,7 +34,7 @@
 proc submit_ports {} {
 	global prefix submit_options verbose
 
-	if {[catch {set res [dportsearch "^.*\$"]} result]} {
+	if {[catch {set res [mportsearch "^.*\$"]} result]} {
 		puts "port search failed: $result"
 		exit 1
 	}
@@ -52,7 +52,7 @@
 		if { 0 != [regexp {file://(.*)} $porturl match path] } {
 			set portdir [file normalize $path]
 		} else {
-			set portdir [file normalize [darwinports::getportdir $porturl]]
+			set portdir [file normalize [macports::getportdir $porturl]]
 		}
 		set portfile "${portdir}/Portfile"
 		if { $verbose } { puts "checking ${name}" }
@@ -80,7 +80,7 @@
 	
 					# Open the port
 					set err 0
-					if {[catch {set workername [dportopen $porturl [array get submit_options]]} result]} {
+					if {[catch {set workername [mportopen $porturl [array get submit_options]]} result]} {
 						global errorInfo
 						ui_debug "$errorInfo"
 						puts "Unable to open port: $result"
@@ -88,7 +88,7 @@
 					}
 	
 					# Submit the port
-					if { !$err && [catch {set result [dportexec $workername submit]} result]} {
+					if { !$err && [catch {set result [mportexec $workername submit]} result]} {
 						global errorInfo
 						ui_debug "$errorInfo"
 						puts "Unable to execute port: $result"
@@ -96,7 +96,7 @@
 					}
 			
 					# Close the port
-					dportclose $workername
+					mportclose $workername
 					
 					# Update the date in the database for this item
 					if { !$err && !$result } {
@@ -138,11 +138,11 @@
 	set verbose 1
 }
 
-# Initialize dports api
-dportinit
+# Initialize mports api
+mportinit
 
 # Submit ports
-set db_file [file normalize "${darwinports::macports_user_dir}/autosubmit.db"]
+set db_file [file normalize "${macports::macports_user_dir}/autosubmit.db"]
 if { $verbose } { puts "Using database at $db_file" }
 open_db $db_file
 submit_ports

Deleted: trunk/base/portmgr/buildall.sh
===================================================================
--- trunk/base/portmgr/buildall.sh	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/buildall.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,222 +0,0 @@
-#!/bin/sh
-
-# Author: Jordan K. Hubbard
-# Date: 2004/12/10
-#
-# Declare all the various shell functions which do the heavy lifting.
-# If you want to see the main body of this script, go to the end of the file.
-
-# What we want to call the base chroot images
-CHROOTBASE=chrootbase.sparseimage
-DPORTSCACHE=dportscache.sparseimage
-FSTYPE=HFSX
-
-# Some conservative (and large) defaults.
-BASE_PADDING=16000000
-DPORTSCACHE_SIZE=65536M
-
-# deal with fatal errors
-bomb() {
-	echo "Error: $*"
-	echo "BASEDEV=${BASEDEV} DPORTSDEV=${DPORTSDEV}"
-	exit 1
-}
-
-# Everything we need to create the base chroot disk image (populated from host)
-mkchrootbase() {
-	if [ -f ${CHROOTBASE} ]; then
-		echo "Using existing ${CHROOTBASE} for efficiency"
-	else
-		dir=$1
-		mkdir -p $dir
-
-		# Add to this list as you find minimum dependencies DP really needs.
-		chrootfiles="bin sbin etc tmp var/log var/spool var/run var/tmp var/db private/etc private/tmp private/var dev/null usr Developer System/Library Library"
-
-		echo "Calculating chroot base image size..."
-		# start with this size to account for other overhead
-		sz=${BASE_PADDING}
-		if [ "`uname -r|tr -d .`" -ge 800 ]; then
-			# hack-around for Tiger
-			sz=$((sz + 8000000))
-		else
-			for i in $chrootfiles; do
-				mysz=`cd /; du -sk $i |awk '{print $1}'`
-				sz=$(($sz + $mysz))
-			done
-		fi
-		echo "Creating bootstrap disk image of ${sz}K bytes"
-		hdiutil create -size ${sz}k -fs ${FSTYPE} -volname base ${CHROOTBASE} > /dev/null
-		BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-		echo "Image attached as $BASEDEV"
-		echo "Copying chroot files into bootstrap disk image"
-		for i in $chrootfiles; do
-			pax -pe -rw /$i $dir 2>/dev/null
-			# special case for pax
-			cp /bin/pax $dir/bin/pax
-		done
-		# special case nukes to prevent builder pollution
-		rm -rf $dir/usr/X11R6 $dir/etc/X11
-		rm -rf $dir/opt/local $dir/etc/ports
-		# If there are any work-arounds, apply them now
-		if [ -f chroot-fixups.tar.gz ]; then
-			echo "Found chroot-fixups.tar.gz - applying to new chroot"
-			tar xpzf chroot-fixups.tar.gz -C $dir
-		fi
-		if [ -f darwinports.tar.gz ]; then
-			echo "Found darwinports.tar.gz - copying into chroot"
-			tar -xpzf darwinports.tar.gz -C $dir
-		elif [ -d darwinports ]; then
-			pax -rw darwinports $dir
-		else
-			echo "no darwinports.tar.gz or darwinports directory found - please fix this and try again."
-			exit 1
-		fi
-		bootstrapdports $dir
-	fi
-	if [ -f ${DPORTSCACHE} ]; then
-		echo "Using existing ${DPORTSCACHE} for efficiency"
-	else
-		echo "Creating dports cache of size ${DPORTSCACHE_SIZE}"
-		hdiutil create -size ${DPORTSCACHE_SIZE} -fs ${FSTYPE} -volname distfiles ${DPORTSCACHE} > /dev/null
-		DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-		mkdir -p $dir/distfiles
-		mkdir -p $dir/packages/darwin/powerpc
-		hdiutil detach $DPORTSDEV -force >& /dev/null && DPORTSDEV=""
-	fi
-}
-
-bootstrapdports() {
-	dir=$1
-	cat > $dir/bootstrap.sh << EOF
-#!/bin/sh
-cd darwinports/base
-./configure
-make all install
-make clean
-echo "file:///darwinports/dports" > /opt/local/etc/ports/sources.conf
-echo "BatchMode yes" >> /etc/ssh_config
-EOF
-	if [ "$PKGTYPE" = "dpkg" ]; then
-	    echo "/opt/local/bin/port install dpkg" >> $dir/bootstrap.sh
-	fi
-	chmod 755 $dir/bootstrap.sh
-	echo "Bootstrapping darwinports in chroot"
-	/sbin/mount_devfs devfs ${dir}/dev
-	/sbin/mount_fdesc -o union fdesc ${dir}/dev
-	chroot $dir /bootstrap.sh && rm $dir/bootstrap.sh
-	umount -f ${dir}/dev
-	umount -f ${dir}/dev
-	hdiutil detach $BASEDEV -force >& /dev/null && BASEDEV=""
-}
-
-# Set up the base chroot image
-prepchroot() {
-	dir=$1
-	rm -f ${CHROOTBASE}.shadow
-	BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -shadow -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-	mkdir -p $dir/.vol
- 	DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir/opt/local/var/db/dports -union -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-	/sbin/mount_devfs devfs $dir/dev || bomb "unable to mount devfs"
-	/sbin/mount_fdesc -o union fdesc $dir/dev || bomb "unable to mount fdesc"
-}
-
-# Undo the work of prepchroot
-teardownchroot() {
-	dir=$1
-	umount -f $dir/dev  || (echo "unable to umount devfs")
-	umount -f $dir/dev  || (echo "unable to umount fdesc")
-	[ -z "$DPORTSDEV" ] || (hdiutil detach $DPORTSDEV -force >& /dev/null || bomb "unable to detach DPORTSDEV")
-	DPORTSDEV=""
-	if [ ! -z "$BASEDEV" ]; then
-		if ! hdiutil detach $BASEDEV -force >& /dev/null; then
-			echo "Warning: Unable to detach BASEDEV ($BASEDEV)"
-		fi
-	fi
-}
-
-# main:  This is where we start the show.
-TGTPORTS=""
-PKGTYPE=rpmpackage
-
-if [ $# -lt 1 ]; then
-	echo "Usage: $0 chrootdir [-p pkgtype] [targetportsfile]"
-	exit 1
-else
-	DIR=$1
-	shift
-	if [ $# -gt 1 ]; then
-		if [ $1 = "-p" ]; then
-		    shift
-		    PKGTYPE=$1
-		    shift
-		fi
-	fi
-	if [ $# -gt 0 ]; then
-		TGTPORTS=$1
-	fi
-fi
-
-mkdir -p outputdir/summary outputdir/Packages outputdir/logs/succeeded outputdir/logs/failed outputdir/tmp
-
-if [ -z "$TGTPORTS" ]; then
-	if [ -f PortIndex ]; then
-		PINDEX=PortIndex
-	elif [ -f darwinports/dports/PortIndex ]; then
-		PINDEX=darwinports/dports/PortIndex
-	else
-		echo "I need a PortIndex file to work from - please put one in the"
-		echo "current directory or unpack a darwinports distribution to get it from"
-		exit 1
-	fi
-	TGTPORTS=outputdir/summary/portsrun
-	awk 'NF == 2 {print $1}' $PINDEX > $TGTPORTS
-else
-	echo "Using command-line provided target of $TGTPORTS"
-fi
-
-mkchrootbase $DIR
-ARCH="`uname -p`"
-if [ "${ARCH}" = "powerpc" ]; then
-	ARCH=ppc
-fi
-
-echo "Starting packaging run for `wc -l $TGTPORTS | awk '{print $1}'` ports."
-for pkg in `cat $TGTPORTS`; do
-	if [ -f badports.txt ]; then
-		if ! grep -q $pkg badports.txt; then
-		    continue
-		fi
-	fi
-	prepchroot $DIR
-	echo "Starting packaging run for $pkg"
-	echo "#!/bin/sh" > $DIR/bootstrap.sh
-	echo 'export PATH=$PATH:/opt/local/bin' >> $DIR/bootstrap.sh
-	echo '/sbin/mount_volfs /.vol' >> $DIR/bootstrap.sh
-	echo "mkdir -p /Package" >> $DIR/bootstrap.sh
-	echo "rm -f /tmp/success" >> $DIR/bootstrap.sh
-	echo "if port -v $PKGTYPE $pkg package.destpath=/Package >& /tmp/$pkg.log; then touch /tmp/success; fi" >> $DIR/bootstrap.sh
-	echo 'umount -f /.vol || (echo "unable to umount volfs"; exit 1)' >> $DIR/bootstrap.sh
-	echo "exit 0" >> $DIR/bootstrap.sh
-	chmod 755 $DIR/bootstrap.sh
-	chroot $DIR /bootstrap.sh || bomb "bootstrap script in chroot returned failure status"
-	if [ ! -f $DIR/tmp/success ]; then
-		echo $pkg >> outputdir/summary/portsfailed
-		type="failed"
-	else
-		echo $pkg >> outputdir/summary/portspackaged
-		if [ "$PKGTYPE" = "mpkg" ]; then
-		    mv $DIR/Package/*.mpkg outputdir/Packages/
-		elif [ "$PKGTYPE" = "rpmpackage" ]; then
-		    mv $DIR/Package/RPMS/${ARCH}/*.rpm outputdir/Packages/
-		elif [ "$PKGTYPE" = "dpkg" ]; then
-		    mv $DIR/Package/*.deb outputdir/Packages/
-		fi
-		type="succeeded"
-	fi
-	mv $DIR/tmp/$pkg.log outputdir/logs/$type
-	teardownchroot $DIR
-	echo "Finished packaging run for $pkg ($type)"
-done
-echo "Packaging run complete."
-exit 0

Modified: trunk/base/portmgr/dmg/ReadMe.rtf
===================================================================
--- trunk/base/portmgr/dmg/ReadMe.rtf	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/dmg/ReadMe.rtf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,8 +1,8 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
 {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
 }
 {\colortbl;\red255\green255\blue255;}
-\margl1440\margr1440\vieww15380\viewh13340\viewkind0
+\margl1440\margr1440\vieww20140\viewh18020\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
 
 \f0\fs24 \cf0 \
@@ -35,7 +35,7 @@
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
 
 \f0\b0 \cf0 \
-Aside from a few MacPorts executable commands in /opt/local/bin, most MacPorts files are installed in /opt/local/var/db/dports. Within these directories you will find a "sources" directory containing the Portfiles that hold the necessary instructions to install individual ports, and also the source code for MacPorts itself. Both are kept up to date by using the 
+Aside from a few MacPorts executable commands in /opt/local/bin, most MacPorts files are installed in /opt/local/var/macports. Within this directories you will find a "sources" directory containing the Portfiles that hold the necessary instructions to install individual ports, and also the source code for MacPorts itself. Both are kept up to date by using the 
 \f2\i port selfupdate
 \f0\i0  command as shown below. Please read the port(1) man page for more information.\
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
@@ -120,4 +120,5 @@
 
 \f0\b0 \cf0 If you are interested in developing your own ports for private usage, or would like to submit your ports for inclusion within the MacPorts software repository, please consult the documentation provided on our website. The MacPorts project depends on a community of active participants and we are always open to welcoming new volunteers and their contributions!\
 \
-Thank you for your interest in MacPorts!}
\ No newline at end of file
+Thank you for your interest in MacPorts!\
+}
\ No newline at end of file

Modified: trunk/base/portmgr/dmg/postflight
===================================================================
--- trunk/base/portmgr/dmg/postflight	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/dmg/postflight	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,7 +34,7 @@
 
 BINPATH=/opt/local/bin
 SBINPATH=/opt/local/sbin
-TMP=`/usr/bin/mktemp /tmp/dp.$$`
+TMP=`/usr/bin/mktemp /tmp/mp.$$`
 $SHELL -l <<EOF > $TMP
     /usr/bin/printenv PATH
     exit

Deleted: trunk/base/portmgr/dpkgall.tcl
===================================================================
--- trunk/base/portmgr/dpkgall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/dpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,932 +0,0 @@
-#!/usr/bin/env tclsh8.4
-# dpkgbuild.tcl
-# $Id$
-#
-# Copyright (c) 2004 Landon Fuller <landonf at opendarwin.org>
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-#######################################
-#
-# Must be installed outside of dports tree:
-#	tcl 8.4
-#	curl
-#	tar
-#	gzip
-#	unzip
-#	dports tree
-#
-# A tar file containing full /${portprefix} directory tree, stored in:
-#	$pkgrepo/$architecture/root.tar.gz
-# The /${portprefix} directory tree must contain:
-#	DarwinPorts installation
-#	dpkg
-#
-# Configuration:
-#	/etc/ports/dpkg.conf
-#	/etc/ports/dpkg
-#
-#######################################
-
-package require darwinports
-
-# Configuration Namespace
-namespace eval dpkg {
-	variable configopts "pkgrepo architecture portlistfile portprefix dportsrc silentmode initialports"
-
-	# Preferences
-	variable silentmode false
-	variable configfile "/etc/ports/dpkg.conf"
-	variable portlist ""
-	variable portprefix "/usr/dports"
-	variable dportsrc "/usr/darwinports"
-	variable pkgrepo "/export/dpkg/"
-	# architecture is set in main
-	variable architecture
-	variable initialports "dpkg apt"
-	variable aptpackagedir
-	variable packagedir
-	# portlistfile defaults to ${pkgrepo}/${architecture}/etc/buildlist.txt (set in main)
-	variable portlistfile
-	# baselistfile defaults to ${pkgrepo}/${architecture}/etc/baselist.txt (set in main)
-	variable baselistfile
-
-	# Non-user modifiable.
-	# Ports required for building. Format:
-	# <binary> <portname> <binary> <portname> ...
-	variable requiredports "dpkg dpkg apt-get apt"
-
-	# Current log file descriptor
-	variable logfd
-}
-
-# DarwinPorts UI Event Callbacks
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "Debug: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-	global dpkg::logfd
-	if {[info exists logfd] && [string length $logfd] > 0 } {
-		return {$logfd}
-	} elseif {$message(priority) != "debug"} {
-		# If there's no log file, echo to stdout
-		return {stdout}
-	}
-}
-
-proc ui_silent {message} {
-	global dpkg::silentmode
-	if {"${silentmode}" != true} {
-		puts $message
-		ui_msg $message
-	} else {
-		ui_msg $message
-	}
-}
-
-# Outputs message to console and to log
-# Should only be used with errors
-proc ui_noisy_error {message} {
-	puts $message
-	ui_error $message
-}
-
-proc log_message {channel message} {
-	seek $channel 0 end
-	puts $channel $message
-	flush $channel
-}
-
-# Read in configuration file
-proc readConfig {file} {
-	global dpkg::configopts
-
-	set fd [open $file r]
-	while {[gets $fd line] >= 0} {
-		foreach option $configopts {
-			if {[regexp "^$option\[ \t\]+(\[A-Za-z0-9_:,\./-\]+$)" $line match val] == 1} {
-				set dpkg::$option $val
-			}
-		}
-	}
-}
-
-# Read a list of newline seperated port names from $file
-proc readPortList {file} {
-	set fd [open $file r]
-	set portlist ""
-
-	while {[gets $fd line] >= 0} {
-		lappend portlist $line
-	}
-
-	return $portlist
-}
-
-# Escape all regex characters in a portname
-proc regex_escape_portname {portname} {
-	regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" escaped_string
-	return $escaped_string
-}
-
-# Print usage string
-proc print_usage {args} {
-	global argv0
-	puts "Usage: [file tail $argv0] \[-qa\] \[-f configfile\] \[-p portlist\]"
-	puts "	-q	Quiet mode (only errors reported)"
-	puts "	-w	No warnings (progress still reported)"
-	puts "	-a	Build all ports"
-	puts "	-b	Re-generate base install archive"
-	puts "	-p	Attempt to build ports that do not advertise support for the build platform"
-	puts "	-i	Initialize Build System (Should only be run on a new build system)"
-}
-
-# Delete and restore the build system
-proc reset_tree {args} {
-	global dpkg::portprefix dpkg::pkgrepo dpkg::architecture
-
-	ui_silent "Restoring pristine ${portprefix} from ${pkgrepo}/${architecture}/root.tar.gz"
-	if {[catch {system "rm -Rf ${portprefix}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "rm -Rf /etc/X11"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "cd / && tar xvf ${pkgrepo}/${architecture}/root.tar.gz"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	ui_silent "Linking static distfiles directory to ${portprefix}/var/db/dports/distfiles."
-	if {[file isdirectory ${portprefix}/var/db/dports/distfiles"]} {
-		if {[catch {system "rm -rf ${portprefix}/var/db/dports/distfiles"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-
-		if {[catch {system "ln -s ${pkgrepo}/distfiles ${portprefix}/var/db/dports/distfiles"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-	}
-}
-
-proc main {argc argv} {
-	global dpkg::configfile dpkg::pkgrepo dpkg::architecture dpkg::portlistfile
-	global dpkg::portsArray dpkg::portprefix dpkg::silentmode dpkg::logfd dpkg::packagedir dpkg::aptpackagedir
-	global dpkg::requiredports dpkg::baselistfile tcl_platform
-
-	# First time through, we reset the tree
-	set firstrun_flag true
-
-	# Read command line options
-	set buildall_flag false
-	set anyplatform_flag false
-	set nowarn_flag false
-	set basegen_flag false
-	set initialize_flag false
-
-	for {set i 0} {$i < $argc} {incr i} {
-		set arg [lindex $argv $i]
-		switch -- $arg {
-			-a {
-				set buildall_flag true
-			}
-			-b {
-				set basegen_flag true
-			}
-			-f {
-				incr i
-				set configfile [lindex $argv $i]
-
-				if {![file readable $configfile]} {
-					return -code error "Configuration file \"$configfile\" is unreadable."
-				}
-			}
-			-i {
-				set initialize_flag true
-			}
-			-p {
-				incr i
-				set portlistfile [lindex $argv $i]
-				if {![file readable $portlistfile]} {
-					return -code error "Port list file \"$portlistfile\" is unreadable."
-				}
-			}
-			-q {
-				set silentmode true
-			}
-			-w {
-				set nowarn_flag true
-			}
-			-p {
-				set anyplatform_flag true
-			}
-			default {
-				print_usage
-				exit 1
-			}
-		}
-	}
-
-	# Initialize System
-	array set ui_options {}
-	array set options {}
-	array set variations {}
-	dportinit ui_options options variations
-
-	# If -i was specified, install base system and exit
-	if {$initialize_flag == "true"} {
-		initialize_system
-		exit 0
-	}
-
-	# We must have dpkg by now 
-	if {[catch {set_architecture} result]} {
-		puts "$result."
-		puts "Have you initialized the build system? Use the -i flag:"
-		print_usage
-		exit 1
-	}
-
-	# Set the platform
-	set platformString [string tolower $tcl_platform(os)]
-
-	set packagedir ${pkgrepo}/${architecture}/packages/
-	set aptpackagedir ${pkgrepo}/apt/dists/stable/main/binary-${architecture}/
-
-	# Read configuration files
-	if {[file readable $configfile]} {
-		readConfig $configfile
-	}
-
-	# If portlistfile has not been set, supply a reasonable default
-	if {![info exists portlistfile]} {
-		# The default portlist file
-		set portlistfile [file join $pkgrepo $architecture etc buildlist.txt]
-	}
-
-	# If baselistfile has not been set, supply a reasonable default
-	if {![info exists baselistfile]} {
-		# The default baselist file
-		set baselistfile [file join $pkgrepo $architecture etc baselist.txt]
-	}
-
-	# Read the port list
-	if {[file readable $portlistfile]} {
-		set portlist [readPortList $portlistfile]
-	} else {
-		set portlist ""
-	}
-
-	if {[file readable $baselistfile]} {
-		set baselist [readPortList $baselistfile]
-	} else {
-		set baselist ""
-	}
-
-	# If no portlist file was specified, create a portlist that includes all ports
-	if {[llength $portlist] == 0 || "$buildall_flag" == "true"} {
-		set res [dportsearch {.*}]
-		foreach {name array} $res {
-			lappend portlist $name
-		}
-	} else {
-		# Port list was specified. Ensure that all the specified ports are available.
-		# Add ${baselist} and get_required_ports to the list
-		set portlist [lsort -unique [concat $portlist $baselist [get_required_ports]]]
-		foreach port $portlist {
-			set fail false
-
-			if {[catch {set res [get_portinfo $port]} result]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_noisy_error "Error: $result"
-				set fail true
-			}
-
-			# Add all of the specified ports' dependencies to the portlist
-			set dependencies [get_dependencies $port false]
-			foreach dep $dependencies {
-				lappend portlist [lindex $dep 0]
-			}
-		}
-		if {"$fail" == "true"} {
-			exit 1
-		}
-	}
-
-	# Clean out duplicates
-	set portlist [lsort -unique $portlist]
-
-	# Ensure that the log directory exists, and open up
-	# the default debug log
-	open_default_log w
-
-	# Set the dport options
-	# Package build path
-	set options(package.destpath) ${packagedir}
-
-	# Ensure that it exists
-	file mkdir $options(package.destpath)
-
-	# Force mode
-	set options(ports_force) yes
-
-	# Set variations (empty)
-	set variations [list]
-
-
-	if {"$silentmode" != "true" && "$nowarn_flag" != "true"} {
-		puts "WARNING: The full contents of ${portprefix}, /usr/X11R6, and /etc/X11 will be deleted by this script. If you do not want this, control-C NOW."
-		exec sleep 10
-	}
-
-	# Destroy the existing apt repository
-	if {[catch {system "rm -Rf ${aptpackagedir}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	# Recreate
-	file mkdir ${aptpackagedir}
-
-	close_default_log
-
-	foreach port $portlist {
-		# Open the default debug log write/append
-		open_default_log
-
-		if {[catch {set res [get_portinfo $port]} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: port search failed: $error"
-			exit 1
-		}
-
-		# Reset array from previous runs
-		unset -nocomplain portinfo
-		array set portinfo [lindex $res 1]
-
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
-			![info exists portinfo(categories)]} {
-			ui_noisy_error "Internal error: $name missing some portinfo keys"
-			close $logfd
-			continue
-		}
-
-		# Skip un-supported ports
-		if {[info exists portinfo(platforms)] && ${anyplatform_flag} != "true"} {
-			if {[lsearch $portinfo(platforms) $platformString] == -1} {
-				ui_silent "Skipping unsupported port $portinfo(name) (platform: $platformString supported: $portinfo(platforms))"
-				continue
-			}
-		}
-
-
-		# Add apt override line. dpkg is special cased and marked 'required'
-		# TODO: add the ability to specify the "required" priority for specific
-		# ports in a config file.
-		if {"$portinfo(name)" == "dpkg"} {
-			set pkg_priority required
-		} else {
-			set pkg_priority optional
-		}
-		add_override $portinfo(name) $pkg_priority [lindex $portinfo(categories) 0]
-
-		# Skip up-to-date software
-		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-		if {[file exists ${pkgfile}]} {
-			if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-				if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-					ui_silent "Skipping ${portinfo(name)}-${portinfo(version)}-${portinfo(revision)}; package is up to date."
-					# Shove the package into the apt repository
-					copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-					continue
-				}
-			}
-		}
-
-		# We're going to actually build the package, reset the tree
-		# if this is our first time through. The tree is always reset
-		# at the end of a packaging run, too.
-		if {$firstrun_flag == true} {
-			reset_tree
-			set firstrun_flag false
-		}
-
-		ui_silent "Building $portinfo(name) ..."
-
-		# Close the main debug log
-		close_default_log
-
-		# Create log directory and open the build log
-		file mkdir [file join ${pkgrepo} ${architecture} log build ${port}]
-		set logfd [open ${pkgrepo}/${architecture}/log/build/${port}/build.log w 0644]
-
-		# Install binary dependencies if possible
-		set dependencies [get_dependencies $portinfo(name)]
-		foreach dep $dependencies {
-			install_binary_if_available $dep
-		}
-
-		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: unable to open port: $result"
-			exit 1
-		}
-
-		if {[catch {set result [dportexec $workername clean]} result] || $result == 1} {
-			ui_noisy_error "Cleaning $portinfo(name) failed, consult build log"
-
-			# Close the log
-			close $logfd
-
-			# Copy the log to the failure directory
-			copy_failure_log $portinfo(name)
-
-			# Close the port
-			dportclose $workername
-
-			continue
-		}
-
-		# Re-open the port. DarwinPorts doesn't play well with multiple targets, apparently
-		dportclose $workername
-		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: unable to open port: $result"
-			exit 1
-		}
-
-		if {[catch {set result [dportexec $workername dpkg]} result] || $result == 1} {
-			ui_noisy_error "Packaging $portinfo(name) failed, consult build log"
-
-			# Copy the log to the failure directory
-			copy_failure_log $portinfo(name)
-
-			# Close the port
-			dportclose $workername
-
-			# Close the log
-			close $logfd
-
-			# Open default log
-			open_default_log
-
-			ui_silent "Resetting /usr/dports ..."
-			reset_tree
-			ui_silent "Done."
-
-			# Close the log
-			close $logfd
-
-			continue
-		}
-
-		ui_silent "Package build for $portinfo(name) succeeded"
-		
-		# Into the apt repository you go!
-		copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-
-		ui_silent "Resetting /usr/dports ..."
-		reset_tree
-		ui_silent "Done."
-
-		# Close the log
-		close $logfd
-
-		# Delete any previous failure logs
-		delete_failure_log $portinfo(name)
-
-		# Close the port
-		dportclose $workername
-	}
-
-	open_default_log
-
-	# If required, rebuild the clientinstall.tgz
-	if {$basegen_flag == true} {
-		# dpkg is always required
-		set pkglist [lsort -unique [concat dpkg $baselist [get_required_ports]]]
-		set workdir [file join ${pkgrepo} ${architecture}]
-		set rootdir [file join $workdir clientroot]
-		set rootfile [file join $workdir client-root.tar.gz]
-		file mkdir ${rootdir}
-
-		# dpkg is required
-		array set portinfo [lindex [get_portinfo dpkg] 1]
-		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-		system "cd \"${rootdir}\" && ar x \"${pkgfile}\" data.tar.gz"
-		system "cd \"${rootdir}\" && tar xvf data.tar.gz; rm data.tar.gz"
-
-		foreach port $pkglist {
-			set dependencies [get_dependencies $port false]
-			foreach dep $dependencies {
-				lappend newpkglist [lindex $dep 0]
-			}
-		}
-
-		if {[info exists newpkglist]} {		
-			set pkglist [lsort -unique [concat $newpkglist $pkglist]]
-		}
-
-		foreach port $pkglist {
-			array set portinfo [lindex [get_portinfo $port] 1]
-			system "dpkg --root \"${rootdir}\" --force-depends -i \"[get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]\""
-		}
-
-		system "cd \"${rootdir}\" && tar cf \"[file join ${workdir} clientinstall.tar.gz]\" ."
-		file delete -force ${rootdir}
-	}
-
-	ui_silent "Building apt-get index ..."
-	if {[catch {system "cd ${pkgrepo}/apt && dpkg-scanpackages dists override >${aptpackagedir}/Packages"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "cd ${aptpackagedir} && gzip Packages"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-	remove_override_file
-	ui_silent "Done."
-
-	ui_silent "Package run finished."
-	close_default_log
-
-	exit 0
-}
-
-# Return ports listed in $dpkg::requiredports that are not
-# installed
-proc get_required_ports {args} {
-	global dpkg::requiredports
-	set reqlist ""
-
-	foreach {binary port} $requiredports {
-		if {[find_binary $binary] == ""} {
-			lappend reqlist $port
-		}
-	}
-	return $reqlist
-}
-
-# Given a binary name, searches PATH
-proc find_binary {binary} {
-	global env
-	set path [split $env(PATH) :]
-	foreach dir $path {
-		set file [file join $dir $binary]
-		if {[file exists $file]} {
-			return $file
-		}
-	}
-	return ""
-}
-
-# Set the architecture global
-proc set_architecture {args} {
-	set dpkg::architecture "[exec dpkg --print-installation-architecture]"
-}
-
-# Initialize a new build system
-proc initialize_system {args} {
-	global dpkg::initialports dpkg::pkgrepo
-	global dpkg::architecture dpkg::portprefix
-
-	# Create standard directories
-	ui_msg "Creating ${pkgrepo} directory"
-	file mkdir ${pkgrepo}
-
-	set builddeps ""
-	set rundeps ""
-
-	foreach port [get_required_ports] {
-		set builddeps [concat $builddeps [get_dependencies $port true]]
-		set rundeps [concat $rundeps [get_dependencies $port false]]
-	}
-
-	set buildlist [lsort -unique $builddeps]
-
-	foreach port $builddeps {
-		if {[lsearch -exact $port $rundeps] >= 0 } {
-			lappend removelist $port
-		}
-	}
-
-	set options ""
-	set variations ""
-
-	foreach port [get_required_ports] {
-		if {[catch {do_portexec $port [array get options] [array get variants] install} result]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Fatal error: $result"
-			exit 1
-		}
-	}
-
-	if {[info exists removelist]} {
-		ui_msg "Removing build dependencies ..."
-		foreach portlist $removelist {
-			set port [lindex $portlist 0]
-
-			ui_msg "Uninstalling $port."
-			if { [catch {portuninstall::uninstall $portname $portversion} result] } {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_noisy_errorr "Fatal error: Uninstalling $port failed: $result"
-				exit 1
-			}
-		}
-		ui_msg "Done."
-	}
-			
-
-	if {[catch {set_architecture} result]} {
-		puts "Fatal error: $result."
-		exit 1
-	}
-
-	ui_msg "Creating [file join ${pkgrepo} ${architecture}] directory"
-	file mkdir [file join ${pkgrepo} ${architecture}]
-	file mkdir [file join ${pkgrepo} ${architecture} etc]
-
-	ui_msg "Generating pristine archive: [file join ${pkgrepo} ${architecture} root.tar.gz]"
-	if {[catch {system "tar -zcf \"[file join ${pkgrepo} ${architecture} root.tar.gz]\" \"${portprefix}\""} result]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Fatal error: Archive creation failed: $result"
-		exit 1
-	}
-
-	ui_msg "Build system successfully initialized!"
-}
-
-# Execute a target on a port (by port name)
-proc do_portexec {port options variants target} {
-
-	array set portinfo [lindex [get_portinfo $port] 1]
-
-	if {[catch {set workername [dportopen $portinfo(porturl) $options $variants yes]} result] || $result == 1} {
-		return -code error "Internal error: unable to open port: $result"
-		exit 1
-	}
-
-	if {[catch {set result [dportexec $workername install]} result] || $result == 1} {
-
-		# Close the port
-		dportclose $workername
-
-		# Return error
-		return -code error "Executing target $target on $portinfo(name) failed."
-	}
-}
-
-proc get_portinfo {port} {
-	set searchstring [regex_escape_portname $port]
-	set res [dportsearch "^${searchstring}\$"]
-
-	if {[llength $res] < 2} {
-		return -code error "Port \"$port\" not found in index."
-	}
-
-	return $res
-}
-
-# Given name, version, and revision, returns the path to a package file
-proc get_pkgpath {name version revision} {
-	global dpkg::pkgrepo dpkg::architecture
-	global dpkg::packagedir
-	if {${revision} == 0} {
-		set revision ""
-	} else {
-		set revision "-${revision}"
-	}
-
-	return [string tolower ${packagedir}/${name}_${version}${revision}_${architecture}.deb]
-}
-
-# Opens the default log file and sets dpkg::logfd
-proc open_default_log {{mode a}} {
-	global dpkg::pkgrepo dpkg::architecture dpkg::logfd
-	# Ensure that the log directory exists, and open up
-	# the default debug log
-	file mkdir ${pkgrepo}/${architecture}/log/
-	set logfd [open ${pkgrepo}/${architecture}/log/debug.log ${mode} 0644]
-}
-
-# Closes the current logfile
-proc close_default_log {args} {
-	global dpkg::logfd
-	close $logfd
-}
-
-# Copies a port log file to the failure directory
-proc copy_failure_log {name} {
-	global dpkg::pkgrepo dpkg::architecture
-	# Copy the log to the failure log directory
-	file mkdir ${pkgrepo}/${architecture}/log/failure/${name}
-	file copy -force ${pkgrepo}/${architecture}/log/build/${name}/build.log ${pkgrepo}/${architecture}/log/failure/${name}/
-}
-
-# Deletes a port's failure log
-proc delete_failure_log {name} {
-	global dpkg::pkgrepo dpkg::architecture
-	if {[catch {system "rm -Rf ${pkgrepo}/${architecture}/log/failure/${name}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-}
-
-# Add an override entry to the apt override file
-proc add_override {name priority section {maintainer ""}} {
-	global dpkg::aptpackagedir dpkg::pkgrepo
-	set output "${name}	${priority}	${section}"
-	if {${maintainer} != ""} {
-		append output " ${maintainer}"
-	}
-	set fd [open "${pkgrepo}/apt/override" a 0644]
-	puts $fd $output
-	close $fd
-}
-
-# Deletes the apt override file
-proc remove_override_file {args} {
-	global dpkg::aptpackagedir dpkg::pkgrepo
-	if {[catch {file delete -force ${pkgrepo}/apt/override} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-}
-
-# Copies a given package to the apt repository
-proc copy_pkg_to_apt {name version revision category} {
-	global dpkg::aptpackagedir
-
-	set pkgfile [get_pkgpath $name $version $revision]
-	file mkdir $aptpackagedir/main/$category
-	file link -hard $aptpackagedir/main/$category/[file tail $pkgfile] $pkgfile
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname {includeBuildDeps "true"}} {
-	set result [get_dependencies_recurse $portname $includeBuildDeps]
-	return [lsort -unique $result]
-}
-
-proc get_dependencies_recurse {portname includeBuildDeps} {
-	set result {}
-	
-	set res [get_portinfo $portname]
-
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-
-		lappend result [list $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies_recurse $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-	global dpkg::architecture dpkg::pkgrepo dpkg::portprefix
-
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set portrevision [lindex $dep 2]
-	set category [lindex $dep 3]
-
-	if {${portrevision} != ""} {
-		set verstring ${portversion}_${portrevision}
-	} else {
-		set verstring ${portversion}
-	}
-	
-	set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
-	set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
-
-	# Check if the package is available, and ensure that it has not already been
-	# installed through darwinports (bootstrap packages such as dpkg and its
-	# dependencies are always installed)
-	if {[file readable $pkgpath] && ![file exists $receiptdir/receipt.bz2]} {
-		ui_silent "Installing binary: $pkgpath"
-		if {[catch {system "dpkg --force-depends -i ${pkgpath}"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-		# Touch the receipt
-		file mkdir $receiptdir
-		if {[catch {system "touch [file join $receiptdir receipt.bz2]"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-	}
-}
-
-### main() entry point ####
-main $argc $argv

Deleted: trunk/base/portmgr/mpkgall.tcl
===================================================================
--- trunk/base/portmgr/mpkgall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/mpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,336 +0,0 @@
-#!/usr/bin/env tclsh
-# mpkgall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-array set ui_options {}
-
-proc ui_prefix {priority} {
-	return ""
-}
-
-proc ui_channels {priority} {
-	return {}
-}
-
-# copy binary packages if they've already been built.
-
-proc copy_package_if_available {portname basepath destpath} {
-
-	set dependencies {}
-
-	# XXX: don't overwrite Apple X11
-	# XXX: probably should exclude KDE here too
-	if {$portname == "XFree86"} { return {} }
-	
-	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
-		puts stderr "Internal error: port search failed: $error"
-		return
-	}
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)]} { return -1 }
-		if {![info exists portinfo(version)]} { return -1 }
-		if {![info exists portinfo(categories)]} { return -1 }
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set category [lindex $portinfo(categories) 0]
-		
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set result [copy_package_if_available $dep $basepath $destpath]
-			if {$result == -1} { 
-				return -1
-			} else {
-				eval "lappend dependencies $result"
-			}
-		}
-		
-		set pkgname "${portname}-${portversion}.pkg"
-		lappend dependencies $pkgname
-		set pkgpath "${basepath}/${category}/${pkgname}"
-		if {[file readable "${pkgpath}/Contents/Info.plist"]} {
-			puts stderr "copying package: ${pkgpath} to ${destpath}"
-			if {[catch {system "cp -R ${pkgpath} ${destpath}/"} error]} {
-				puts stderr "Internal error: $error"
-			}
-		} else {
-			puts stderr "package ${pkgname} not found"
-			return -1
-		}
-	}
-	
-	return $dependencies
-}
-
-proc write_description_plist {infofile portname portversion description} {
-	set infofd [open ${infofile} w+]
-	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-}
-	puts $infofd "<dict>
-	<key>IFPkgDescriptionDeleteWarning</key>
-	<string></string>
-	<key>IFPkgDescriptionDescription</key>
-	<string>${description}</string>
-	<key>IFPkgDescriptionTitle</key>
-	<string>${portname}</string>
-	<key>IFPkgDescriptionVersion</key>
-	<string>${portversion}</string>
-</dict>
-</plist>"
-	close $infofd
-}
-
-proc write_welcome_html {filename portname portversion long_description description homepage} {
-    set fd [open ${filename} w+]
-    if {$long_description == ""} {
-	set long_description $description
-    }
-
-puts $fd "
-<html lang=\"en\">
-<head>
-	<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">
-	<title>Install ${portname}</title>
-</head>
-<body>
-<font face=\"Helvetica\"><b>Welcome to the ${portname} for Mac OS X Installer</b></font>
-<p>
-<font face=\"Helvetica\">${long_description}</font>
-<p>"
-
-    if {$homepage != ""} {
-	puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
-    }
-
-    puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
-</body>
-</html>"
-
-    close $fd
-}
-
-proc write_PkgInfo {infofile} {
-	set infofd [open ${infofile} w+]
-	puts $infofd "pmkrpkg1"
-	close $infofd
-}
-
-proc mpkg_write_info_plist {infofile portname portversion portrevision destination dependencies} {
-	set vers [split $portversion "."]
-	
-	if {[string index $destination end] != "/"} {
-		append destination /
-	}
-	
-	set depxml ""
-	foreach dep $dependencies {
-		append depxml "<dict>
-			<key>IFPkgFlagPackageLocation</key>
-			<string>${dep}</string>
-			<key>IFPkgFlagPackageSelection</key>
-			<string>selected</string>
-		</dict>
-		"
-	}
-
-	set infofd [open ${infofile} w+]
-	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-}
-	puts $infofd "<dict>
-	<key>CFBundleGetInfoString</key>
-	<string>${portname} ${portversion}</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.opendarwin.darwinports.mpkg.${portname}</string>
-	<key>CFBundleName</key>
-	<string>${portname}</string>
-	<key>CFBundleShortVersionString</key>
-	<string>${portversion}</string>
-	<key>IFMajorVersion</key>
-	<integer>${portrevision}</integer>
-	<key>IFMinorVersion</key>
-	<integer>0</integer>
-	<key>IFPkgFlagComponentDirectory</key>
-	<string>./Contents/Resources</string>
-	<key>IFPkgFlagPackageList</key>
-	<array>
-		${depxml}</array>
-	<key>IFPkgFormatVersion</key>
-	<real>0.10000000149011612</real>
-</dict>
-</plist>"
-	close $infofd
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-#	set ui_options(ports_verbose) yes
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-        lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-foreach {name array} $res {
-	global prefix
-	array unset portinfo
-	array set portinfo $array
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase "/darwinports/pkgs/"
-	set mpkgbase "/darwinports/mpkgs/"
-	set porturl $portinfo(porturl)
-	set prefix "/opt/local"
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
-			if {[file readable $mpkgfile] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
-				continue
-			}
-		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the mpkg:
-	# - create an mpkg skeleton
-	# - copy dependent pkgs into Contents/Resources directory
-
-	set portname ""
-	set portversion ""
-	set description ""
-	set long_description ""
-	set homepage ""
-	set category ""
-
-	if {[info exists portinfo(name)]} {	set portname $portinfo(name) }
-	if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
-	if {[info exists portinfo(description)]} { set description $portinfo(description) }
-	if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
-	if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
-	if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
-	if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
-	
-	puts "meta-packaging ${category}/${portname}-${portversion}"
-
-	set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
-
-	if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	
-	# list of .pkg names for dependencies,
-	# built up by copy_package_if_available, and used in the Info.plist
-	set dependencies {}
-	set result [copy_package_if_available ${portname} $pkgbase "${mpkgpath}/Contents/Resources/"]
-	if {$result == -1} {
-		puts stderr "aborting; one or more dependencies was missing."
-		if {[catch {system "rm -R ${mpkgpath}"} error]} {
-			puts stderr "Internal error: $error"
-		}
-		continue
-	} else {
-		set result [lsort -uniq $result]
-		eval "lappend dependencies $result"
-	}
-	
-	#
-	# Begin quote from portmpkg.tcl
-	#
-    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
-    mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
-    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage} {
-	if {![info exists $variable]} {
-	    set pkg_$variable ""
-	} else {
-	    set pkg_$variable [set $variable]
-	}
-    }
-    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
-    file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
-			${mpkgpath}/Contents/Resources/background.tiff
-	#
-	# End quote from portmpkg.tcl
-	#
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/mprsyncup.new (from rev 26176, branches/dp2mp-move/base/portmgr/mprsyncup.new)
===================================================================
--- trunk/base/portmgr/mprsyncup.new	                        (rev 0)
+++ trunk/base/portmgr/mprsyncup.new	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,90 @@
+#!/bin/sh
+####
+# Script to checkout/update base sources from both trunk (ToT) and the current
+# release tag (as determined by the base/config/RELEASE_URL file) and a ports
+# tree from trunk (ToT), and then export and sync all of them to the
+# ${REPOROOT} location, wherefrom the rsync modules are fed to the `sync'
+# and `selfupdate' routines in port(1).
+# Read the base/portmgr/rsync.repos file for more information on both the
+# necessary rsync modules and filesystem level paths, which this script
+# bootstraps.
+#
+# Created by fkr at opendarwin.org, jberry at macports.org and yeled at macports.org,
+# Updated by jmpp at macports.org
+# $Id$
+####
+
+set -e
+
+# Commands we need:
+SVN="/opt/local/bin/svn -q --non-interactive"
+RSYNC="/usr/bin/rsync -q"
+
+# Paths we'll work on:
+SVNROOT=/tmp/macports
+TBASE=${SVNROOT}/trunk/base
+RBASE=${SVNROOT}/release/base
+PORTS=${SVNROOT}/release/ports
+RSYNCROOT=/Volumes/data/rsync/macports
+
+# Sources information:
+SVNURL=http://svn.macports.org/repository/macports
+RELEASE_URL_FILE=config/RELEASE_URL
+
+
+# Update/checkout trunk's base, export and rsync it to the rsync repos location (${REPOROOT}):
+if [ -d ${TBASE}/.svn ]; then
+    ${SVN} update ${TBASE}
+else
+    ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
+fi
+${SVN} export ${TBASE} ${TBASE}-export
+if [ ! -d ${RSYNCROOT}/trunk/base ]; then
+    mkdir -p ${RSYNCROOT}/trunk
+fi
+${RSYNC} -a -I --delete ${TBASE}-export/ ${RSYNCROOT}/trunk/base && rm -rf ${TBASE}-export
+
+
+# Read what tag we're releasing from, switch to/checkout a copy, export and rsync it to ${REPOROOT}/release/base:
+read RELEASE_URL < ${TBASE}/${RELEASE_URL_FILE}
+if [ ! -n ${RELEASE_URL} ]; then
+    echo "no RELEASE_URL specified in svn trunk, baling out"
+    exit 1
+fi
+if [ -d ${RBASE}/.svn ]; then
+    ${SVN} switch ${RELEASE_URL} ${RBASE}
+else
+    ${SVN} checkout ${RELEASE_URL} ${RBASE}
+fi
+${SVN} export ${RBASE} ${RBASE}-export
+if [ ! -d ${RSYNCROOT}/release/base ]; then
+    mkdir -p ${RSYNCROOT}/release/base
+fi
+${RSYNC} -a -I --delete ${RBASE}-export/ ${RSYNCROOT}/release/base && rm -rf ${RBASE}-export
+
+
+# Update/checkout the ports tree, export it and rsync it to ${REPOROOT}/release/ports:
+if [ -d ${PORTS}/.svn ]; then
+  ${SVN} update ${PORTS}  
+else
+    ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
+fi
+${SVN} export ${PORTS} ${PORTS}-export
+if [ ! -d ${RSYNCROOT}/release/ports ]; then
+    mkdir -p ${RSYNCROOT}/release/ports
+fi
+${RSYNC} -a -I --delete ${PORTS}-export/ ${RSYNCROOT}/release/ports && rm -rf ${PORTS}-export
+
+
+# Compatibility checks:
+cd ${RSYNCROOT}
+if [ ! -h dpupdate ]; then
+    rm -rf dpupdate && ln -s trunk dpupdate
+fi
+if [ ! -h dpupdate1 ]; then
+    rm -rf dpupdate1 && ln -s release dpupdate1
+fi
+if [ ! -h trunk/dports ]; then
+    cd trunk
+    rm -rf dports && ln -s ../release/ports dports
+fi

Deleted: trunk/base/portmgr/packageall.tcl
===================================================================
--- trunk/base/portmgr/packageall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packageall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,421 +0,0 @@
-#!/usr/bin/env tclsh
-# packageall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-
-# UI Instantiations
-array set ui_options {}
-# ui_options(ports_debug) - If set, output debugging messages.
-# ui_options(ports_verbose) - If set, output info messages (ui_info)
-# ui_options(ports_quiet) - If set, don't output "standard messages"
-
-# ui_options accessor
-proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) == "yes"} {
-	    return 1
-	}
-    }
-    return 0
-}
-
-# UI Callback 
-
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
-			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
-			}
-		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
-			} else {
-				return {stdout}
-			}
-		}
-        default {
-        	return {stdout}
-        }
-    }
-}
-	
-proc pkg_ui_log {message} {
-    global logfd
-    if {[string length $logfd] > 0 } {
-	log_message $logfd $message
-    }
-}
-
-proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname includeBuildDeps} {
-	set result {}
-	
-	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Internal error: port search failed: $error"
-		return {}
-	}
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set category [lindex $portinfo(categories) 0]
-
-		# Append the package itself to the result list
-		#set pkgpath ${category}/${portname}-${portversion}.pkg
-		lappend result [list $portname $portversion $category]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep basepath} {
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set category [lindex $dep 2]
-	
-	set pkgpath ${basepath}/${category}/${portname}-${portversion}.pkg
-	if {[file readable $pkgpath]} {
-		ui_msg "installing binary: $pkgpath"
-		if {[catch {system "cd / && gunzip -c ${pkgpath}/Contents/Archive.pax.gz | pax -r"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Internal error: $error"
-		}
-		# Touch the receipt
-		# xxx: use some variable to describe this path
-		if {[catch {system "touch /opt/local/var/db/dports/receipts/${portname}-${portversion}.bz2"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Internal error: $error"
-		}
-	}
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-#	set ui_options(ports_verbose) yes
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-	lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-set logpath "/darwinports/logs"
-set logfd ""
-
-foreach {name array} $res {
-	array unset portinfo
-	array set portinfo $array
-
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt from getting logged.
-	set ui_options(ports_verbose) no
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase /darwinports/pkgs/
-	set porturl $portinfo(porturl)
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
-			if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; package is up to date."
-				continue
-			}
-		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the port:
-	# - remove /opt so it won't pollute the port.
-	# - re-install DarwinPorts.
-	# - keep distfiles outside /opt so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
-
-	ui_msg "removing /opt"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/X11"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/fonts"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
-
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {[string length $logfd] > 0} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
-
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
-
-	set valid 1
-
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
-
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The DarwinPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
-
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
-		}
-	}
-
-	ui_msg "packaging ${category}/${portname}-${portversion}"
-
-	# Install binary dependencies if we can, to speed things up.
-	#set depends {}
-	#if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-	#if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-	#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-	#foreach depspec $depends {
-	#	set dep [lindex [split $depspec :] end]
-		#install_binary_if_available $dep $pkgbase
-	#}
-	set dependencies [get_dependencies $portname 1]
-	set dependencies [lsort -unique $dependencies]
-	foreach dep $dependencies {
-		install_binary_if_available $dep $pkgbase
-	}
-
-	set options(package.type) pkg
-	set options(package.destpath) ${pkgbase}/${category}/
-
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	if {[catch {set workername [dportopen $porturl [array get options] [array get variations] yes]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}	
-	if {[catch {set result [dportexec $workername pkg]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
-		dportclose $workername
-	    continue
-	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
-
-	dportclose $workername
-
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/packaging (from rev 26176, branches/dp2mp-move/base/portmgr/packaging)

Deleted: trunk/base/portmgr/packaging/PortIndex2MySQL.tcl
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/PortIndex2MySQL.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/PortIndex2MySQL.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,214 +0,0 @@
-#!/usr/bin/env tclsh
-# PortIndex2MySQL.tcl
-# Kevin Van Vechten | kevin at opendarwin.org
-# 3-Oct-2002
-# $Id$
-#
-# Copyright (c) 2003 Apple Computer, Inc.
-# Copyright (c) 2002 Kevin Van Vechten. 
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-catch {source \
-	   [file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
-package require darwinports
-
-proc ui_prefix {priority} {
-	return ""
-}
-
-proc ui_channels {priority} {
-	return {}
-}
-
-# This should be a command line argument.
-# if true, use_db insructs the script to insert directly into a database
-# otherwise, sql statements will be printed to stdout.
-set use_db ""
-
-array set ui_options {}
-array set global_options {}
-array set global_variations {}
-dportinit ui_options global_options global_variations
-
-if {$use_db != ""} {
-    load @PREFIX@/lib/libmysqltcl.dylib
-    set db [mysqlconnect -user darwinports -password woot -db darwinports]
-} else {
-    set db ""
-}
-
-proc sql_exec {db sql} {
-    if {$db != ""} {
-        mysqlexec $db $sql
-    } else {
-        puts "${sql};"
-    }
-}
-
-proc sql_escape {str} {
-    global use_db
-    if {$use_db != ""} {
-        return [msyqlescape $str]
-    } else {
-        regsub -all -- {'} $str {\\'} str
-        regsub -all -- {"} $str {\\"} str
-        regsub -all -- {\n} $str {\\n} str
-        return $str
-    }
-}
-
-# CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, 
-#  path VARCHAR(255),
-#  version VARCHAR(255),
-#  description TEXT);
-
-# CREATE TABLE categories (portfile VARCHAR(255), 
-#  category VARCHAR(255), 
-#  primary INTEGER);
-
-# CREATE TABLE maintainers (portfile VARCHAR(255),
-#  maintainer VARCHAR(255),
-#  primary INTEGER);
-
-sql_exec $db "DROP TABLE log"
-sql_exec $db "CREATE TABLE IF NOT EXISTS log (activity VARCHAR(255), activity_time TIMESTAMP(14))"
-sql_exec $db "INSERT INTO log VALUES ('update', NOW())"
-
-sql_exec $db "DROP TABLE portfiles"
-sql_exec $db "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255),  description TEXT)"
-
-sql_exec $db "DROP TABLE IF EXISTS categories"
-sql_exec $db "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER)"
-
-sql_exec $db "DROP TABLE IF EXISTS maintainers"
-sql_exec $db "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER)"
-
-sql_exec $db "DROP TABLE IF EXISTS dependencies"
-sql_exec $db "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255))"
-
-sql_exec $db "DROP TABLE IF EXISTS variants"
-sql_exec $db "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255))"
-
-sql_exec $db "DROP TABLE IF EXISTS platforms"
-sql_exec $db "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255))"
-
-if {[catch {set ports [dportsearch ".+"]} errstr]} {
-	puts "port search failed: $errstr"
-	exit 1
-}
-
-foreach {name array} $ports {
-	array unset portinfo
-	array set portinfo $array
-	set portname [sql_escape $portinfo(name)]
-	if {[info exists portinfo(version)]} {
-		set portversion [sql_escape $portinfo(version)]
-	} else {
-		set portversion ""
-	}
-	set portdir [sql_escape $portinfo(portdir)]
-	if {[info exists portinfo(description)]} {
-		set description [sql_escape $portinfo(description)]
-	} else {
-		set description ""
-	}
-	if {[info exists portinfo(categories)]} {
-		set categories $portinfo(categories)
-	} else {
-		set categories ""
-	}
-	if {[info exists portinfo(maintainers)]} {
-		set maintainers $portinfo(maintainers)
-	} else {
-		set maintainers ""
-	}
-	if {[info exists portinfo(variants)]} {
-		set variants $portinfo(variants)
-	} else {
-		set variants ""
-	}
-	if {[info exists portinfo(depends_lib)]} {
-		set depends_lib $portinfo(depends_lib)
-	} else {
-		set depends_lib ""
-	}
-	if {[info exists portinfo(platforms)]} {
-		set platforms $portinfo(platforms)
-	} else {
-		set platforms ""
-	}
-		
-	set sql "INSERT INTO portfiles VALUES ('$portname', '$portdir', '$portversion', '$description')"
-	#puts "$sql"
-	sql_exec $db $sql
-
-	set primary 1
-	foreach category $categories {
-		set category [sql_escape $category]
-		set sql "INSERT INTO categories VALUES ('$portname', '$category', $primary)"
-		#puts "$sql"
-		sql_exec $db $sql
-		set primary 0
-	}
-	
-	set primary 1
-	foreach maintainer $maintainers {
-		set maintainer [sql_escape $maintainer]
-		set sql "INSERT INTO maintainers VALUES ('$portname', '$maintainer', $primary)"
-		#puts "$sql"
-		sql_exec $db $sql
-		set primary 0
-	}
-
-	foreach lib $depends_lib {
-		set lib [sql_escape $lib]
-		set sql "INSERT INTO dependencies VALUES ('$portname', '$lib')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-	foreach variant $variants {
-		set variant [sql_escape $variant]
-		set sql "INSERT INTO variants VALUES ('$portname', '$variant')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-	foreach platform $platforms {
-		set platform [sql_escape $platform]
-		set sql "INSERT INTO platforms VALUES ('$portname', '$platform')"
-		#puts "$sql"
-		sql_exec $db $sql
-	}
-
-}
-
-if {$db != ""} {
-    mysqlclose $db
-    mysqlclose
-}

Copied: trunk/base/portmgr/packaging/PortIndex2MySQL.tcl (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/PortIndex2MySQL.tcl)
===================================================================
--- trunk/base/portmgr/packaging/PortIndex2MySQL.tcl	                        (rev 0)
+++ trunk/base/portmgr/packaging/PortIndex2MySQL.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,214 @@
+#!/usr/bin/env tclsh
+# PortIndex2MySQL.tcl
+# Kevin Van Vechten | kevin at opendarwin.org
+# 3-Oct-2002
+# $Id$
+#
+# Copyright (c) 2003 Apple Computer, Inc.
+# Copyright (c) 2002 Kevin Van Vechten. 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+catch {source \
+	   [file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
+package require darwinports
+
+proc ui_prefix {priority} {
+	return ""
+}
+
+proc ui_channels {priority} {
+	return {}
+}
+
+# This should be a command line argument.
+# if true, use_db insructs the script to insert directly into a database
+# otherwise, sql statements will be printed to stdout.
+set use_db ""
+
+array set ui_options {}
+array set global_options {}
+array set global_variations {}
+dportinit ui_options global_options global_variations
+
+if {$use_db != ""} {
+    load @PREFIX@/lib/libmysqltcl.dylib
+    set db [mysqlconnect -user darwinports -password woot -db darwinports]
+} else {
+    set db ""
+}
+
+proc sql_exec {db sql} {
+    if {$db != ""} {
+        mysqlexec $db $sql
+    } else {
+        puts "${sql};"
+    }
+}
+
+proc sql_escape {str} {
+    global use_db
+    if {$use_db != ""} {
+        return [msyqlescape $str]
+    } else {
+        regsub -all -- {'} $str {\\'} str
+        regsub -all -- {"} $str {\\"} str
+        regsub -all -- {\n} $str {\\n} str
+        return $str
+    }
+}
+
+# CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, 
+#  path VARCHAR(255),
+#  version VARCHAR(255),
+#  description TEXT);
+
+# CREATE TABLE categories (portfile VARCHAR(255), 
+#  category VARCHAR(255), 
+#  primary INTEGER);
+
+# CREATE TABLE maintainers (portfile VARCHAR(255),
+#  maintainer VARCHAR(255),
+#  primary INTEGER);
+
+sql_exec $db "DROP TABLE log"
+sql_exec $db "CREATE TABLE IF NOT EXISTS log (activity VARCHAR(255), activity_time TIMESTAMP(14))"
+sql_exec $db "INSERT INTO log VALUES ('update', NOW())"
+
+sql_exec $db "DROP TABLE portfiles"
+sql_exec $db "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255),  description TEXT)"
+
+sql_exec $db "DROP TABLE IF EXISTS categories"
+sql_exec $db "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER)"
+
+sql_exec $db "DROP TABLE IF EXISTS maintainers"
+sql_exec $db "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER)"
+
+sql_exec $db "DROP TABLE IF EXISTS dependencies"
+sql_exec $db "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255))"
+
+sql_exec $db "DROP TABLE IF EXISTS variants"
+sql_exec $db "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255))"
+
+sql_exec $db "DROP TABLE IF EXISTS platforms"
+sql_exec $db "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255))"
+
+if {[catch {set ports [dportsearch ".+"]} errstr]} {
+	puts "port search failed: $errstr"
+	exit 1
+}
+
+foreach {name array} $ports {
+	array unset portinfo
+	array set portinfo $array
+	set portname [sql_escape $portinfo(name)]
+	if {[info exists portinfo(version)]} {
+		set portversion [sql_escape $portinfo(version)]
+	} else {
+		set portversion ""
+	}
+	set portdir [sql_escape $portinfo(portdir)]
+	if {[info exists portinfo(description)]} {
+		set description [sql_escape $portinfo(description)]
+	} else {
+		set description ""
+	}
+	if {[info exists portinfo(categories)]} {
+		set categories $portinfo(categories)
+	} else {
+		set categories ""
+	}
+	if {[info exists portinfo(maintainers)]} {
+		set maintainers $portinfo(maintainers)
+	} else {
+		set maintainers ""
+	}
+	if {[info exists portinfo(variants)]} {
+		set variants $portinfo(variants)
+	} else {
+		set variants ""
+	}
+	if {[info exists portinfo(depends_lib)]} {
+		set depends_lib $portinfo(depends_lib)
+	} else {
+		set depends_lib ""
+	}
+	if {[info exists portinfo(platforms)]} {
+		set platforms $portinfo(platforms)
+	} else {
+		set platforms ""
+	}
+		
+	set sql "INSERT INTO portfiles VALUES ('$portname', '$portdir', '$portversion', '$description')"
+	#puts "$sql"
+	sql_exec $db $sql
+
+	set primary 1
+	foreach category $categories {
+		set category [sql_escape $category]
+		set sql "INSERT INTO categories VALUES ('$portname', '$category', $primary)"
+		#puts "$sql"
+		sql_exec $db $sql
+		set primary 0
+	}
+	
+	set primary 1
+	foreach maintainer $maintainers {
+		set maintainer [sql_escape $maintainer]
+		set sql "INSERT INTO maintainers VALUES ('$portname', '$maintainer', $primary)"
+		#puts "$sql"
+		sql_exec $db $sql
+		set primary 0
+	}
+
+	foreach lib $depends_lib {
+		set lib [sql_escape $lib]
+		set sql "INSERT INTO dependencies VALUES ('$portname', '$lib')"
+		#puts "$sql"
+		sql_exec $db $sql
+	}
+
+	foreach variant $variants {
+		set variant [sql_escape $variant]
+		set sql "INSERT INTO variants VALUES ('$portname', '$variant')"
+		#puts "$sql"
+		sql_exec $db $sql
+	}
+
+	foreach platform $platforms {
+		set platform [sql_escape $platform]
+		set sql "INSERT INTO platforms VALUES ('$portname', '$platform')"
+		#puts "$sql"
+		sql_exec $db $sql
+	}
+
+}
+
+if {$db != ""} {
+    mysqlclose $db
+    mysqlclose
+}

Deleted: trunk/base/portmgr/packaging/SETUP.chroot.sh
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/SETUP.chroot.sh	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/SETUP.chroot.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,39 +0,0 @@
-# !/bin/sh
-
-# DarwinPorts chrooted automated build system setup.
-# kevin at opendarwin.org
-# 21-Feb-2003
-
-# This should be run as uid 0, gid 0 from within the chroot.
-
-# Set up some necessary environment variables.
-
-export PATH=/opt/local/bin:/usr/X11R6/bin:${PATH}
-export HOME=/Users/Shared
-export CVSROOT=:pserver:anoncvs at anoncvs.opendarwin.org:/Volumes/src/cvs/od
-
-export MACOSX_DEPLOYMENT_TARGET=10.2
-export UNAME_RELEASE=6.0
-
-# Update the copy of darwinports from cvs,
-# sync the ports tree, and re-index.
-
-cd $HOME/darwinports
-cvs update
-make
-make install
-port sync
-cd dports
-portindex
-
-# Start building ports
-mkdir -p /darwinports/distfiles
-mkdir -p /darwinports/logs
-mkdir -p /darwinports/pkgs
-mkdir -p /darwinports/mpkgs
-mkdir -p /darwinports/rpms
-
-cd $HOME/darwinports
-#tclsh base/src/portmgr/packageall.tcl
-
-bash

Copied: trunk/base/portmgr/packaging/SETUP.chroot.sh (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/SETUP.chroot.sh)
===================================================================
--- trunk/base/portmgr/packaging/SETUP.chroot.sh	                        (rev 0)
+++ trunk/base/portmgr/packaging/SETUP.chroot.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,39 @@
+# !/bin/sh
+
+# DarwinPorts chrooted automated build system setup.
+# kevin at opendarwin.org
+# 21-Feb-2003
+
+# This should be run as uid 0, gid 0 from within the chroot.
+
+# Set up some necessary environment variables.
+
+export PATH=/opt/local/bin:/usr/X11R6/bin:${PATH}
+export HOME=/Users/Shared
+export CVSROOT=:pserver:anoncvs at anoncvs.opendarwin.org:/Volumes/src/cvs/od
+
+export MACOSX_DEPLOYMENT_TARGET=10.2
+export UNAME_RELEASE=6.0
+
+# Update the copy of darwinports from cvs,
+# sync the ports tree, and re-index.
+
+cd $HOME/darwinports
+cvs update
+make
+make install
+port sync
+cd dports
+portindex
+
+# Start building ports
+mkdir -p /darwinports/distfiles
+mkdir -p /darwinports/logs
+mkdir -p /darwinports/pkgs
+mkdir -p /darwinports/mpkgs
+mkdir -p /darwinports/rpms
+
+cd $HOME/darwinports
+#tclsh base/src/portmgr/packageall.tcl
+
+bash

Deleted: trunk/base/portmgr/packaging/buildall.sh
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/buildall.sh	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/buildall.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,222 +0,0 @@
-#!/bin/sh
-
-# Author: Jordan K. Hubbard
-# Date: 2004/12/10
-#
-# Declare all the various shell functions which do the heavy lifting.
-# If you want to see the main body of this script, go to the end of the file.
-
-# What we want to call the base chroot images
-CHROOTBASE=chrootbase.sparseimage
-DPORTSCACHE=dportscache.sparseimage
-FSTYPE=HFSX
-
-# Some conservative (and large) defaults.
-BASE_PADDING=16000000
-DPORTSCACHE_SIZE=65536M
-
-# deal with fatal errors
-bomb() {
-	echo "Error: $*"
-	echo "BASEDEV=${BASEDEV} DPORTSDEV=${DPORTSDEV}"
-	exit 1
-}
-
-# Everything we need to create the base chroot disk image (populated from host)
-mkchrootbase() {
-	if [ -f ${CHROOTBASE} ]; then
-		echo "Using existing ${CHROOTBASE} for efficiency"
-	else
-		dir=$1
-		mkdir -p $dir
-
-		# Add to this list as you find minimum dependencies DP really needs.
-		chrootfiles="bin sbin etc tmp var/log var/spool var/run var/tmp var/db private/etc private/tmp private/var dev/null usr Developer System/Library Library"
-
-		echo "Calculating chroot base image size..."
-		# start with this size to account for other overhead
-		sz=${BASE_PADDING}
-		if [ "`uname -r|tr -d .`" -ge 800 ]; then
-			# hack-around for Tiger
-			sz=$((sz + 8000000))
-		else
-			for i in $chrootfiles; do
-				mysz=`cd /; du -sk $i |awk '{print $1}'`
-				sz=$(($sz + $mysz))
-			done
-		fi
-		echo "Creating bootstrap disk image of ${sz}K bytes"
-		hdiutil create -size ${sz}k -fs ${FSTYPE} -volname base ${CHROOTBASE} > /dev/null
-		BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-		echo "Image attached as $BASEDEV"
-		echo "Copying chroot files into bootstrap disk image"
-		for i in $chrootfiles; do
-			pax -pe -rw /$i $dir 2>/dev/null
-			# special case for pax
-			cp /bin/pax $dir/bin/pax
-		done
-		# special case nukes to prevent builder pollution
-		rm -rf $dir/usr/X11R6 $dir/etc/X11
-		rm -rf $dir/opt/local $dir/etc/ports
-		# If there are any work-arounds, apply them now
-		if [ -f chroot-fixups.tar.gz ]; then
-			echo "Found chroot-fixups.tar.gz - applying to new chroot"
-			tar xpzf chroot-fixups.tar.gz -C $dir
-		fi
-		if [ -f darwinports.tar.gz ]; then
-			echo "Found darwinports.tar.gz - copying into chroot"
-			tar -xpzf darwinports.tar.gz -C $dir
-		elif [ -d darwinports ]; then
-			pax -rw darwinports $dir
-		else
-			echo "no darwinports.tar.gz or darwinports directory found - please fix this and try again."
-			exit 1
-		fi
-		bootstrapdports $dir
-	fi
-	if [ -f ${DPORTSCACHE} ]; then
-		echo "Using existing ${DPORTSCACHE} for efficiency"
-	else
-		echo "Creating dports cache of size ${DPORTSCACHE_SIZE}"
-		hdiutil create -size ${DPORTSCACHE_SIZE} -fs ${FSTYPE} -volname distfiles ${DPORTSCACHE} > /dev/null
-		DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-		mkdir -p $dir/distfiles
-		mkdir -p $dir/packages/darwin/powerpc
-		hdiutil detach $DPORTSDEV -force >& /dev/null && DPORTSDEV=""
-	fi
-}
-
-bootstrapdports() {
-	dir=$1
-	cat > $dir/bootstrap.sh << EOF
-#!/bin/sh
-cd darwinports/base
-./configure
-make all install
-make clean
-echo "file:///darwinports/dports" > /opt/local/etc/ports/sources.conf
-echo "BatchMode yes" >> /etc/ssh_config
-EOF
-	if [ "$PKGTYPE" = "dpkg" ]; then
-	    echo "/opt/local/bin/port install dpkg" >> $dir/bootstrap.sh
-	fi
-	chmod 755 $dir/bootstrap.sh
-	echo "Bootstrapping darwinports in chroot"
-	/sbin/mount_devfs devfs ${dir}/dev
-	/sbin/mount_fdesc -o union fdesc ${dir}/dev
-	chroot $dir /bootstrap.sh && rm $dir/bootstrap.sh
-	umount -f ${dir}/dev
-	umount -f ${dir}/dev
-	hdiutil detach $BASEDEV -force >& /dev/null && BASEDEV=""
-}
-
-# Set up the base chroot image
-prepchroot() {
-	dir=$1
-	rm -f ${CHROOTBASE}.shadow
-	BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -shadow -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-	mkdir -p $dir/.vol
- 	DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir/opt/local/var/db/dports -union -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
-	/sbin/mount_devfs devfs $dir/dev || bomb "unable to mount devfs"
-	/sbin/mount_fdesc -o union fdesc $dir/dev || bomb "unable to mount fdesc"
-}
-
-# Undo the work of prepchroot
-teardownchroot() {
-	dir=$1
-	umount -f $dir/dev  || (echo "unable to umount devfs")
-	umount -f $dir/dev  || (echo "unable to umount fdesc")
-	[ -z "$DPORTSDEV" ] || (hdiutil detach $DPORTSDEV -force >& /dev/null || bomb "unable to detach DPORTSDEV")
-	DPORTSDEV=""
-	if [ ! -z "$BASEDEV" ]; then
-		if ! hdiutil detach $BASEDEV -force >& /dev/null; then
-			echo "Warning: Unable to detach BASEDEV ($BASEDEV)"
-		fi
-	fi
-}
-
-# main:  This is where we start the show.
-TGTPORTS=""
-PKGTYPE=rpmpackage
-
-if [ $# -lt 1 ]; then
-	echo "Usage: $0 chrootdir [-p pkgtype] [targetportsfile]"
-	exit 1
-else
-	DIR=$1
-	shift
-	if [ $# -gt 1 ]; then
-		if [ $1 = "-p" ]; then
-		    shift
-		    PKGTYPE=$1
-		    shift
-		fi
-	fi
-	if [ $# -gt 0 ]; then
-		TGTPORTS=$1
-	fi
-fi
-
-mkdir -p outputdir/summary outputdir/Packages outputdir/logs/succeeded outputdir/logs/failed outputdir/tmp
-
-if [ -z "$TGTPORTS" ]; then
-	if [ -f PortIndex ]; then
-		PINDEX=PortIndex
-	elif [ -f darwinports/dports/PortIndex ]; then
-		PINDEX=darwinports/dports/PortIndex
-	else
-		echo "I need a PortIndex file to work from - please put one in the"
-		echo "current directory or unpack a darwinports distribution to get it from"
-		exit 1
-	fi
-	TGTPORTS=outputdir/summary/portsrun
-	awk 'NF == 2 {print $1}' $PINDEX > $TGTPORTS
-else
-	echo "Using command-line provided target of $TGTPORTS"
-fi
-
-mkchrootbase $DIR
-ARCH="`uname -p`"
-if [ "${ARCH}" = "powerpc" ]; then
-	ARCH=ppc
-fi
-
-echo "Starting packaging run for `wc -l $TGTPORTS | awk '{print $1}'` ports."
-for pkg in `cat $TGTPORTS`; do
-	if [ -f badports.txt ]; then
-		if ! grep -q $pkg badports.txt; then
-		    continue
-		fi
-	fi
-	prepchroot $DIR
-	echo "Starting packaging run for $pkg"
-	echo "#!/bin/sh" > $DIR/bootstrap.sh
-	echo 'export PATH=$PATH:/opt/local/bin' >> $DIR/bootstrap.sh
-	echo '/sbin/mount_volfs /.vol' >> $DIR/bootstrap.sh
-	echo "mkdir -p /Package" >> $DIR/bootstrap.sh
-	echo "rm -f /tmp/success" >> $DIR/bootstrap.sh
-	echo "if port -v $PKGTYPE $pkg package.destpath=/Package >& /tmp/$pkg.log; then touch /tmp/success; fi" >> $DIR/bootstrap.sh
-	echo 'umount -f /.vol || (echo "unable to umount volfs"; exit 1)' >> $DIR/bootstrap.sh
-	echo "exit 0" >> $DIR/bootstrap.sh
-	chmod 755 $DIR/bootstrap.sh
-	chroot $DIR /bootstrap.sh || bomb "bootstrap script in chroot returned failure status"
-	if [ ! -f $DIR/tmp/success ]; then
-		echo $pkg >> outputdir/summary/portsfailed
-		type="failed"
-	else
-		echo $pkg >> outputdir/summary/portspackaged
-		if [ "$PKGTYPE" = "mpkg" ]; then
-		    mv $DIR/Package/*.mpkg outputdir/Packages/
-		elif [ "$PKGTYPE" = "rpmpackage" ]; then
-		    mv $DIR/Package/RPMS/${ARCH}/*.rpm outputdir/Packages/
-		elif [ "$PKGTYPE" = "dpkg" ]; then
-		    mv $DIR/Package/*.deb outputdir/Packages/
-		fi
-		type="succeeded"
-	fi
-	mv $DIR/tmp/$pkg.log outputdir/logs/$type
-	teardownchroot $DIR
-	echo "Finished packaging run for $pkg ($type)"
-done
-echo "Packaging run complete."
-exit 0

Copied: trunk/base/portmgr/packaging/buildall.sh (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/buildall.sh)
===================================================================
--- trunk/base/portmgr/packaging/buildall.sh	                        (rev 0)
+++ trunk/base/portmgr/packaging/buildall.sh	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,222 @@
+#!/bin/sh
+
+# Author: Jordan K. Hubbard
+# Date: 2004/12/10
+#
+# Declare all the various shell functions which do the heavy lifting.
+# If you want to see the main body of this script, go to the end of the file.
+
+# What we want to call the base chroot images
+CHROOTBASE=chrootbase.sparseimage
+DPORTSCACHE=dportscache.sparseimage
+FSTYPE=HFSX
+
+# Some conservative (and large) defaults.
+BASE_PADDING=16000000
+DPORTSCACHE_SIZE=65536M
+
+# deal with fatal errors
+bomb() {
+	echo "Error: $*"
+	echo "BASEDEV=${BASEDEV} DPORTSDEV=${DPORTSDEV}"
+	exit 1
+}
+
+# Everything we need to create the base chroot disk image (populated from host)
+mkchrootbase() {
+	if [ -f ${CHROOTBASE} ]; then
+		echo "Using existing ${CHROOTBASE} for efficiency"
+	else
+		dir=$1
+		mkdir -p $dir
+
+		# Add to this list as you find minimum dependencies DP really needs.
+		chrootfiles="bin sbin etc tmp var/log var/spool var/run var/tmp var/db private/etc private/tmp private/var dev/null usr Developer System/Library Library"
+
+		echo "Calculating chroot base image size..."
+		# start with this size to account for other overhead
+		sz=${BASE_PADDING}
+		if [ "`uname -r|tr -d .`" -ge 800 ]; then
+			# hack-around for Tiger
+			sz=$((sz + 8000000))
+		else
+			for i in $chrootfiles; do
+				mysz=`cd /; du -sk $i |awk '{print $1}'`
+				sz=$(($sz + $mysz))
+			done
+		fi
+		echo "Creating bootstrap disk image of ${sz}K bytes"
+		hdiutil create -size ${sz}k -fs ${FSTYPE} -volname base ${CHROOTBASE} > /dev/null
+		BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
+		echo "Image attached as $BASEDEV"
+		echo "Copying chroot files into bootstrap disk image"
+		for i in $chrootfiles; do
+			pax -pe -rw /$i $dir 2>/dev/null
+			# special case for pax
+			cp /bin/pax $dir/bin/pax
+		done
+		# special case nukes to prevent builder pollution
+		rm -rf $dir/usr/X11R6 $dir/etc/X11
+		rm -rf $dir/opt/local $dir/etc/ports
+		# If there are any work-arounds, apply them now
+		if [ -f chroot-fixups.tar.gz ]; then
+			echo "Found chroot-fixups.tar.gz - applying to new chroot"
+			tar xpzf chroot-fixups.tar.gz -C $dir
+		fi
+		if [ -f darwinports.tar.gz ]; then
+			echo "Found darwinports.tar.gz - copying into chroot"
+			tar -xpzf darwinports.tar.gz -C $dir
+		elif [ -d darwinports ]; then
+			pax -rw darwinports $dir
+		else
+			echo "no darwinports.tar.gz or darwinports directory found - please fix this and try again."
+			exit 1
+		fi
+		bootstrapdports $dir
+	fi
+	if [ -f ${DPORTSCACHE} ]; then
+		echo "Using existing ${DPORTSCACHE} for efficiency"
+	else
+		echo "Creating dports cache of size ${DPORTSCACHE_SIZE}"
+		hdiutil create -size ${DPORTSCACHE_SIZE} -fs ${FSTYPE} -volname distfiles ${DPORTSCACHE} > /dev/null
+		DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
+		mkdir -p $dir/distfiles
+		mkdir -p $dir/packages/darwin/powerpc
+		hdiutil detach $DPORTSDEV -force >& /dev/null && DPORTSDEV=""
+	fi
+}
+
+bootstrapdports() {
+	dir=$1
+	cat > $dir/bootstrap.sh << EOF
+#!/bin/sh
+cd darwinports/base
+./configure
+make all install
+make clean
+echo "file:///darwinports/dports" > /opt/local/etc/ports/sources.conf
+echo "BatchMode yes" >> /etc/ssh_config
+EOF
+	if [ "$PKGTYPE" = "dpkg" ]; then
+	    echo "/opt/local/bin/port install dpkg" >> $dir/bootstrap.sh
+	fi
+	chmod 755 $dir/bootstrap.sh
+	echo "Bootstrapping darwinports in chroot"
+	/sbin/mount_devfs devfs ${dir}/dev
+	/sbin/mount_fdesc -o union fdesc ${dir}/dev
+	chroot $dir /bootstrap.sh && rm $dir/bootstrap.sh
+	umount -f ${dir}/dev
+	umount -f ${dir}/dev
+	hdiutil detach $BASEDEV -force >& /dev/null && BASEDEV=""
+}
+
+# Set up the base chroot image
+prepchroot() {
+	dir=$1
+	rm -f ${CHROOTBASE}.shadow
+	BASEDEV=`hdiutil attach ${CHROOTBASE} -mountpoint $dir -shadow -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
+	mkdir -p $dir/.vol
+ 	DPORTSDEV=`hdiutil attach ${DPORTSCACHE} -mountpoint $dir/opt/local/var/db/dports -union -noverify 2>&1 | awk '/dev/ {if (x == 0) {print $1; x = 1}}'`
+	/sbin/mount_devfs devfs $dir/dev || bomb "unable to mount devfs"
+	/sbin/mount_fdesc -o union fdesc $dir/dev || bomb "unable to mount fdesc"
+}
+
+# Undo the work of prepchroot
+teardownchroot() {
+	dir=$1
+	umount -f $dir/dev  || (echo "unable to umount devfs")
+	umount -f $dir/dev  || (echo "unable to umount fdesc")
+	[ -z "$DPORTSDEV" ] || (hdiutil detach $DPORTSDEV -force >& /dev/null || bomb "unable to detach DPORTSDEV")
+	DPORTSDEV=""
+	if [ ! -z "$BASEDEV" ]; then
+		if ! hdiutil detach $BASEDEV -force >& /dev/null; then
+			echo "Warning: Unable to detach BASEDEV ($BASEDEV)"
+		fi
+	fi
+}
+
+# main:  This is where we start the show.
+TGTPORTS=""
+PKGTYPE=rpmpackage
+
+if [ $# -lt 1 ]; then
+	echo "Usage: $0 chrootdir [-p pkgtype] [targetportsfile]"
+	exit 1
+else
+	DIR=$1
+	shift
+	if [ $# -gt 1 ]; then
+		if [ $1 = "-p" ]; then
+		    shift
+		    PKGTYPE=$1
+		    shift
+		fi
+	fi
+	if [ $# -gt 0 ]; then
+		TGTPORTS=$1
+	fi
+fi
+
+mkdir -p outputdir/summary outputdir/Packages outputdir/logs/succeeded outputdir/logs/failed outputdir/tmp
+
+if [ -z "$TGTPORTS" ]; then
+	if [ -f PortIndex ]; then
+		PINDEX=PortIndex
+	elif [ -f darwinports/dports/PortIndex ]; then
+		PINDEX=darwinports/dports/PortIndex
+	else
+		echo "I need a PortIndex file to work from - please put one in the"
+		echo "current directory or unpack a darwinports distribution to get it from"
+		exit 1
+	fi
+	TGTPORTS=outputdir/summary/portsrun
+	awk 'NF == 2 {print $1}' $PINDEX > $TGTPORTS
+else
+	echo "Using command-line provided target of $TGTPORTS"
+fi
+
+mkchrootbase $DIR
+ARCH="`uname -p`"
+if [ "${ARCH}" = "powerpc" ]; then
+	ARCH=ppc
+fi
+
+echo "Starting packaging run for `wc -l $TGTPORTS | awk '{print $1}'` ports."
+for pkg in `cat $TGTPORTS`; do
+	if [ -f badports.txt ]; then
+		if ! grep -q $pkg badports.txt; then
+		    continue
+		fi
+	fi
+	prepchroot $DIR
+	echo "Starting packaging run for $pkg"
+	echo "#!/bin/sh" > $DIR/bootstrap.sh
+	echo 'export PATH=$PATH:/opt/local/bin' >> $DIR/bootstrap.sh
+	echo '/sbin/mount_volfs /.vol' >> $DIR/bootstrap.sh
+	echo "mkdir -p /Package" >> $DIR/bootstrap.sh
+	echo "rm -f /tmp/success" >> $DIR/bootstrap.sh
+	echo "if port -v $PKGTYPE $pkg package.destpath=/Package >& /tmp/$pkg.log; then touch /tmp/success; fi" >> $DIR/bootstrap.sh
+	echo 'umount -f /.vol || (echo "unable to umount volfs"; exit 1)' >> $DIR/bootstrap.sh
+	echo "exit 0" >> $DIR/bootstrap.sh
+	chmod 755 $DIR/bootstrap.sh
+	chroot $DIR /bootstrap.sh || bomb "bootstrap script in chroot returned failure status"
+	if [ ! -f $DIR/tmp/success ]; then
+		echo $pkg >> outputdir/summary/portsfailed
+		type="failed"
+	else
+		echo $pkg >> outputdir/summary/portspackaged
+		if [ "$PKGTYPE" = "mpkg" ]; then
+		    mv $DIR/Package/*.mpkg outputdir/Packages/
+		elif [ "$PKGTYPE" = "rpmpackage" ]; then
+		    mv $DIR/Package/RPMS/${ARCH}/*.rpm outputdir/Packages/
+		elif [ "$PKGTYPE" = "dpkg" ]; then
+		    mv $DIR/Package/*.deb outputdir/Packages/
+		fi
+		type="succeeded"
+	fi
+	mv $DIR/tmp/$pkg.log outputdir/logs/$type
+	teardownchroot $DIR
+	echo "Finished packaging run for $pkg ($type)"
+done
+echo "Packaging run complete."
+exit 0

Deleted: trunk/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/dpkgall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/dpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,932 +0,0 @@
-#!/usr/bin/env tclsh8.4
-# dpkgbuild.tcl
-# $Id$
-#
-# Copyright (c) 2004 Landon Fuller <landonf at macports.org>
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-#######################################
-#
-# Must be installed outside of dports tree:
-#	tcl 8.4
-#	curl
-#	tar
-#	gzip
-#	unzip
-#	dports tree
-#
-# A tar file containing full /${portprefix} directory tree, stored in:
-#	$pkgrepo/$architecture/root.tar.gz
-# The /${portprefix} directory tree must contain:
-#	DarwinPorts installation
-#	dpkg
-#
-# Configuration:
-#	/etc/ports/dpkg.conf
-#	/etc/ports/dpkg
-#
-#######################################
-
-package require darwinports
-
-# Configuration Namespace
-namespace eval dpkg {
-	variable configopts "pkgrepo architecture portlistfile portprefix dportsrc silentmode initialports"
-
-	# Preferences
-	variable silentmode false
-	variable configfile "/etc/ports/dpkg.conf"
-	variable portlist ""
-	variable portprefix "/usr/dports"
-	variable dportsrc "/usr/darwinports"
-	variable pkgrepo "/export/dpkg/"
-	# architecture is set in main
-	variable architecture
-	variable initialports "dpkg apt"
-	variable aptpackagedir
-	variable packagedir
-	# portlistfile defaults to ${pkgrepo}/${architecture}/etc/buildlist.txt (set in main)
-	variable portlistfile
-	# baselistfile defaults to ${pkgrepo}/${architecture}/etc/baselist.txt (set in main)
-	variable baselistfile
-
-	# Non-user modifiable.
-	# Ports required for building. Format:
-	# <binary> <portname> <binary> <portname> ...
-	variable requiredports "dpkg dpkg apt-get apt"
-
-	# Current log file descriptor
-	variable logfd
-}
-
-# DarwinPorts UI Event Callbacks
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "Debug: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-	global dpkg::logfd
-	if {[info exists logfd] && [string length $logfd] > 0 } {
-		return {$logfd}
-	} elseif {$message(priority) != "debug"} {
-		# If there's no log file, echo to stdout
-		return {stdout}
-	}
-}
-
-proc ui_silent {message} {
-	global dpkg::silentmode
-	if {"${silentmode}" != true} {
-		puts $message
-		ui_msg $message
-	} else {
-		ui_msg $message
-	}
-}
-
-# Outputs message to console and to log
-# Should only be used with errors
-proc ui_noisy_error {message} {
-	puts $message
-	ui_error $message
-}
-
-proc log_message {channel message} {
-	seek $channel 0 end
-	puts $channel $message
-	flush $channel
-}
-
-# Read in configuration file
-proc readConfig {file} {
-	global dpkg::configopts
-
-	set fd [open $file r]
-	while {[gets $fd line] >= 0} {
-		foreach option $configopts {
-			if {[regexp "^$option\[ \t\]+(\[A-Za-z0-9_:,\./-\]+$)" $line match val] == 1} {
-				set dpkg::$option $val
-			}
-		}
-	}
-}
-
-# Read a list of newline seperated port names from $file
-proc readPortList {file} {
-	set fd [open $file r]
-	set portlist ""
-
-	while {[gets $fd line] >= 0} {
-		lappend portlist $line
-	}
-
-	return $portlist
-}
-
-# Escape all regex characters in a portname
-proc regex_escape_portname {portname} {
-	regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" escaped_string
-	return $escaped_string
-}
-
-# Print usage string
-proc print_usage {args} {
-	global argv0
-	puts "Usage: [file tail $argv0] \[-qa\] \[-f configfile\] \[-p portlist\]"
-	puts "	-q	Quiet mode (only errors reported)"
-	puts "	-w	No warnings (progress still reported)"
-	puts "	-a	Build all ports"
-	puts "	-b	Re-generate base install archive"
-	puts "	-p	Attempt to build ports that do not advertise support for the build platform"
-	puts "	-i	Initialize Build System (Should only be run on a new build system)"
-}
-
-# Delete and restore the build system
-proc reset_tree {args} {
-	global dpkg::portprefix dpkg::pkgrepo dpkg::architecture
-
-	ui_silent "Restoring pristine ${portprefix} from ${pkgrepo}/${architecture}/root.tar.gz"
-	if {[catch {system "rm -Rf ${portprefix}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "rm -Rf /etc/X11"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "cd / && tar xvf ${pkgrepo}/${architecture}/root.tar.gz"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	ui_silent "Linking static distfiles directory to ${portprefix}/var/db/dports/distfiles."
-	if {[file isdirectory ${portprefix}/var/db/dports/distfiles"]} {
-		if {[catch {system "rm -rf ${portprefix}/var/db/dports/distfiles"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-
-		if {[catch {system "ln -s ${pkgrepo}/distfiles ${portprefix}/var/db/dports/distfiles"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-	}
-}
-
-proc main {argc argv} {
-	global dpkg::configfile dpkg::pkgrepo dpkg::architecture dpkg::portlistfile
-	global dpkg::portsArray dpkg::portprefix dpkg::silentmode dpkg::logfd dpkg::packagedir dpkg::aptpackagedir
-	global dpkg::requiredports dpkg::baselistfile tcl_platform
-
-	# First time through, we reset the tree
-	set firstrun_flag true
-
-	# Read command line options
-	set buildall_flag false
-	set anyplatform_flag false
-	set nowarn_flag false
-	set basegen_flag false
-	set initialize_flag false
-
-	for {set i 0} {$i < $argc} {incr i} {
-		set arg [lindex $argv $i]
-		switch -- $arg {
-			-a {
-				set buildall_flag true
-			}
-			-b {
-				set basegen_flag true
-			}
-			-f {
-				incr i
-				set configfile [lindex $argv $i]
-
-				if {![file readable $configfile]} {
-					return -code error "Configuration file \"$configfile\" is unreadable."
-				}
-			}
-			-i {
-				set initialize_flag true
-			}
-			-p {
-				incr i
-				set portlistfile [lindex $argv $i]
-				if {![file readable $portlistfile]} {
-					return -code error "Port list file \"$portlistfile\" is unreadable."
-				}
-			}
-			-q {
-				set silentmode true
-			}
-			-w {
-				set nowarn_flag true
-			}
-			-p {
-				set anyplatform_flag true
-			}
-			default {
-				print_usage
-				exit 1
-			}
-		}
-	}
-
-	# Initialize System
-	array set ui_options {}
-	array set options {}
-	array set variations {}
-	dportinit ui_options options variations
-
-	# If -i was specified, install base system and exit
-	if {$initialize_flag == "true"} {
-		initialize_system
-		exit 0
-	}
-
-	# We must have dpkg by now 
-	if {[catch {set_architecture} result]} {
-		puts "$result."
-		puts "Have you initialized the build system? Use the -i flag:"
-		print_usage
-		exit 1
-	}
-
-	# Set the platform
-	set platformString [string tolower $tcl_platform(os)]
-
-	set packagedir ${pkgrepo}/${architecture}/packages/
-	set aptpackagedir ${pkgrepo}/apt/dists/stable/main/binary-${architecture}/
-
-	# Read configuration files
-	if {[file readable $configfile]} {
-		readConfig $configfile
-	}
-
-	# If portlistfile has not been set, supply a reasonable default
-	if {![info exists portlistfile]} {
-		# The default portlist file
-		set portlistfile [file join $pkgrepo $architecture etc buildlist.txt]
-	}
-
-	# If baselistfile has not been set, supply a reasonable default
-	if {![info exists baselistfile]} {
-		# The default baselist file
-		set baselistfile [file join $pkgrepo $architecture etc baselist.txt]
-	}
-
-	# Read the port list
-	if {[file readable $portlistfile]} {
-		set portlist [readPortList $portlistfile]
-	} else {
-		set portlist ""
-	}
-
-	if {[file readable $baselistfile]} {
-		set baselist [readPortList $baselistfile]
-	} else {
-		set baselist ""
-	}
-
-	# If no portlist file was specified, create a portlist that includes all ports
-	if {[llength $portlist] == 0 || "$buildall_flag" == "true"} {
-		set res [dportsearch {.*}]
-		foreach {name array} $res {
-			lappend portlist $name
-		}
-	} else {
-		# Port list was specified. Ensure that all the specified ports are available.
-		# Add ${baselist} and get_required_ports to the list
-		set portlist [lsort -unique [concat $portlist $baselist [get_required_ports]]]
-		foreach port $portlist {
-			set fail false
-
-			if {[catch {set res [get_portinfo $port]} result]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_noisy_error "Error: $result"
-				set fail true
-			}
-
-			# Add all of the specified ports' dependencies to the portlist
-			set dependencies [get_dependencies $port false]
-			foreach dep $dependencies {
-				lappend portlist [lindex $dep 0]
-			}
-		}
-		if {"$fail" == "true"} {
-			exit 1
-		}
-	}
-
-	# Clean out duplicates
-	set portlist [lsort -unique $portlist]
-
-	# Ensure that the log directory exists, and open up
-	# the default debug log
-	open_default_log w
-
-	# Set the dport options
-	# Package build path
-	set options(package.destpath) ${packagedir}
-
-	# Ensure that it exists
-	file mkdir $options(package.destpath)
-
-	# Force mode
-	set options(ports_force) yes
-
-	# Set variations (empty)
-	set variations [list]
-
-
-	if {"$silentmode" != "true" && "$nowarn_flag" != "true"} {
-		puts "WARNING: The full contents of ${portprefix}, /usr/X11R6, and /etc/X11 will be deleted by this script. If you do not want this, control-C NOW."
-		exec sleep 10
-	}
-
-	# Destroy the existing apt repository
-	if {[catch {system "rm -Rf ${aptpackagedir}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	# Recreate
-	file mkdir ${aptpackagedir}
-
-	close_default_log
-
-	foreach port $portlist {
-		# Open the default debug log write/append
-		open_default_log
-
-		if {[catch {set res [get_portinfo $port]} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: port search failed: $error"
-			exit 1
-		}
-
-		# Reset array from previous runs
-		unset -nocomplain portinfo
-		array set portinfo [lindex $res 1]
-
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
-			![info exists portinfo(categories)]} {
-			ui_noisy_error "Internal error: $name missing some portinfo keys"
-			close $logfd
-			continue
-		}
-
-		# Skip un-supported ports
-		if {[info exists portinfo(platforms)] && ${anyplatform_flag} != "true"} {
-			if {[lsearch $portinfo(platforms) $platformString] == -1} {
-				ui_silent "Skipping unsupported port $portinfo(name) (platform: $platformString supported: $portinfo(platforms))"
-				continue
-			}
-		}
-
-
-		# Add apt override line. dpkg is special cased and marked 'required'
-		# TODO: add the ability to specify the "required" priority for specific
-		# ports in a config file.
-		if {"$portinfo(name)" == "dpkg"} {
-			set pkg_priority required
-		} else {
-			set pkg_priority optional
-		}
-		add_override $portinfo(name) $pkg_priority [lindex $portinfo(categories) 0]
-
-		# Skip up-to-date software
-		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-		if {[file exists ${pkgfile}]} {
-			if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-				if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-					ui_silent "Skipping ${portinfo(name)}-${portinfo(version)}-${portinfo(revision)}; package is up to date."
-					# Shove the package into the apt repository
-					copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-					continue
-				}
-			}
-		}
-
-		# We're going to actually build the package, reset the tree
-		# if this is our first time through. The tree is always reset
-		# at the end of a packaging run, too.
-		if {$firstrun_flag == true} {
-			reset_tree
-			set firstrun_flag false
-		}
-
-		ui_silent "Building $portinfo(name) ..."
-
-		# Close the main debug log
-		close_default_log
-
-		# Create log directory and open the build log
-		file mkdir [file join ${pkgrepo} ${architecture} log build ${port}]
-		set logfd [open ${pkgrepo}/${architecture}/log/build/${port}/build.log w 0644]
-
-		# Install binary dependencies if possible
-		set dependencies [get_dependencies $portinfo(name)]
-		foreach dep $dependencies {
-			install_binary_if_available $dep
-		}
-
-		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: unable to open port: $result"
-			exit 1
-		}
-
-		if {[catch {set result [dportexec $workername clean]} result] || $result == 1} {
-			ui_noisy_error "Cleaning $portinfo(name) failed, consult build log"
-
-			# Close the log
-			close $logfd
-
-			# Copy the log to the failure directory
-			copy_failure_log $portinfo(name)
-
-			# Close the port
-			dportclose $workername
-
-			continue
-		}
-
-		# Re-open the port. DarwinPorts doesn't play well with multiple targets, apparently
-		dportclose $workername
-		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: unable to open port: $result"
-			exit 1
-		}
-
-		if {[catch {set result [dportexec $workername dpkg]} result] || $result == 1} {
-			ui_noisy_error "Packaging $portinfo(name) failed, consult build log"
-
-			# Copy the log to the failure directory
-			copy_failure_log $portinfo(name)
-
-			# Close the port
-			dportclose $workername
-
-			# Close the log
-			close $logfd
-
-			# Open default log
-			open_default_log
-
-			ui_silent "Resetting /usr/dports ..."
-			reset_tree
-			ui_silent "Done."
-
-			# Close the log
-			close $logfd
-
-			continue
-		}
-
-		ui_silent "Package build for $portinfo(name) succeeded"
-		
-		# Into the apt repository you go!
-		copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-
-		ui_silent "Resetting /usr/dports ..."
-		reset_tree
-		ui_silent "Done."
-
-		# Close the log
-		close $logfd
-
-		# Delete any previous failure logs
-		delete_failure_log $portinfo(name)
-
-		# Close the port
-		dportclose $workername
-	}
-
-	open_default_log
-
-	# If required, rebuild the clientinstall.tgz
-	if {$basegen_flag == true} {
-		# dpkg is always required
-		set pkglist [lsort -unique [concat dpkg $baselist [get_required_ports]]]
-		set workdir [file join ${pkgrepo} ${architecture}]
-		set rootdir [file join $workdir clientroot]
-		set rootfile [file join $workdir client-root.tar.gz]
-		file mkdir ${rootdir}
-
-		# dpkg is required
-		array set portinfo [lindex [get_portinfo dpkg] 1]
-		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-		system "cd \"${rootdir}\" && ar x \"${pkgfile}\" data.tar.gz"
-		system "cd \"${rootdir}\" && tar xvf data.tar.gz; rm data.tar.gz"
-
-		foreach port $pkglist {
-			set dependencies [get_dependencies $port false]
-			foreach dep $dependencies {
-				lappend newpkglist [lindex $dep 0]
-			}
-		}
-
-		if {[info exists newpkglist]} {		
-			set pkglist [lsort -unique [concat $newpkglist $pkglist]]
-		}
-
-		foreach port $pkglist {
-			array set portinfo [lindex [get_portinfo $port] 1]
-			system "dpkg --root \"${rootdir}\" --force-depends -i \"[get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]\""
-		}
-
-		system "cd \"${rootdir}\" && tar cf \"[file join ${workdir} clientinstall.tar.gz]\" ."
-		file delete -force ${rootdir}
-	}
-
-	ui_silent "Building apt-get index ..."
-	if {[catch {system "cd ${pkgrepo}/apt && dpkg-scanpackages dists override >${aptpackagedir}/Packages"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-
-	if {[catch {system "cd ${aptpackagedir} && gzip Packages"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-	remove_override_file
-	ui_silent "Done."
-
-	ui_silent "Package run finished."
-	close_default_log
-
-	exit 0
-}
-
-# Return ports listed in $dpkg::requiredports that are not
-# installed
-proc get_required_ports {args} {
-	global dpkg::requiredports
-	set reqlist ""
-
-	foreach {binary port} $requiredports {
-		if {[find_binary $binary] == ""} {
-			lappend reqlist $port
-		}
-	}
-	return $reqlist
-}
-
-# Given a binary name, searches PATH
-proc find_binary {binary} {
-	global env
-	set path [split $env(PATH) :]
-	foreach dir $path {
-		set file [file join $dir $binary]
-		if {[file exists $file]} {
-			return $file
-		}
-	}
-	return ""
-}
-
-# Set the architecture global
-proc set_architecture {args} {
-	set dpkg::architecture "[exec dpkg --print-installation-architecture]"
-}
-
-# Initialize a new build system
-proc initialize_system {args} {
-	global dpkg::initialports dpkg::pkgrepo
-	global dpkg::architecture dpkg::portprefix
-
-	# Create standard directories
-	ui_msg "Creating ${pkgrepo} directory"
-	file mkdir ${pkgrepo}
-
-	set builddeps ""
-	set rundeps ""
-
-	foreach port [get_required_ports] {
-		set builddeps [concat $builddeps [get_dependencies $port true]]
-		set rundeps [concat $rundeps [get_dependencies $port false]]
-	}
-
-	set buildlist [lsort -unique $builddeps]
-
-	foreach port $builddeps {
-		if {[lsearch -exact $port $rundeps] >= 0 } {
-			lappend removelist $port
-		}
-	}
-
-	set options ""
-	set variations ""
-
-	foreach port [get_required_ports] {
-		if {[catch {do_portexec $port [array get options] [array get variants] install} result]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Fatal error: $result"
-			exit 1
-		}
-	}
-
-	if {[info exists removelist]} {
-		ui_msg "Removing build dependencies ..."
-		foreach portlist $removelist {
-			set port [lindex $portlist 0]
-
-			ui_msg "Uninstalling $port."
-			if { [catch {portuninstall::uninstall $portname $portversion} result] } {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_noisy_errorr "Fatal error: Uninstalling $port failed: $result"
-				exit 1
-			}
-		}
-		ui_msg "Done."
-	}
-			
-
-	if {[catch {set_architecture} result]} {
-		puts "Fatal error: $result."
-		exit 1
-	}
-
-	ui_msg "Creating [file join ${pkgrepo} ${architecture}] directory"
-	file mkdir [file join ${pkgrepo} ${architecture}]
-	file mkdir [file join ${pkgrepo} ${architecture} etc]
-
-	ui_msg "Generating pristine archive: [file join ${pkgrepo} ${architecture} root.tar.gz]"
-	if {[catch {system "tar -zcf \"[file join ${pkgrepo} ${architecture} root.tar.gz]\" \"${portprefix}\""} result]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Fatal error: Archive creation failed: $result"
-		exit 1
-	}
-
-	ui_msg "Build system successfully initialized!"
-}
-
-# Execute a target on a port (by port name)
-proc do_portexec {port options variants target} {
-
-	array set portinfo [lindex [get_portinfo $port] 1]
-
-	if {[catch {set workername [dportopen $portinfo(porturl) $options $variants yes]} result] || $result == 1} {
-		return -code error "Internal error: unable to open port: $result"
-		exit 1
-	}
-
-	if {[catch {set result [dportexec $workername install]} result] || $result == 1} {
-
-		# Close the port
-		dportclose $workername
-
-		# Return error
-		return -code error "Executing target $target on $portinfo(name) failed."
-	}
-}
-
-proc get_portinfo {port} {
-	set searchstring [regex_escape_portname $port]
-	set res [dportsearch "^${searchstring}\$"]
-
-	if {[llength $res] < 2} {
-		return -code error "Port \"$port\" not found in index."
-	}
-
-	return $res
-}
-
-# Given name, version, and revision, returns the path to a package file
-proc get_pkgpath {name version revision} {
-	global dpkg::pkgrepo dpkg::architecture
-	global dpkg::packagedir
-	if {${revision} == 0} {
-		set revision ""
-	} else {
-		set revision "-${revision}"
-	}
-
-	return [string tolower ${packagedir}/${name}_${version}${revision}_${architecture}.deb]
-}
-
-# Opens the default log file and sets dpkg::logfd
-proc open_default_log {{mode a}} {
-	global dpkg::pkgrepo dpkg::architecture dpkg::logfd
-	# Ensure that the log directory exists, and open up
-	# the default debug log
-	file mkdir ${pkgrepo}/${architecture}/log/
-	set logfd [open ${pkgrepo}/${architecture}/log/debug.log ${mode} 0644]
-}
-
-# Closes the current logfile
-proc close_default_log {args} {
-	global dpkg::logfd
-	close $logfd
-}
-
-# Copies a port log file to the failure directory
-proc copy_failure_log {name} {
-	global dpkg::pkgrepo dpkg::architecture
-	# Copy the log to the failure log directory
-	file mkdir ${pkgrepo}/${architecture}/log/failure/${name}
-	file copy -force ${pkgrepo}/${architecture}/log/build/${name}/build.log ${pkgrepo}/${architecture}/log/failure/${name}/
-}
-
-# Deletes a port's failure log
-proc delete_failure_log {name} {
-	global dpkg::pkgrepo dpkg::architecture
-	if {[catch {system "rm -Rf ${pkgrepo}/${architecture}/log/failure/${name}"} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-}
-
-# Add an override entry to the apt override file
-proc add_override {name priority section {maintainer ""}} {
-	global dpkg::aptpackagedir dpkg::pkgrepo
-	set output "${name}	${priority}	${section}"
-	if {${maintainer} != ""} {
-		append output " ${maintainer}"
-	}
-	set fd [open "${pkgrepo}/apt/override" a 0644]
-	puts $fd $output
-	close $fd
-}
-
-# Deletes the apt override file
-proc remove_override_file {args} {
-	global dpkg::aptpackagedir dpkg::pkgrepo
-	if {[catch {file delete -force ${pkgrepo}/apt/override} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_noisy_error "Internal error: $error"
-		exit 1
-	}
-}
-
-# Copies a given package to the apt repository
-proc copy_pkg_to_apt {name version revision category} {
-	global dpkg::aptpackagedir
-
-	set pkgfile [get_pkgpath $name $version $revision]
-	file mkdir $aptpackagedir/main/$category
-	file link -hard $aptpackagedir/main/$category/[file tail $pkgfile] $pkgfile
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname {includeBuildDeps "true"}} {
-	set result [get_dependencies_recurse $portname $includeBuildDeps]
-	return [lsort -unique $result]
-}
-
-proc get_dependencies_recurse {portname includeBuildDeps} {
-	set result {}
-	
-	set res [get_portinfo $portname]
-
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-
-		lappend result [list $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies_recurse $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-	global dpkg::architecture dpkg::pkgrepo dpkg::portprefix
-
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set portrevision [lindex $dep 2]
-	set category [lindex $dep 3]
-
-	if {${portrevision} != ""} {
-		set verstring ${portversion}_${portrevision}
-	} else {
-		set verstring ${portversion}
-	}
-	
-	set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
-	set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
-
-	# Check if the package is available, and ensure that it has not already been
-	# installed through darwinports (bootstrap packages such as dpkg and its
-	# dependencies are always installed)
-	if {[file readable $pkgpath] && ![file exists $receiptdir/receipt.bz2]} {
-		ui_silent "Installing binary: $pkgpath"
-		if {[catch {system "dpkg --force-depends -i ${pkgpath}"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-		# Touch the receipt
-		file mkdir $receiptdir
-		if {[catch {system "touch [file join $receiptdir receipt.bz2]"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_noisy_error "Internal error: $error"
-			exit 1
-		}
-	}
-}
-
-### main() entry point ####
-main $argc $argv

Copied: trunk/base/portmgr/packaging/dpkgall.tcl (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/dpkgall.tcl)
===================================================================
--- trunk/base/portmgr/packaging/dpkgall.tcl	                        (rev 0)
+++ trunk/base/portmgr/packaging/dpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,932 @@
+#!/usr/bin/env tclsh8.4
+# dpkgbuild.tcl
+# $Id$
+#
+# Copyright (c) 2004 Landon Fuller <landonf at macports.org>
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2002 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+#######################################
+#
+# Must be installed outside of dports tree:
+#	tcl 8.4
+#	curl
+#	tar
+#	gzip
+#	unzip
+#	dports tree
+#
+# A tar file containing full /${portprefix} directory tree, stored in:
+#	$pkgrepo/$architecture/root.tar.gz
+# The /${portprefix} directory tree must contain:
+#	DarwinPorts installation
+#	dpkg
+#
+# Configuration:
+#	/etc/ports/dpkg.conf
+#	/etc/ports/dpkg
+#
+#######################################
+
+package require darwinports
+
+# Configuration Namespace
+namespace eval dpkg {
+	variable configopts "pkgrepo architecture portlistfile portprefix dportsrc silentmode initialports"
+
+	# Preferences
+	variable silentmode false
+	variable configfile "/etc/ports/dpkg.conf"
+	variable portlist ""
+	variable portprefix "/usr/dports"
+	variable dportsrc "/usr/darwinports"
+	variable pkgrepo "/export/dpkg/"
+	# architecture is set in main
+	variable architecture
+	variable initialports "dpkg apt"
+	variable aptpackagedir
+	variable packagedir
+	# portlistfile defaults to ${pkgrepo}/${architecture}/etc/buildlist.txt (set in main)
+	variable portlistfile
+	# baselistfile defaults to ${pkgrepo}/${architecture}/etc/baselist.txt (set in main)
+	variable baselistfile
+
+	# Non-user modifiable.
+	# Ports required for building. Format:
+	# <binary> <portname> <binary> <portname> ...
+	variable requiredports "dpkg dpkg apt-get apt"
+
+	# Current log file descriptor
+	variable logfd
+}
+
+# DarwinPorts UI Event Callbacks
+proc ui_prefix {priority} {
+    switch $priority {
+        debug {
+        	return "Debug: "
+        }
+        error {
+        	return "Error: "
+        }
+        warn {
+        	return "Warning: "
+        }
+        default {
+        	return ""
+        }
+    }
+}
+
+proc ui_channels {priority} {
+	global dpkg::logfd
+	if {[info exists logfd] && [string length $logfd] > 0 } {
+		return {$logfd}
+	} elseif {$message(priority) != "debug"} {
+		# If there's no log file, echo to stdout
+		return {stdout}
+	}
+}
+
+proc ui_silent {message} {
+	global dpkg::silentmode
+	if {"${silentmode}" != true} {
+		puts $message
+		ui_msg $message
+	} else {
+		ui_msg $message
+	}
+}
+
+# Outputs message to console and to log
+# Should only be used with errors
+proc ui_noisy_error {message} {
+	puts $message
+	ui_error $message
+}
+
+proc log_message {channel message} {
+	seek $channel 0 end
+	puts $channel $message
+	flush $channel
+}
+
+# Read in configuration file
+proc readConfig {file} {
+	global dpkg::configopts
+
+	set fd [open $file r]
+	while {[gets $fd line] >= 0} {
+		foreach option $configopts {
+			if {[regexp "^$option\[ \t\]+(\[A-Za-z0-9_:,\./-\]+$)" $line match val] == 1} {
+				set dpkg::$option $val
+			}
+		}
+	}
+}
+
+# Read a list of newline seperated port names from $file
+proc readPortList {file} {
+	set fd [open $file r]
+	set portlist ""
+
+	while {[gets $fd line] >= 0} {
+		lappend portlist $line
+	}
+
+	return $portlist
+}
+
+# Escape all regex characters in a portname
+proc regex_escape_portname {portname} {
+	regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" escaped_string
+	return $escaped_string
+}
+
+# Print usage string
+proc print_usage {args} {
+	global argv0
+	puts "Usage: [file tail $argv0] \[-qa\] \[-f configfile\] \[-p portlist\]"
+	puts "	-q	Quiet mode (only errors reported)"
+	puts "	-w	No warnings (progress still reported)"
+	puts "	-a	Build all ports"
+	puts "	-b	Re-generate base install archive"
+	puts "	-p	Attempt to build ports that do not advertise support for the build platform"
+	puts "	-i	Initialize Build System (Should only be run on a new build system)"
+}
+
+# Delete and restore the build system
+proc reset_tree {args} {
+	global dpkg::portprefix dpkg::pkgrepo dpkg::architecture
+
+	ui_silent "Restoring pristine ${portprefix} from ${pkgrepo}/${architecture}/root.tar.gz"
+	if {[catch {system "rm -Rf ${portprefix}"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	if {[catch {system "rm -Rf /etc/X11"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	if {[catch {system "cd / && tar xvf ${pkgrepo}/${architecture}/root.tar.gz"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	ui_silent "Linking static distfiles directory to ${portprefix}/var/db/dports/distfiles."
+	if {[file isdirectory ${portprefix}/var/db/dports/distfiles"]} {
+		if {[catch {system "rm -rf ${portprefix}/var/db/dports/distfiles"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: $error"
+			exit 1
+		}
+
+		if {[catch {system "ln -s ${pkgrepo}/distfiles ${portprefix}/var/db/dports/distfiles"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: $error"
+			exit 1
+		}
+	}
+}
+
+proc main {argc argv} {
+	global dpkg::configfile dpkg::pkgrepo dpkg::architecture dpkg::portlistfile
+	global dpkg::portsArray dpkg::portprefix dpkg::silentmode dpkg::logfd dpkg::packagedir dpkg::aptpackagedir
+	global dpkg::requiredports dpkg::baselistfile tcl_platform
+
+	# First time through, we reset the tree
+	set firstrun_flag true
+
+	# Read command line options
+	set buildall_flag false
+	set anyplatform_flag false
+	set nowarn_flag false
+	set basegen_flag false
+	set initialize_flag false
+
+	for {set i 0} {$i < $argc} {incr i} {
+		set arg [lindex $argv $i]
+		switch -- $arg {
+			-a {
+				set buildall_flag true
+			}
+			-b {
+				set basegen_flag true
+			}
+			-f {
+				incr i
+				set configfile [lindex $argv $i]
+
+				if {![file readable $configfile]} {
+					return -code error "Configuration file \"$configfile\" is unreadable."
+				}
+			}
+			-i {
+				set initialize_flag true
+			}
+			-p {
+				incr i
+				set portlistfile [lindex $argv $i]
+				if {![file readable $portlistfile]} {
+					return -code error "Port list file \"$portlistfile\" is unreadable."
+				}
+			}
+			-q {
+				set silentmode true
+			}
+			-w {
+				set nowarn_flag true
+			}
+			-p {
+				set anyplatform_flag true
+			}
+			default {
+				print_usage
+				exit 1
+			}
+		}
+	}
+
+	# Initialize System
+	array set ui_options {}
+	array set options {}
+	array set variations {}
+	dportinit ui_options options variations
+
+	# If -i was specified, install base system and exit
+	if {$initialize_flag == "true"} {
+		initialize_system
+		exit 0
+	}
+
+	# We must have dpkg by now 
+	if {[catch {set_architecture} result]} {
+		puts "$result."
+		puts "Have you initialized the build system? Use the -i flag:"
+		print_usage
+		exit 1
+	}
+
+	# Set the platform
+	set platformString [string tolower $tcl_platform(os)]
+
+	set packagedir ${pkgrepo}/${architecture}/packages/
+	set aptpackagedir ${pkgrepo}/apt/dists/stable/main/binary-${architecture}/
+
+	# Read configuration files
+	if {[file readable $configfile]} {
+		readConfig $configfile
+	}
+
+	# If portlistfile has not been set, supply a reasonable default
+	if {![info exists portlistfile]} {
+		# The default portlist file
+		set portlistfile [file join $pkgrepo $architecture etc buildlist.txt]
+	}
+
+	# If baselistfile has not been set, supply a reasonable default
+	if {![info exists baselistfile]} {
+		# The default baselist file
+		set baselistfile [file join $pkgrepo $architecture etc baselist.txt]
+	}
+
+	# Read the port list
+	if {[file readable $portlistfile]} {
+		set portlist [readPortList $portlistfile]
+	} else {
+		set portlist ""
+	}
+
+	if {[file readable $baselistfile]} {
+		set baselist [readPortList $baselistfile]
+	} else {
+		set baselist ""
+	}
+
+	# If no portlist file was specified, create a portlist that includes all ports
+	if {[llength $portlist] == 0 || "$buildall_flag" == "true"} {
+		set res [dportsearch {.*}]
+		foreach {name array} $res {
+			lappend portlist $name
+		}
+	} else {
+		# Port list was specified. Ensure that all the specified ports are available.
+		# Add ${baselist} and get_required_ports to the list
+		set portlist [lsort -unique [concat $portlist $baselist [get_required_ports]]]
+		foreach port $portlist {
+			set fail false
+
+			if {[catch {set res [get_portinfo $port]} result]} {
+				global errorInfo
+				ui_debug "$errorInfo"
+				ui_noisy_error "Error: $result"
+				set fail true
+			}
+
+			# Add all of the specified ports' dependencies to the portlist
+			set dependencies [get_dependencies $port false]
+			foreach dep $dependencies {
+				lappend portlist [lindex $dep 0]
+			}
+		}
+		if {"$fail" == "true"} {
+			exit 1
+		}
+	}
+
+	# Clean out duplicates
+	set portlist [lsort -unique $portlist]
+
+	# Ensure that the log directory exists, and open up
+	# the default debug log
+	open_default_log w
+
+	# Set the dport options
+	# Package build path
+	set options(package.destpath) ${packagedir}
+
+	# Ensure that it exists
+	file mkdir $options(package.destpath)
+
+	# Force mode
+	set options(ports_force) yes
+
+	# Set variations (empty)
+	set variations [list]
+
+
+	if {"$silentmode" != "true" && "$nowarn_flag" != "true"} {
+		puts "WARNING: The full contents of ${portprefix}, /usr/X11R6, and /etc/X11 will be deleted by this script. If you do not want this, control-C NOW."
+		exec sleep 10
+	}
+
+	# Destroy the existing apt repository
+	if {[catch {system "rm -Rf ${aptpackagedir}"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	# Recreate
+	file mkdir ${aptpackagedir}
+
+	close_default_log
+
+	foreach port $portlist {
+		# Open the default debug log write/append
+		open_default_log
+
+		if {[catch {set res [get_portinfo $port]} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: port search failed: $error"
+			exit 1
+		}
+
+		# Reset array from previous runs
+		unset -nocomplain portinfo
+		array set portinfo [lindex $res 1]
+
+		if {![info exists portinfo(name)] ||
+			![info exists portinfo(version)] || 
+			![info exists portinfo(revision)] || 
+			![info exists portinfo(categories)]} {
+			ui_noisy_error "Internal error: $name missing some portinfo keys"
+			close $logfd
+			continue
+		}
+
+		# Skip un-supported ports
+		if {[info exists portinfo(platforms)] && ${anyplatform_flag} != "true"} {
+			if {[lsearch $portinfo(platforms) $platformString] == -1} {
+				ui_silent "Skipping unsupported port $portinfo(name) (platform: $platformString supported: $portinfo(platforms))"
+				continue
+			}
+		}
+
+
+		# Add apt override line. dpkg is special cased and marked 'required'
+		# TODO: add the ability to specify the "required" priority for specific
+		# ports in a config file.
+		if {"$portinfo(name)" == "dpkg"} {
+			set pkg_priority required
+		} else {
+			set pkg_priority optional
+		}
+		add_override $portinfo(name) $pkg_priority [lindex $portinfo(categories) 0]
+
+		# Skip up-to-date software
+		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
+		if {[file exists ${pkgfile}]} {
+			if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+				if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
+					ui_silent "Skipping ${portinfo(name)}-${portinfo(version)}-${portinfo(revision)}; package is up to date."
+					# Shove the package into the apt repository
+					copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
+					continue
+				}
+			}
+		}
+
+		# We're going to actually build the package, reset the tree
+		# if this is our first time through. The tree is always reset
+		# at the end of a packaging run, too.
+		if {$firstrun_flag == true} {
+			reset_tree
+			set firstrun_flag false
+		}
+
+		ui_silent "Building $portinfo(name) ..."
+
+		# Close the main debug log
+		close_default_log
+
+		# Create log directory and open the build log
+		file mkdir [file join ${pkgrepo} ${architecture} log build ${port}]
+		set logfd [open ${pkgrepo}/${architecture}/log/build/${port}/build.log w 0644]
+
+		# Install binary dependencies if possible
+		set dependencies [get_dependencies $portinfo(name)]
+		foreach dep $dependencies {
+			install_binary_if_available $dep
+		}
+
+		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: unable to open port: $result"
+			exit 1
+		}
+
+		if {[catch {set result [dportexec $workername clean]} result] || $result == 1} {
+			ui_noisy_error "Cleaning $portinfo(name) failed, consult build log"
+
+			# Close the log
+			close $logfd
+
+			# Copy the log to the failure directory
+			copy_failure_log $portinfo(name)
+
+			# Close the port
+			dportclose $workername
+
+			continue
+		}
+
+		# Re-open the port. DarwinPorts doesn't play well with multiple targets, apparently
+		dportclose $workername
+		if {[catch {set workername [dportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: unable to open port: $result"
+			exit 1
+		}
+
+		if {[catch {set result [dportexec $workername dpkg]} result] || $result == 1} {
+			ui_noisy_error "Packaging $portinfo(name) failed, consult build log"
+
+			# Copy the log to the failure directory
+			copy_failure_log $portinfo(name)
+
+			# Close the port
+			dportclose $workername
+
+			# Close the log
+			close $logfd
+
+			# Open default log
+			open_default_log
+
+			ui_silent "Resetting /usr/dports ..."
+			reset_tree
+			ui_silent "Done."
+
+			# Close the log
+			close $logfd
+
+			continue
+		}
+
+		ui_silent "Package build for $portinfo(name) succeeded"
+		
+		# Into the apt repository you go!
+		copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
+
+		ui_silent "Resetting /usr/dports ..."
+		reset_tree
+		ui_silent "Done."
+
+		# Close the log
+		close $logfd
+
+		# Delete any previous failure logs
+		delete_failure_log $portinfo(name)
+
+		# Close the port
+		dportclose $workername
+	}
+
+	open_default_log
+
+	# If required, rebuild the clientinstall.tgz
+	if {$basegen_flag == true} {
+		# dpkg is always required
+		set pkglist [lsort -unique [concat dpkg $baselist [get_required_ports]]]
+		set workdir [file join ${pkgrepo} ${architecture}]
+		set rootdir [file join $workdir clientroot]
+		set rootfile [file join $workdir client-root.tar.gz]
+		file mkdir ${rootdir}
+
+		# dpkg is required
+		array set portinfo [lindex [get_portinfo dpkg] 1]
+		set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
+		system "cd \"${rootdir}\" && ar x \"${pkgfile}\" data.tar.gz"
+		system "cd \"${rootdir}\" && tar xvf data.tar.gz; rm data.tar.gz"
+
+		foreach port $pkglist {
+			set dependencies [get_dependencies $port false]
+			foreach dep $dependencies {
+				lappend newpkglist [lindex $dep 0]
+			}
+		}
+
+		if {[info exists newpkglist]} {		
+			set pkglist [lsort -unique [concat $newpkglist $pkglist]]
+		}
+
+		foreach port $pkglist {
+			array set portinfo [lindex [get_portinfo $port] 1]
+			system "dpkg --root \"${rootdir}\" --force-depends -i \"[get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]\""
+		}
+
+		system "cd \"${rootdir}\" && tar cf \"[file join ${workdir} clientinstall.tar.gz]\" ."
+		file delete -force ${rootdir}
+	}
+
+	ui_silent "Building apt-get index ..."
+	if {[catch {system "cd ${pkgrepo}/apt && dpkg-scanpackages dists override >${aptpackagedir}/Packages"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+
+	if {[catch {system "cd ${aptpackagedir} && gzip Packages"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+	remove_override_file
+	ui_silent "Done."
+
+	ui_silent "Package run finished."
+	close_default_log
+
+	exit 0
+}
+
+# Return ports listed in $dpkg::requiredports that are not
+# installed
+proc get_required_ports {args} {
+	global dpkg::requiredports
+	set reqlist ""
+
+	foreach {binary port} $requiredports {
+		if {[find_binary $binary] == ""} {
+			lappend reqlist $port
+		}
+	}
+	return $reqlist
+}
+
+# Given a binary name, searches PATH
+proc find_binary {binary} {
+	global env
+	set path [split $env(PATH) :]
+	foreach dir $path {
+		set file [file join $dir $binary]
+		if {[file exists $file]} {
+			return $file
+		}
+	}
+	return ""
+}
+
+# Set the architecture global
+proc set_architecture {args} {
+	set dpkg::architecture "[exec dpkg --print-installation-architecture]"
+}
+
+# Initialize a new build system
+proc initialize_system {args} {
+	global dpkg::initialports dpkg::pkgrepo
+	global dpkg::architecture dpkg::portprefix
+
+	# Create standard directories
+	ui_msg "Creating ${pkgrepo} directory"
+	file mkdir ${pkgrepo}
+
+	set builddeps ""
+	set rundeps ""
+
+	foreach port [get_required_ports] {
+		set builddeps [concat $builddeps [get_dependencies $port true]]
+		set rundeps [concat $rundeps [get_dependencies $port false]]
+	}
+
+	set buildlist [lsort -unique $builddeps]
+
+	foreach port $builddeps {
+		if {[lsearch -exact $port $rundeps] >= 0 } {
+			lappend removelist $port
+		}
+	}
+
+	set options ""
+	set variations ""
+
+	foreach port [get_required_ports] {
+		if {[catch {do_portexec $port [array get options] [array get variants] install} result]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Fatal error: $result"
+			exit 1
+		}
+	}
+
+	if {[info exists removelist]} {
+		ui_msg "Removing build dependencies ..."
+		foreach portlist $removelist {
+			set port [lindex $portlist 0]
+
+			ui_msg "Uninstalling $port."
+			if { [catch {portuninstall::uninstall $portname $portversion} result] } {
+				global errorInfo
+				ui_debug "$errorInfo"
+				ui_noisy_errorr "Fatal error: Uninstalling $port failed: $result"
+				exit 1
+			}
+		}
+		ui_msg "Done."
+	}
+			
+
+	if {[catch {set_architecture} result]} {
+		puts "Fatal error: $result."
+		exit 1
+	}
+
+	ui_msg "Creating [file join ${pkgrepo} ${architecture}] directory"
+	file mkdir [file join ${pkgrepo} ${architecture}]
+	file mkdir [file join ${pkgrepo} ${architecture} etc]
+
+	ui_msg "Generating pristine archive: [file join ${pkgrepo} ${architecture} root.tar.gz]"
+	if {[catch {system "tar -zcf \"[file join ${pkgrepo} ${architecture} root.tar.gz]\" \"${portprefix}\""} result]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Fatal error: Archive creation failed: $result"
+		exit 1
+	}
+
+	ui_msg "Build system successfully initialized!"
+}
+
+# Execute a target on a port (by port name)
+proc do_portexec {port options variants target} {
+
+	array set portinfo [lindex [get_portinfo $port] 1]
+
+	if {[catch {set workername [dportopen $portinfo(porturl) $options $variants yes]} result] || $result == 1} {
+		return -code error "Internal error: unable to open port: $result"
+		exit 1
+	}
+
+	if {[catch {set result [dportexec $workername install]} result] || $result == 1} {
+
+		# Close the port
+		dportclose $workername
+
+		# Return error
+		return -code error "Executing target $target on $portinfo(name) failed."
+	}
+}
+
+proc get_portinfo {port} {
+	set searchstring [regex_escape_portname $port]
+	set res [dportsearch "^${searchstring}\$"]
+
+	if {[llength $res] < 2} {
+		return -code error "Port \"$port\" not found in index."
+	}
+
+	return $res
+}
+
+# Given name, version, and revision, returns the path to a package file
+proc get_pkgpath {name version revision} {
+	global dpkg::pkgrepo dpkg::architecture
+	global dpkg::packagedir
+	if {${revision} == 0} {
+		set revision ""
+	} else {
+		set revision "-${revision}"
+	}
+
+	return [string tolower ${packagedir}/${name}_${version}${revision}_${architecture}.deb]
+}
+
+# Opens the default log file and sets dpkg::logfd
+proc open_default_log {{mode a}} {
+	global dpkg::pkgrepo dpkg::architecture dpkg::logfd
+	# Ensure that the log directory exists, and open up
+	# the default debug log
+	file mkdir ${pkgrepo}/${architecture}/log/
+	set logfd [open ${pkgrepo}/${architecture}/log/debug.log ${mode} 0644]
+}
+
+# Closes the current logfile
+proc close_default_log {args} {
+	global dpkg::logfd
+	close $logfd
+}
+
+# Copies a port log file to the failure directory
+proc copy_failure_log {name} {
+	global dpkg::pkgrepo dpkg::architecture
+	# Copy the log to the failure log directory
+	file mkdir ${pkgrepo}/${architecture}/log/failure/${name}
+	file copy -force ${pkgrepo}/${architecture}/log/build/${name}/build.log ${pkgrepo}/${architecture}/log/failure/${name}/
+}
+
+# Deletes a port's failure log
+proc delete_failure_log {name} {
+	global dpkg::pkgrepo dpkg::architecture
+	if {[catch {system "rm -Rf ${pkgrepo}/${architecture}/log/failure/${name}"} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+}
+
+# Add an override entry to the apt override file
+proc add_override {name priority section {maintainer ""}} {
+	global dpkg::aptpackagedir dpkg::pkgrepo
+	set output "${name}	${priority}	${section}"
+	if {${maintainer} != ""} {
+		append output " ${maintainer}"
+	}
+	set fd [open "${pkgrepo}/apt/override" a 0644]
+	puts $fd $output
+	close $fd
+}
+
+# Deletes the apt override file
+proc remove_override_file {args} {
+	global dpkg::aptpackagedir dpkg::pkgrepo
+	if {[catch {file delete -force ${pkgrepo}/apt/override} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_noisy_error "Internal error: $error"
+		exit 1
+	}
+}
+
+# Copies a given package to the apt repository
+proc copy_pkg_to_apt {name version revision category} {
+	global dpkg::aptpackagedir
+
+	set pkgfile [get_pkgpath $name $version $revision]
+	file mkdir $aptpackagedir/main/$category
+	file link -hard $aptpackagedir/main/$category/[file tail $pkgfile] $pkgfile
+}
+
+# Recursive bottom-up approach of building a list of dependencies.
+proc get_dependencies {portname {includeBuildDeps "true"}} {
+	set result [get_dependencies_recurse $portname $includeBuildDeps]
+	return [lsort -unique $result]
+}
+
+proc get_dependencies_recurse {portname includeBuildDeps} {
+	set result {}
+	
+	set res [get_portinfo $portname]
+
+	foreach {name array} $res {
+		array set portinfo $array
+		if {![info exists portinfo(name)] ||
+			![info exists portinfo(version)] || 
+			![info exists portinfo(revision)] || 
+			![info exists portinfo(categories)]} {
+			ui_error "Internal error: $name missing some portinfo keys"
+			continue
+		}
+
+		lappend result [list $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]]
+
+		# Append the package's dependents to the result list
+		set depends {}
+		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
+			eval "lappend depends $portinfo(depends_build)"
+		}
+		foreach depspec $depends {
+			set dep [lindex [split $depspec :] end]
+			set x [get_dependencies_recurse $dep $includeBuildDeps]
+			eval "lappend result $x"
+			set result [lsort -unique $result]
+		}
+	}
+	return $result
+}
+
+# Install binary packages if they've already been built.  This will
+# speed up the testing, since we won't have to recompile dependencies
+# which have already been compiled.
+
+proc install_binary_if_available {dep} {
+	global dpkg::architecture dpkg::pkgrepo dpkg::portprefix
+
+	set portname [lindex $dep 0]
+	set portversion [lindex $dep 1]
+	set portrevision [lindex $dep 2]
+	set category [lindex $dep 3]
+
+	if {${portrevision} != ""} {
+		set verstring ${portversion}_${portrevision}
+	} else {
+		set verstring ${portversion}
+	}
+	
+	set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
+	set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
+
+	# Check if the package is available, and ensure that it has not already been
+	# installed through darwinports (bootstrap packages such as dpkg and its
+	# dependencies are always installed)
+	if {[file readable $pkgpath] && ![file exists $receiptdir/receipt.bz2]} {
+		ui_silent "Installing binary: $pkgpath"
+		if {[catch {system "dpkg --force-depends -i ${pkgpath}"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: $error"
+			exit 1
+		}
+		# Touch the receipt
+		file mkdir $receiptdir
+		if {[catch {system "touch [file join $receiptdir receipt.bz2]"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_noisy_error "Internal error: $error"
+			exit 1
+		}
+	}
+}
+
+### main() entry point ####
+main $argc $argv

Deleted: trunk/base/portmgr/packaging/mpkgall.tcl
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/mpkgall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/mpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,336 +0,0 @@
-#!/usr/bin/env tclsh
-# mpkgall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-array set ui_options {}
-
-proc ui_prefix {priority} {
-	return ""
-}
-
-proc ui_channels {priority} {
-	return {}
-}
-
-# copy binary packages if they've already been built.
-
-proc copy_package_if_available {portname basepath destpath} {
-
-	set dependencies {}
-
-	# XXX: don't overwrite Apple X11
-	# XXX: probably should exclude KDE here too
-	if {$portname == "XFree86"} { return {} }
-	
-	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
-		puts stderr "Internal error: port search failed: $error"
-		return
-	}
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)]} { return -1 }
-		if {![info exists portinfo(version)]} { return -1 }
-		if {![info exists portinfo(categories)]} { return -1 }
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set category [lindex $portinfo(categories) 0]
-		
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set result [copy_package_if_available $dep $basepath $destpath]
-			if {$result == -1} { 
-				return -1
-			} else {
-				eval "lappend dependencies $result"
-			}
-		}
-		
-		set pkgname "${portname}-${portversion}.pkg"
-		lappend dependencies $pkgname
-		set pkgpath "${basepath}/${category}/${pkgname}"
-		if {[file readable "${pkgpath}/Contents/Info.plist"]} {
-			puts stderr "copying package: ${pkgpath} to ${destpath}"
-			if {[catch {system "cp -R ${pkgpath} ${destpath}/"} error]} {
-				puts stderr "Internal error: $error"
-			}
-		} else {
-			puts stderr "package ${pkgname} not found"
-			return -1
-		}
-	}
-	
-	return $dependencies
-}
-
-proc write_description_plist {infofile portname portversion description} {
-	set infofd [open ${infofile} w+]
-	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-}
-	puts $infofd "<dict>
-	<key>IFPkgDescriptionDeleteWarning</key>
-	<string></string>
-	<key>IFPkgDescriptionDescription</key>
-	<string>${description}</string>
-	<key>IFPkgDescriptionTitle</key>
-	<string>${portname}</string>
-	<key>IFPkgDescriptionVersion</key>
-	<string>${portversion}</string>
-</dict>
-</plist>"
-	close $infofd
-}
-
-proc write_welcome_html {filename portname portversion long_description description homepage} {
-    set fd [open ${filename} w+]
-    if {$long_description == ""} {
-	set long_description $description
-    }
-
-puts $fd "
-<html lang=\"en\">
-<head>
-	<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">
-	<title>Install ${portname}</title>
-</head>
-<body>
-<font face=\"Helvetica\"><b>Welcome to the ${portname} for Mac OS X Installer</b></font>
-<p>
-<font face=\"Helvetica\">${long_description}</font>
-<p>"
-
-    if {$homepage != ""} {
-	puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
-    }
-
-    puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
-</body>
-</html>"
-
-    close $fd
-}
-
-proc write_PkgInfo {infofile} {
-	set infofd [open ${infofile} w+]
-	puts $infofd "pmkrpkg1"
-	close $infofd
-}
-
-proc mpkg_write_info_plist {infofile portname portversion portrevision destination dependencies} {
-	set vers [split $portversion "."]
-	
-	if {[string index $destination end] != "/"} {
-		append destination /
-	}
-	
-	set depxml ""
-	foreach dep $dependencies {
-		append depxml "<dict>
-			<key>IFPkgFlagPackageLocation</key>
-			<string>${dep}</string>
-			<key>IFPkgFlagPackageSelection</key>
-			<string>selected</string>
-		</dict>
-		"
-	}
-
-	set infofd [open ${infofile} w+]
-	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-}
-	puts $infofd "<dict>
-	<key>CFBundleGetInfoString</key>
-	<string>${portname} ${portversion}</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.opendarwin.darwinports.mpkg.${portname}</string>
-	<key>CFBundleName</key>
-	<string>${portname}</string>
-	<key>CFBundleShortVersionString</key>
-	<string>${portversion}</string>
-	<key>IFMajorVersion</key>
-	<integer>${portrevision}</integer>
-	<key>IFMinorVersion</key>
-	<integer>0</integer>
-	<key>IFPkgFlagComponentDirectory</key>
-	<string>./Contents/Resources</string>
-	<key>IFPkgFlagPackageList</key>
-	<array>
-		${depxml}</array>
-	<key>IFPkgFormatVersion</key>
-	<real>0.10000000149011612</real>
-</dict>
-</plist>"
-	close $infofd
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-#	set ui_options(ports_verbose) yes
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-        lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-foreach {name array} $res {
-	global prefix
-	array unset portinfo
-	array set portinfo $array
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase "/darwinports/pkgs/"
-	set mpkgbase "/darwinports/mpkgs/"
-	set porturl $portinfo(porturl)
-	set prefix "/opt/local"
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
-			if {[file readable $mpkgfile] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
-				continue
-			}
-		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the mpkg:
-	# - create an mpkg skeleton
-	# - copy dependent pkgs into Contents/Resources directory
-
-	set portname ""
-	set portversion ""
-	set description ""
-	set long_description ""
-	set homepage ""
-	set category ""
-
-	if {[info exists portinfo(name)]} {	set portname $portinfo(name) }
-	if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
-	if {[info exists portinfo(description)]} { set description $portinfo(description) }
-	if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
-	if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
-	if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
-	if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
-	
-	puts "meta-packaging ${category}/${portname}-${portversion}"
-
-	set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
-
-	if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	
-	# list of .pkg names for dependencies,
-	# built up by copy_package_if_available, and used in the Info.plist
-	set dependencies {}
-	set result [copy_package_if_available ${portname} $pkgbase "${mpkgpath}/Contents/Resources/"]
-	if {$result == -1} {
-		puts stderr "aborting; one or more dependencies was missing."
-		if {[catch {system "rm -R ${mpkgpath}"} error]} {
-			puts stderr "Internal error: $error"
-		}
-		continue
-	} else {
-		set result [lsort -uniq $result]
-		eval "lappend dependencies $result"
-	}
-	
-	#
-	# Begin quote from portmpkg.tcl
-	#
-    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
-    mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
-    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage} {
-	if {![info exists $variable]} {
-	    set pkg_$variable ""
-	} else {
-	    set pkg_$variable [set $variable]
-	}
-    }
-    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
-    file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
-			${mpkgpath}/Contents/Resources/background.tiff
-	#
-	# End quote from portmpkg.tcl
-	#
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/packaging/mpkgall.tcl (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/mpkgall.tcl)
===================================================================
--- trunk/base/portmgr/packaging/mpkgall.tcl	                        (rev 0)
+++ trunk/base/portmgr/packaging/mpkgall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,336 @@
+#!/usr/bin/env tclsh
+# mpkgall.tcl
+# $Id$
+#
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2002 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+package require darwinports
+
+# globals
+set portdir .
+array set ui_options {}
+
+proc ui_prefix {priority} {
+	return ""
+}
+
+proc ui_channels {priority} {
+	return {}
+}
+
+# copy binary packages if they've already been built.
+
+proc copy_package_if_available {portname basepath destpath} {
+
+	set dependencies {}
+
+	# XXX: don't overwrite Apple X11
+	# XXX: probably should exclude KDE here too
+	if {$portname == "XFree86"} { return {} }
+	
+	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
+		puts stderr "Internal error: port search failed: $error"
+		return
+	}
+	foreach {name array} $res {
+		array set portinfo $array
+		if {![info exists portinfo(name)]} { return -1 }
+		if {![info exists portinfo(version)]} { return -1 }
+		if {![info exists portinfo(categories)]} { return -1 }
+		
+		set portname $portinfo(name)
+		set portversion $portinfo(version)
+		set category [lindex $portinfo(categories) 0]
+		
+		set depends {}
+		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+		#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
+		foreach depspec $depends {
+			set dep [lindex [split $depspec :] end]
+			set result [copy_package_if_available $dep $basepath $destpath]
+			if {$result == -1} { 
+				return -1
+			} else {
+				eval "lappend dependencies $result"
+			}
+		}
+		
+		set pkgname "${portname}-${portversion}.pkg"
+		lappend dependencies $pkgname
+		set pkgpath "${basepath}/${category}/${pkgname}"
+		if {[file readable "${pkgpath}/Contents/Info.plist"]} {
+			puts stderr "copying package: ${pkgpath} to ${destpath}"
+			if {[catch {system "cp -R ${pkgpath} ${destpath}/"} error]} {
+				puts stderr "Internal error: $error"
+			}
+		} else {
+			puts stderr "package ${pkgname} not found"
+			return -1
+		}
+	}
+	
+	return $dependencies
+}
+
+proc write_description_plist {infofile portname portversion description} {
+	set infofd [open ${infofile} w+]
+	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+}
+	puts $infofd "<dict>
+	<key>IFPkgDescriptionDeleteWarning</key>
+	<string></string>
+	<key>IFPkgDescriptionDescription</key>
+	<string>${description}</string>
+	<key>IFPkgDescriptionTitle</key>
+	<string>${portname}</string>
+	<key>IFPkgDescriptionVersion</key>
+	<string>${portversion}</string>
+</dict>
+</plist>"
+	close $infofd
+}
+
+proc write_welcome_html {filename portname portversion long_description description homepage} {
+    set fd [open ${filename} w+]
+    if {$long_description == ""} {
+	set long_description $description
+    }
+
+puts $fd "
+<html lang=\"en\">
+<head>
+	<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">
+	<title>Install ${portname}</title>
+</head>
+<body>
+<font face=\"Helvetica\"><b>Welcome to the ${portname} for Mac OS X Installer</b></font>
+<p>
+<font face=\"Helvetica\">${long_description}</font>
+<p>"
+
+    if {$homepage != ""} {
+	puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
+    }
+
+    puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
+</body>
+</html>"
+
+    close $fd
+}
+
+proc write_PkgInfo {infofile} {
+	set infofd [open ${infofile} w+]
+	puts $infofd "pmkrpkg1"
+	close $infofd
+}
+
+proc mpkg_write_info_plist {infofile portname portversion portrevision destination dependencies} {
+	set vers [split $portversion "."]
+	
+	if {[string index $destination end] != "/"} {
+		append destination /
+	}
+	
+	set depxml ""
+	foreach dep $dependencies {
+		append depxml "<dict>
+			<key>IFPkgFlagPackageLocation</key>
+			<string>${dep}</string>
+			<key>IFPkgFlagPackageSelection</key>
+			<string>selected</string>
+		</dict>
+		"
+	}
+
+	set infofd [open ${infofile} w+]
+	puts $infofd {<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+}
+	puts $infofd "<dict>
+	<key>CFBundleGetInfoString</key>
+	<string>${portname} ${portversion}</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.opendarwin.darwinports.mpkg.${portname}</string>
+	<key>CFBundleName</key>
+	<string>${portname}</string>
+	<key>CFBundleShortVersionString</key>
+	<string>${portversion}</string>
+	<key>IFMajorVersion</key>
+	<integer>${portrevision}</integer>
+	<key>IFMinorVersion</key>
+	<integer>0</integer>
+	<key>IFPkgFlagComponentDirectory</key>
+	<string>./Contents/Resources</string>
+	<key>IFPkgFlagPackageList</key>
+	<array>
+		${depxml}</array>
+	<key>IFPkgFormatVersion</key>
+	<real>0.10000000149011612</real>
+</dict>
+</plist>"
+	close $infofd
+}
+
+
+# Standard procedures
+
+proc fatal args {
+    global argv0
+    puts stderr "$argv0: $args"
+    exit
+}
+
+# Main
+array set options [list]
+array set variations [list]
+#	set ui_options(ports_verbose) yes
+
+if {[catch {dportinit ui_options options variations} result]} {
+    puts "Failed to initialize ports system, $result"
+    exit 1
+}
+
+package require Pextlib
+
+# If no arguments were given, default to all ports.
+if {[llength $argv] == 0} {
+        lappend argv ".*"
+}
+
+foreach pname $argv {
+
+if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
+	puts "port search failed: $result"
+	exit 1
+}
+
+foreach {name array} $res {
+	global prefix
+	array unset portinfo
+	array set portinfo $array
+
+	if {![info exists portinfo(porturl)]} {
+		puts stderr "Internal error: no porturl for $name"
+		continue
+	}
+	
+	set pkgbase "/darwinports/pkgs/"
+	set mpkgbase "/darwinports/mpkgs/"
+	set porturl $portinfo(porturl)
+	set prefix "/opt/local"
+
+	# Skip up-to-date packages
+	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+		if {[info exists portinfo(name)] &&
+			[info exists portinfo(version)] &&
+			[info exists portinfo(categories)]} {
+			set portname $portinfo(name)
+			set portversion $portinfo(version)
+			set category [lindex $portinfo(categories) 0]
+			set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
+			if {[file readable $mpkgfile] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
+				puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
+				continue
+			}
+		}
+	}
+	
+	# Skipt packages which previously failed
+		
+	# Building the mpkg:
+	# - create an mpkg skeleton
+	# - copy dependent pkgs into Contents/Resources directory
+
+	set portname ""
+	set portversion ""
+	set description ""
+	set long_description ""
+	set homepage ""
+	set category ""
+
+	if {[info exists portinfo(name)]} {	set portname $portinfo(name) }
+	if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
+	if {[info exists portinfo(description)]} { set description $portinfo(description) }
+	if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
+	if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
+	if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
+	if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
+	
+	puts "meta-packaging ${category}/${portname}-${portversion}"
+
+	set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
+
+	if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	
+	# list of .pkg names for dependencies,
+	# built up by copy_package_if_available, and used in the Info.plist
+	set dependencies {}
+	set result [copy_package_if_available ${portname} $pkgbase "${mpkgpath}/Contents/Resources/"]
+	if {$result == -1} {
+		puts stderr "aborting; one or more dependencies was missing."
+		if {[catch {system "rm -R ${mpkgpath}"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		continue
+	} else {
+		set result [lsort -uniq $result]
+		eval "lappend dependencies $result"
+	}
+	
+	#
+	# Begin quote from portmpkg.tcl
+	#
+    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
+    mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
+    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
+    # long_description, description, or homepage may not exist
+    foreach variable {long_description description homepage} {
+	if {![info exists $variable]} {
+	    set pkg_$variable ""
+	} else {
+	    set pkg_$variable [set $variable]
+	}
+    }
+    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
+    file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
+			${mpkgpath}/Contents/Resources/background.tiff
+	#
+	# End quote from portmpkg.tcl
+	#
+}
+
+}
+# end foreach pname

Deleted: trunk/base/portmgr/packaging/packageall.tcl
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/packageall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/packageall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,421 +0,0 @@
-#!/usr/bin/env tclsh
-# packageall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-
-# UI Instantiations
-array set ui_options {}
-# ui_options(ports_debug) - If set, output debugging messages.
-# ui_options(ports_verbose) - If set, output info messages (ui_info)
-# ui_options(ports_quiet) - If set, don't output "standard messages"
-
-# ui_options accessor
-proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) == "yes"} {
-	    return 1
-	}
-    }
-    return 0
-}
-
-# UI Callback 
-
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
-			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
-			}
-		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
-			} else {
-				return {stdout}
-			}
-		}
-        default {
-        	return {stdout}
-        }
-    }
-}
-	
-proc pkg_ui_log {message} {
-    global logfd
-    if {[string length $logfd] > 0 } {
-	log_message $logfd $message
-    }
-}
-
-proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname includeBuildDeps} {
-	set result {}
-	
-	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Internal error: port search failed: $error"
-		return {}
-	}
-	foreach {name array} $res {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set category [lindex $portinfo(categories) 0]
-
-		# Append the package itself to the result list
-		#set pkgpath ${category}/${portname}-${portversion}.pkg
-		lappend result [list $portname $portversion $category]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep basepath} {
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set category [lindex $dep 2]
-	
-	set pkgpath ${basepath}/${category}/${portname}-${portversion}.pkg
-	if {[file readable $pkgpath]} {
-		ui_msg "installing binary: $pkgpath"
-		if {[catch {system "cd / && gunzip -c ${pkgpath}/Contents/Archive.pax.gz | pax -r"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Internal error: $error"
-		}
-		# Touch the receipt
-		# xxx: use some variable to describe this path
-		if {[catch {system "touch /opt/local/var/db/dports/receipts/${portname}-${portversion}.bz2"} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Internal error: $error"
-		}
-	}
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-#	set ui_options(ports_verbose) yes
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-	lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-set logpath "/darwinports/logs"
-set logfd ""
-
-foreach {name array} $res {
-	array unset portinfo
-	array set portinfo $array
-
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt from getting logged.
-	set ui_options(ports_verbose) no
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase /darwinports/pkgs/
-	set porturl $portinfo(porturl)
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
-			if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; package is up to date."
-				continue
-			}
-		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the port:
-	# - remove /opt so it won't pollute the port.
-	# - re-install DarwinPorts.
-	# - keep distfiles outside /opt so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
-
-	ui_msg "removing /opt"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/X11"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/fonts"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
-
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {[string length $logfd] > 0} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
-
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
-
-	set valid 1
-
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
-
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The DarwinPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
-
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
-		}
-	}
-
-	ui_msg "packaging ${category}/${portname}-${portversion}"
-
-	# Install binary dependencies if we can, to speed things up.
-	#set depends {}
-	#if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-	#if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-	#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-	#foreach depspec $depends {
-	#	set dep [lindex [split $depspec :] end]
-		#install_binary_if_available $dep $pkgbase
-	#}
-	set dependencies [get_dependencies $portname 1]
-	set dependencies [lsort -unique $dependencies]
-	foreach dep $dependencies {
-		install_binary_if_available $dep $pkgbase
-	}
-
-	set options(package.type) pkg
-	set options(package.destpath) ${pkgbase}/${category}/
-
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	if {[catch {set workername [dportopen $porturl [array get options] [array get variations] yes]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}	
-	if {[catch {set result [dportexec $workername pkg]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
-		dportclose $workername
-	    continue
-	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
-
-	dportclose $workername
-
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/packaging/packageall.tcl (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/packageall.tcl)
===================================================================
--- trunk/base/portmgr/packaging/packageall.tcl	                        (rev 0)
+++ trunk/base/portmgr/packaging/packageall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,421 @@
+#!/usr/bin/env tclsh
+# packageall.tcl
+# $Id$
+#
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2002 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+package require darwinports
+
+# globals
+set portdir .
+
+# UI Instantiations
+array set ui_options {}
+# ui_options(ports_debug) - If set, output debugging messages.
+# ui_options(ports_verbose) - If set, output info messages (ui_info)
+# ui_options(ports_quiet) - If set, don't output "standard messages"
+
+# ui_options accessor
+proc ui_isset {val} {
+    global ui_options
+    if {[info exists ui_options($val)]} {
+	if {$ui_options($val) == "yes"} {
+	    return 1
+	}
+    }
+    return 0
+}
+
+# UI Callback 
+
+proc ui_prefix {priority} {
+    switch $priority {
+        debug {
+        	return "DEBUG: "
+        }
+        error {
+        	return "Error: "
+        }
+        warn {
+        	return "Warning: "
+        }
+        default {
+        	return ""
+        }
+    }
+}
+
+proc ui_channels {priority} {
+    global logfd
+    switch $priority {
+        debug {
+            if {[ui_isset ports_debug]} {
+            	return {stdout}
+            } else {
+            	return {}
+            }
+        }
+        info {
+			# put verbose stuff only to the log file
+            if {[ui_isset ports_verbose]} {
+                return {$logfd}
+            } else {
+                return {}
+			}
+		}
+        msg {
+            if {[ui_isset ports_quiet]} {
+                return {}
+			} else {
+				return {stdout}
+			}
+		}
+        default {
+        	return {stdout}
+        }
+    }
+}
+	
+proc pkg_ui_log {message} {
+    global logfd
+    if {[string length $logfd] > 0 } {
+	log_message $logfd $message
+    }
+}
+
+proc log_message {channel message} {
+    seek $channel 0 end
+    puts $channel $message
+    flush $channel
+}
+
+# Recursive bottom-up approach of building a list of dependencies.
+proc get_dependencies {portname includeBuildDeps} {
+	set result {}
+	
+	if {[catch {set res [dportsearch "^$portname\$"]} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "Internal error: port search failed: $error"
+		return {}
+	}
+	foreach {name array} $res {
+		array set portinfo $array
+		if {![info exists portinfo(name)] ||
+			![info exists portinfo(version)] || 
+			![info exists portinfo(categories)]} {
+			ui_error "Internal error: $name missing some portinfo keys"
+			continue
+		}
+		
+		set portname $portinfo(name)
+		set portversion $portinfo(version)
+		set category [lindex $portinfo(categories) 0]
+
+		# Append the package itself to the result list
+		#set pkgpath ${category}/${portname}-${portversion}.pkg
+		lappend result [list $portname $portversion $category]
+
+		# Append the package's dependents to the result list
+		set depends {}
+		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
+			eval "lappend depends $portinfo(depends_build)"
+		}
+		foreach depspec $depends {
+			set dep [lindex [split $depspec :] end]
+			set x [get_dependencies $dep $includeBuildDeps]
+			eval "lappend result $x"
+			set result [lsort -unique $result]
+		}
+	}
+	return $result
+}
+
+# Install binary packages if they've already been built.  This will
+# speed up the testing, since we won't have to recompile dependencies
+# which have already been compiled.
+
+proc install_binary_if_available {dep basepath} {
+	set portname [lindex $dep 0]
+	set portversion [lindex $dep 1]
+	set category [lindex $dep 2]
+	
+	set pkgpath ${basepath}/${category}/${portname}-${portversion}.pkg
+	if {[file readable $pkgpath]} {
+		ui_msg "installing binary: $pkgpath"
+		if {[catch {system "cd / && gunzip -c ${pkgpath}/Contents/Archive.pax.gz | pax -r"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Internal error: $error"
+		}
+		# Touch the receipt
+		# xxx: use some variable to describe this path
+		if {[catch {system "touch /opt/local/var/db/dports/receipts/${portname}-${portversion}.bz2"} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Internal error: $error"
+		}
+	}
+}
+
+
+# Standard procedures
+
+proc fatal args {
+    global argv0
+    puts stderr "$argv0: $args"
+    exit
+}
+
+# Main
+array set options [list]
+array set variations [list]
+#	set ui_options(ports_verbose) yes
+
+if {[catch {dportinit ui_options options variations} result]} {
+    puts "Failed to initialize ports system, $result"
+    exit 1
+}
+
+package require Pextlib
+
+# If no arguments were given, default to all ports.
+if {[llength $argv] == 0} {
+	lappend argv ".*"
+}
+
+foreach pname $argv {
+
+if {[catch {set res [dportsearch "^${pname}\$"]} result]} {
+	puts "port search failed: $result"
+	exit 1
+}
+
+set logpath "/darwinports/logs"
+set logfd ""
+
+foreach {name array} $res {
+	array unset portinfo
+	array set portinfo $array
+
+	# Start with verbose output off;
+	# this will prevent the repopulation of /opt from getting logged.
+	set ui_options(ports_verbose) no
+
+	if {![info exists portinfo(porturl)]} {
+		puts stderr "Internal error: no porturl for $name"
+		continue
+	}
+	
+	set pkgbase /darwinports/pkgs/
+	set porturl $portinfo(porturl)
+
+	# Skip up-to-date packages
+	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+		if {[info exists portinfo(name)] &&
+			[info exists portinfo(version)] &&
+			[info exists portinfo(categories)]} {
+			set portname $portinfo(name)
+			set portversion $portinfo(version)
+			set category [lindex $portinfo(categories) 0]
+			set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
+			if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
+				puts stderr "Skipping ${portname}-${portversion}; package is up to date."
+				continue
+			}
+		}
+	}
+	
+	# Skipt packages which previously failed
+		
+	# Building the port:
+	# - remove /opt so it won't pollute the port.
+	# - re-install DarwinPorts.
+	# - keep distfiles outside /opt so we don't have to keep fetching them.
+	# - send out an email to the maintainer if any errors occurred.
+
+	ui_msg "removing /opt"
+	#unset ui_options(ports_verbose)
+	if {[catch {system "rm -Rf /opt"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "rm -Rf /etc/X11"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "rm -Rf /etc/fonts"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	#set ui_options(ports_verbose) yes
+
+	# If there was a log file left over from the previous pass,
+	# then the port failed with an error.  Send the log in an
+	# email to the maintainers.
+	if {[string length $logfd] > 0} {
+		close $logfd
+		set logfd ""
+	}
+	#if {[file readable $logfilename]} {
+	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
+	#		puts stderr "Internal error: $error"
+	#	}
+	#}
+
+	# Open the log file for writing
+	set logfd [open ${logpath}/${name}.log w]
+
+	set valid 1
+
+	set lint_errors {}
+	set portname ""
+	set portversion ""
+	set description ""
+	set category ""
+
+	if {![info exists portinfo(name)]} {
+		lappend lint_errors "missing name key"
+		set valid 0
+	} else {
+		set portname $portinfo(name)
+	}
+	
+	if {![info exists portinfo(description)]} {
+		lappend lint_errors "missing description key"
+		set valid 0
+	} else {
+		set description $portinfo(description)
+	}
+	
+	if {![info exists portinfo(version)]} {
+		lappend lint_errors "missing version key"
+		set valid 0
+	} else {
+		set portversion $portinfo(version)
+	}
+	
+	if {![info exists portinfo(categories)]} {
+		lappend lint_errors "missing categories key"
+		set valid 0
+	} else {
+		set category [lindex $portinfo(categories) 0]
+	}
+	
+	if {![info exists portinfo(maintainers)]} {
+		append lint_errors "missing maintainers key"
+		set valid 0
+		set maintainers kevin at opendarwin.org
+	} else {
+		set maintainers $portinfo(maintainers)
+	}
+	
+	pkg_ui_log "To: [join $maintainers {, }]"
+	pkg_ui_log "From: donotreply at opendarwin.org"
+	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
+	pkg_ui_log ""
+	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
+	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
+	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
+	pkg_ui_log "the port as soon as possible."
+	pkg_ui_log ""
+	pkg_ui_log ""
+	pkg_ui_log "Thank you,"
+	pkg_ui_log "The DarwinPorts Team"
+	pkg_ui_log ""
+	pkg_ui_log "================================================================================"
+	pkg_ui_log ""
+
+	if {!$valid} {
+		foreach error $lint_errors {
+			ui_error $error
+		}
+	}
+
+	ui_msg "packaging ${category}/${portname}-${portversion}"
+
+	# Install binary dependencies if we can, to speed things up.
+	#set depends {}
+	#if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+	#if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+	#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
+	#foreach depspec $depends {
+	#	set dep [lindex [split $depspec :] end]
+		#install_binary_if_available $dep $pkgbase
+	#}
+	set dependencies [get_dependencies $portname 1]
+	set dependencies [lsort -unique $dependencies]
+	foreach dep $dependencies {
+		install_binary_if_available $dep $pkgbase
+	}
+
+	set options(package.type) pkg
+	set options(package.destpath) ${pkgbase}/${category}/
+
+	# Turn on verbose output for the build
+	set ui_options(ports_verbose) yes
+	if {[catch {set workername [dportopen $porturl [array get options] [array get variations] yes]} result] ||
+		$result == 1} {
+		global errorInfo
+		ui_debug "$errorInfo"
+	    ui_error "Internal error: unable to open port: $result"
+	    continue
+	}	
+	if {[catch {set result [dportexec $workername pkg]} result] ||
+		$result == 1} {
+		global errorInfo
+		ui_debug "$errorInfo"
+	    ui_error "port package failed: $result"
+		dportclose $workername
+	    continue
+	}
+	set ui_options(ports_verbose) no
+	# Turn verbose output off after the build
+
+	dportclose $workername
+
+	# We made it to the end.  We can delete the log file.
+	close $logfd
+	set logfd ""
+	file delete ${logpath}/${name}.log
+}
+
+}
+# end foreach pname

Deleted: trunk/base/portmgr/packaging/rpmall.tcl
===================================================================
--- branches/dp2mp-move/base/portmgr/packaging/rpmall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/packaging/rpmall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,494 +0,0 @@
-#!/usr/bin/env tclsh
-# rpmall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Benjamin Reed <ranger at befunk.com>
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-
-# UI Instantiations
-array set ui_options {}
-# ui_options(ports_debug) - If set, output debugging messages.
-# ui_options(ports_verbose) - If set, output info messages (ui_info)
-# ui_options(ports_quiet) - If set, don't output "standard messages"
-
-# ui_options accessor
-proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) == "yes"} {
-	    return 1
-	}
-    }
-    return 0
-}
-
-set options(package.destpath) "/darwinports/rpms"
-
-# UI Callback 
-
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
-			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
-			}
-		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
-			} else {
-				return {stdout}
-			}
-		}
-        default {
-        	return {stdout}
-        }
-    }
-}
-	
-proc pkg_ui_log {message} {
-    global logfd
-    if {[string length $logfd] > 0 } {
-	log_message $logfd $message
-    }
-}
-
-proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname includeBuildDeps} {
-	set result {}
-	
-	if {[catch {set search [dportsearch "^$portname\$"]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Internal error: port search failed: $error"
-		return {}
-	}
-	foreach {name array} $search {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-		if {![info exists portinfo(revision)]} {
-			set portinfo(revision) 0
-		}
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set revision $portinfo(revision)
-
-		# Append the package itself to the result list
-		lappend result [list $portname $portversion $revision]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set revision [lindex $dep 2]
-
-	foreach dir {"${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-		foreach arch {"ppc" "i386" "fat"} {
-			set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-			if {[file readable $rpmpath]} {
-				ui_msg "Installing binary: $rpmpath"
-				if {[catch {system "rpm -Uvh --force $rpmpath"} error ]} {
-					global errorInfo
-					ui_debug "$errorInfo"
-					ui_error "Internal error: $error"
-				} else {
-					return true
-				}
-			}
-		}
-	}
-	return false
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-
-#	set ui_options(ports_verbose) yes
-if {![file exists /usr/bin/sw_vers]} {
-	set variations(puredarwin) "+"
-}
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-	lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set allpackages [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-set logpath "/darwinports/logs"
-set logfd ""
-
-foreach {name array} $allpackages {
-	array unset portinfo
-	array set portinfo $array
-
-	#ui_msg "foo $portinfo(porturl)"
-
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt from getting logged.
-	set ui_options(ports_verbose) no
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	if {![info exists portinfo(revision)]} {
-		set portinfo(revision) 0
-	}
-
-	set porturl $portinfo(porturl)
-
-	# this is used to short-circuit the RPM check and
-	# move on to the next package
-
-	global exit_loop
-	set exit_loop false
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
-
-			foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-				foreach arch {"ppc" "i386" "fat"} {
-					set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-					#ui_msg "trying ${rpmpath}"
-					if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
-						puts stderr "->    skipping ${portname}-${portversion}; package is up to date."
-						set exit_loop true
-						break
-					}
-				}
-				if {${exit_loop}} {
-					break
-				}
-			}
-		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Skip packages which previously failed
-	set exit_loop false
-		
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
-
-			set logfilepath "${logpath}/${portname}.log"
-			if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "->    skipping ${portname}-${portversion}; package failed, but has not changed."
-				set exit_loop true
-			}
-		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Building the port:
-	# - remove /opt so it won't pollute the port.
-	# - re-install DarwinPorts.
-	# - keep distfiles outside /opt so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
-
-	set remove_files ""
-	foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-		foreach arch {"ppc" "i386" "fat"} {
-			set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
-		}
-	}
-	system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
-
-	ui_msg "->    Removing /opt"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	# this is bad on pure darwin  :)
-	#if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/X11"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/fonts"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	ui_msg "->    Installing darwinports"
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
-
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {[string length $logfd] > 0} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
-
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
-
-	set valid 1
-
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
-
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The DarwinPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
-
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
-		}
-	}
-
-	ui_msg "-->   Packaging ${category}/${portname}-${portversion}"
-
-	foreach prebuild {"ccache" "rpm" "unzip"} {
-		if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
-			ui_msg "--->  Pre-installing ${prebuild}"
-			if {[catch {set search [dportsearch "^${prebuild}\$"]} error]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: port search ${prebuild} failed: $error"
-			}
-			array set prebuildinfo [lindex $search 1]
-			set ui_options(ports_verbose) yes
-			if {[catch {set workername [dportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: unable to install ${prebuild}... exiting"
-				exit 1
-			}
-			if {[catch {set result [dportexec $workername install]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "installation of ${prebuild} failed: $result"
-				dportclose $workername
-				exit 1
-			}
-		}
-	}
-
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	if {[catch {set workername [dportopen $porturl [array get options] [array get variations]]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}
-	if {[catch {set result [dportexec $workername rpmpackage]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
-		dportclose $workername
-	    continue
-	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
-
-	dportclose $workername
-
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/packaging/rpmall.tcl (from rev 26176, branches/dp2mp-move/base/portmgr/packaging/rpmall.tcl)
===================================================================
--- trunk/base/portmgr/packaging/rpmall.tcl	                        (rev 0)
+++ trunk/base/portmgr/packaging/rpmall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,494 @@
+#!/usr/bin/env tclsh
+# rpmall.tcl
+# $Id$
+#
+# Copyright (c) 2003 Benjamin Reed <ranger at befunk.com>
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2002 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+package require darwinports
+
+# globals
+set portdir .
+
+# UI Instantiations
+array set ui_options {}
+# ui_options(ports_debug) - If set, output debugging messages.
+# ui_options(ports_verbose) - If set, output info messages (ui_info)
+# ui_options(ports_quiet) - If set, don't output "standard messages"
+
+# ui_options accessor
+proc ui_isset {val} {
+    global ui_options
+    if {[info exists ui_options($val)]} {
+	if {$ui_options($val) == "yes"} {
+	    return 1
+	}
+    }
+    return 0
+}
+
+set options(package.destpath) "/darwinports/rpms"
+
+# UI Callback 
+
+proc ui_prefix {priority} {
+    switch $priority {
+        debug {
+        	return "DEBUG: "
+        }
+        error {
+        	return "Error: "
+        }
+        warn {
+        	return "Warning: "
+        }
+        default {
+        	return ""
+        }
+    }
+}
+
+proc ui_channels {priority} {
+    global logfd
+    switch $priority {
+        debug {
+            if {[ui_isset ports_debug]} {
+            	return {stdout}
+            } else {
+            	return {}
+            }
+        }
+        info {
+			# put verbose stuff only to the log file
+            if {[ui_isset ports_verbose]} {
+                return {$logfd}
+            } else {
+                return {}
+			}
+		}
+        msg {
+            if {[ui_isset ports_quiet]} {
+                return {}
+			} else {
+				return {stdout}
+			}
+		}
+        default {
+        	return {stdout}
+        }
+    }
+}
+	
+proc pkg_ui_log {message} {
+    global logfd
+    if {[string length $logfd] > 0 } {
+	log_message $logfd $message
+    }
+}
+
+proc log_message {channel message} {
+    seek $channel 0 end
+    puts $channel $message
+    flush $channel
+}
+
+# Recursive bottom-up approach of building a list of dependencies.
+proc get_dependencies {portname includeBuildDeps} {
+	set result {}
+	
+	if {[catch {set search [dportsearch "^$portname\$"]} error]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "Internal error: port search failed: $error"
+		return {}
+	}
+	foreach {name array} $search {
+		array set portinfo $array
+		if {![info exists portinfo(name)] ||
+			![info exists portinfo(version)] || 
+			![info exists portinfo(categories)]} {
+			ui_error "Internal error: $name missing some portinfo keys"
+			continue
+		}
+		if {![info exists portinfo(revision)]} {
+			set portinfo(revision) 0
+		}
+		
+		set portname $portinfo(name)
+		set portversion $portinfo(version)
+		set revision $portinfo(revision)
+
+		# Append the package itself to the result list
+		lappend result [list $portname $portversion $revision]
+
+		# Append the package's dependents to the result list
+		set depends {}
+		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
+			eval "lappend depends $portinfo(depends_build)"
+		}
+		foreach depspec $depends {
+			set dep [lindex [split $depspec :] end]
+			set x [get_dependencies $dep $includeBuildDeps]
+			eval "lappend result $x"
+			set result [lsort -unique $result]
+		}
+	}
+	return $result
+}
+
+# Install binary packages if they've already been built.  This will
+# speed up the testing, since we won't have to recompile dependencies
+# which have already been compiled.
+
+proc install_binary_if_available {dep} {
+	set portname [lindex $dep 0]
+	set portversion [lindex $dep 1]
+	set revision [lindex $dep 2]
+
+	foreach dir {"${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+		foreach arch {"ppc" "i386" "fat"} {
+			set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
+			if {[file readable $rpmpath]} {
+				ui_msg "Installing binary: $rpmpath"
+				if {[catch {system "rpm -Uvh --force $rpmpath"} error ]} {
+					global errorInfo
+					ui_debug "$errorInfo"
+					ui_error "Internal error: $error"
+				} else {
+					return true
+				}
+			}
+		}
+	}
+	return false
+}
+
+
+# Standard procedures
+
+proc fatal args {
+    global argv0
+    puts stderr "$argv0: $args"
+    exit
+}
+
+# Main
+array set options [list]
+array set variations [list]
+
+#	set ui_options(ports_verbose) yes
+if {![file exists /usr/bin/sw_vers]} {
+	set variations(puredarwin) "+"
+}
+
+if {[catch {dportinit ui_options options variations} result]} {
+    puts "Failed to initialize ports system, $result"
+    exit 1
+}
+
+package require Pextlib
+
+# If no arguments were given, default to all ports.
+if {[llength $argv] == 0} {
+	lappend argv ".*"
+}
+
+foreach pname $argv {
+
+if {[catch {set allpackages [dportsearch "^${pname}\$"]} result]} {
+	puts "port search failed: $result"
+	exit 1
+}
+
+set logpath "/darwinports/logs"
+set logfd ""
+
+foreach {name array} $allpackages {
+	array unset portinfo
+	array set portinfo $array
+
+	#ui_msg "foo $portinfo(porturl)"
+
+	# Start with verbose output off;
+	# this will prevent the repopulation of /opt from getting logged.
+	set ui_options(ports_verbose) no
+
+	if {![info exists portinfo(porturl)]} {
+		puts stderr "Internal error: no porturl for $name"
+		continue
+	}
+	if {![info exists portinfo(revision)]} {
+		set portinfo(revision) 0
+	}
+
+	set porturl $portinfo(porturl)
+
+	# this is used to short-circuit the RPM check and
+	# move on to the next package
+
+	global exit_loop
+	set exit_loop false
+
+	# Skip up-to-date packages
+	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+		if {[info exists portinfo(name)] &&
+			[info exists portinfo(version)] &&
+			[info exists portinfo(revision)]} {
+			set portname $portinfo(name)
+			set portversion $portinfo(version)
+			set revision $portinfo(revision)
+
+			foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+				foreach arch {"ppc" "i386" "fat"} {
+					set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
+					#ui_msg "trying ${rpmpath}"
+					if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
+						puts stderr "->    skipping ${portname}-${portversion}; package is up to date."
+						set exit_loop true
+						break
+					}
+				}
+				if {${exit_loop}} {
+					break
+				}
+			}
+		}
+	}
+	if {${exit_loop}} {
+		continue
+	}
+	
+	# Skip packages which previously failed
+	set exit_loop false
+		
+	# Skip up-to-date packages
+	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+		if {[info exists portinfo(name)] &&
+			[info exists portinfo(version)] &&
+			[info exists portinfo(revision)]} {
+			set portname $portinfo(name)
+			set portversion $portinfo(version)
+			set revision $portinfo(revision)
+
+			set logfilepath "${logpath}/${portname}.log"
+			if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
+				puts stderr "->    skipping ${portname}-${portversion}; package failed, but has not changed."
+				set exit_loop true
+			}
+		}
+	}
+	if {${exit_loop}} {
+		continue
+	}
+	
+	# Building the port:
+	# - remove /opt so it won't pollute the port.
+	# - re-install DarwinPorts.
+	# - keep distfiles outside /opt so we don't have to keep fetching them.
+	# - send out an email to the maintainer if any errors occurred.
+
+	set remove_files ""
+	foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+		foreach arch {"ppc" "i386" "fat"} {
+			set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
+		}
+	}
+	system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
+
+	ui_msg "->    Removing /opt"
+	#unset ui_options(ports_verbose)
+	if {[catch {system "rm -Rf /opt"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	# this is bad on pure darwin  :)
+	#if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+	#	puts stderr "Internal error: $error"
+	#}
+	#if {[catch {system "rm -Rf /etc/X11"} error]} {
+	#	puts stderr "Internal error: $error"
+	#}
+	#if {[catch {system "rm -Rf /etc/fonts"} error]} {
+	#	puts stderr "Internal error: $error"
+	#}
+	ui_msg "->    Installing darwinports"
+	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+		puts stderr "Internal error: $error"
+	}
+	#set ui_options(ports_verbose) yes
+
+	# If there was a log file left over from the previous pass,
+	# then the port failed with an error.  Send the log in an
+	# email to the maintainers.
+	if {[string length $logfd] > 0} {
+		close $logfd
+		set logfd ""
+	}
+	#if {[file readable $logfilename]} {
+	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
+	#		puts stderr "Internal error: $error"
+	#	}
+	#}
+
+	# Open the log file for writing
+	set logfd [open ${logpath}/${name}.log w]
+
+	set valid 1
+
+	set lint_errors {}
+	set portname ""
+	set portversion ""
+	set description ""
+	set category ""
+
+	if {![info exists portinfo(name)]} {
+		lappend lint_errors "missing name key"
+		set valid 0
+	} else {
+		set portname $portinfo(name)
+	}
+	
+	if {![info exists portinfo(description)]} {
+		lappend lint_errors "missing description key"
+		set valid 0
+	} else {
+		set description $portinfo(description)
+	}
+	
+	if {![info exists portinfo(version)]} {
+		lappend lint_errors "missing version key"
+		set valid 0
+	} else {
+		set portversion $portinfo(version)
+	}
+	
+	if {![info exists portinfo(categories)]} {
+		lappend lint_errors "missing categories key"
+		set valid 0
+	} else {
+		set category [lindex $portinfo(categories) 0]
+	}
+	
+	if {![info exists portinfo(maintainers)]} {
+		append lint_errors "missing maintainers key"
+		set valid 0
+		set maintainers kevin at opendarwin.org
+	} else {
+		set maintainers $portinfo(maintainers)
+	}
+	
+	pkg_ui_log "To: [join $maintainers {, }]"
+	pkg_ui_log "From: donotreply at opendarwin.org"
+	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
+	pkg_ui_log ""
+	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
+	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
+	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
+	pkg_ui_log "the port as soon as possible."
+	pkg_ui_log ""
+	pkg_ui_log ""
+	pkg_ui_log "Thank you,"
+	pkg_ui_log "The DarwinPorts Team"
+	pkg_ui_log ""
+	pkg_ui_log "================================================================================"
+	pkg_ui_log ""
+
+	if {!$valid} {
+		foreach error $lint_errors {
+			ui_error $error
+		}
+	}
+
+	ui_msg "-->   Packaging ${category}/${portname}-${portversion}"
+
+	foreach prebuild {"ccache" "rpm" "unzip"} {
+		if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
+			ui_msg "--->  Pre-installing ${prebuild}"
+			if {[catch {set search [dportsearch "^${prebuild}\$"]} error]} {
+				global errorInfo
+				ui_debug "$errorInfo"
+				ui_error "Internal error: port search ${prebuild} failed: $error"
+			}
+			array set prebuildinfo [lindex $search 1]
+			set ui_options(ports_verbose) yes
+			if {[catch {set workername [dportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
+				$result == 1} {
+				global errorInfo
+				ui_debug "$errorInfo"
+				ui_error "Internal error: unable to install ${prebuild}... exiting"
+				exit 1
+			}
+			if {[catch {set result [dportexec $workername install]} result] ||
+				$result == 1} {
+				global errorInfo
+				ui_debug "$errorInfo"
+				ui_error "installation of ${prebuild} failed: $result"
+				dportclose $workername
+				exit 1
+			}
+		}
+	}
+
+	# Turn on verbose output for the build
+	set ui_options(ports_verbose) yes
+	if {[catch {set workername [dportopen $porturl [array get options] [array get variations]]} result] ||
+		$result == 1} {
+		global errorInfo
+		ui_debug "$errorInfo"
+	    ui_error "Internal error: unable to open port: $result"
+	    continue
+	}
+	if {[catch {set result [dportexec $workername rpmpackage]} result] ||
+		$result == 1} {
+		global errorInfo
+		ui_debug "$errorInfo"
+	    ui_error "port package failed: $result"
+		dportclose $workername
+	    continue
+	}
+	set ui_options(ports_verbose) no
+	# Turn verbose output off after the build
+
+	dportclose $workername
+
+	# We made it to the end.  We can delete the log file.
+	close $logfd
+	set logfd ""
+	file delete ${logpath}/${name}.log
+}
+
+}
+# end foreach pname

Deleted: trunk/base/portmgr/rpmall.tcl
===================================================================
--- trunk/base/portmgr/rpmall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/portmgr/rpmall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,494 +0,0 @@
-#!/usr/bin/env tclsh
-# rpmall.tcl
-# $Id$
-#
-# Copyright (c) 2003 Benjamin Reed <ranger at befunk.com>
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-
-# UI Instantiations
-array set ui_options {}
-# ui_options(ports_debug) - If set, output debugging messages.
-# ui_options(ports_verbose) - If set, output info messages (ui_info)
-# ui_options(ports_quiet) - If set, don't output "standard messages"
-
-# ui_options accessor
-proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) == "yes"} {
-	    return 1
-	}
-    }
-    return 0
-}
-
-set options(package.destpath) "/darwinports/rpms"
-
-# UI Callback 
-
-proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
-}
-
-proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
-			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
-			}
-		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
-			} else {
-				return {stdout}
-			}
-		}
-        default {
-        	return {stdout}
-        }
-    }
-}
-	
-proc pkg_ui_log {message} {
-    global logfd
-    if {[string length $logfd] > 0 } {
-	log_message $logfd $message
-    }
-}
-
-proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname includeBuildDeps} {
-	set result {}
-	
-	if {[catch {set search [dportsearch "^$portname\$"]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Internal error: port search failed: $error"
-		return {}
-	}
-	foreach {name array} $search {
-		array set portinfo $array
-		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(categories)]} {
-			ui_error "Internal error: $name missing some portinfo keys"
-			continue
-		}
-		if {![info exists portinfo(revision)]} {
-			set portinfo(revision) 0
-		}
-		
-		set portname $portinfo(name)
-		set portversion $portinfo(version)
-		set revision $portinfo(revision)
-
-		# Append the package itself to the result list
-		lappend result [list $portname $portversion $revision]
-
-		# Append the package's dependents to the result list
-		set depends {}
-		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
-			eval "lappend depends $portinfo(depends_build)"
-		}
-		foreach depspec $depends {
-			set dep [lindex [split $depspec :] end]
-			set x [get_dependencies $dep $includeBuildDeps]
-			eval "lappend result $x"
-			set result [lsort -unique $result]
-		}
-	}
-	return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-	set portname [lindex $dep 0]
-	set portversion [lindex $dep 1]
-	set revision [lindex $dep 2]
-
-	foreach dir {"${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-		foreach arch {"ppc" "i386" "fat"} {
-			set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-			if {[file readable $rpmpath]} {
-				ui_msg "Installing binary: $rpmpath"
-				if {[catch {system "rpm -Uvh --force $rpmpath"} error ]} {
-					global errorInfo
-					ui_debug "$errorInfo"
-					ui_error "Internal error: $error"
-				} else {
-					return true
-				}
-			}
-		}
-	}
-	return false
-}
-
-
-# Standard procedures
-
-proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-
-#	set ui_options(ports_verbose) yes
-if {![file exists /usr/bin/sw_vers]} {
-	set variations(puredarwin) "+"
-}
-
-if {[catch {dportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-	lappend argv ".*"
-}
-
-foreach pname $argv {
-
-if {[catch {set allpackages [dportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
-
-set logpath "/darwinports/logs"
-set logfd ""
-
-foreach {name array} $allpackages {
-	array unset portinfo
-	array set portinfo $array
-
-	#ui_msg "foo $portinfo(porturl)"
-
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt from getting logged.
-	set ui_options(ports_verbose) no
-
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	if {![info exists portinfo(revision)]} {
-		set portinfo(revision) 0
-	}
-
-	set porturl $portinfo(porturl)
-
-	# this is used to short-circuit the RPM check and
-	# move on to the next package
-
-	global exit_loop
-	set exit_loop false
-
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
-
-			foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-				foreach arch {"ppc" "i386" "fat"} {
-					set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-					#ui_msg "trying ${rpmpath}"
-					if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
-						puts stderr "->    skipping ${portname}-${portversion}; package is up to date."
-						set exit_loop true
-						break
-					}
-				}
-				if {${exit_loop}} {
-					break
-				}
-			}
-		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Skip packages which previously failed
-	set exit_loop false
-		
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
-
-			set logfilepath "${logpath}/${portname}.log"
-			if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "->    skipping ${portname}-${portversion}; package failed, but has not changed."
-				set exit_loop true
-			}
-		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Building the port:
-	# - remove /opt so it won't pollute the port.
-	# - re-install DarwinPorts.
-	# - keep distfiles outside /opt so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
-
-	set remove_files ""
-	foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-		foreach arch {"ppc" "i386" "fat"} {
-			set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
-		}
-	}
-	system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
-
-	ui_msg "->    Removing /opt"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	# this is bad on pure darwin  :)
-	#if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/X11"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/fonts"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	ui_msg "->    Installing darwinports"
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
-
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {[string length $logfd] > 0} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "cat $logfilename | /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
-
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
-
-	set valid 1
-
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
-
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: DarwinPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the DarwinPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The DarwinPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
-
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
-		}
-	}
-
-	ui_msg "-->   Packaging ${category}/${portname}-${portversion}"
-
-	foreach prebuild {"ccache" "rpm" "unzip"} {
-		if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
-			ui_msg "--->  Pre-installing ${prebuild}"
-			if {[catch {set search [dportsearch "^${prebuild}\$"]} error]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: port search ${prebuild} failed: $error"
-			}
-			array set prebuildinfo [lindex $search 1]
-			set ui_options(ports_verbose) yes
-			if {[catch {set workername [dportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: unable to install ${prebuild}... exiting"
-				exit 1
-			}
-			if {[catch {set result [dportexec $workername install]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "installation of ${prebuild} failed: $result"
-				dportclose $workername
-				exit 1
-			}
-		}
-	}
-
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	if {[catch {set workername [dportopen $porturl [array get options] [array get variations]]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}
-	if {[catch {set result [dportexec $workername rpmpackage]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
-		dportclose $workername
-	    continue
-	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
-
-	dportclose $workername
-
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
-}
-
-}
-# end foreach pname

Copied: trunk/base/portmgr/rsync.repos (from rev 26176, branches/dp2mp-move/base/portmgr/rsync.repos)
===================================================================
--- trunk/base/portmgr/rsync.repos	                        (rev 0)
+++ trunk/base/portmgr/rsync.repos	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,73 @@
+#######
+# MacPorts rsync repos feeding the sync & selfupdate procedures, created and
+# maintained by the base/portmgr/mprsyncup.new script.
+# 
+# Two main modules are supplied for current installations off the dp2mp-move
+# branch (intended to become mainstream moving forwad)
+# and two for backwards compatibility (legacy DarwinPorts namespace). Assuming
+# an example REPOROOT path of /usr/local/repos/macports, this file is organized
+# in the following four modules and filesystem level paths (server side):
+#
+#
+# PATHS:
+#
+# ${REPOROOT}/release: holding a ports tree, exported from a checkout of svn's
+# trunk/dports dir (ToT), and the current release base dir, as determined by
+# the base/config/RELEASE_URL file read by the base/portmgr/mprsyncup.new
+# script;
+#
+# ${REPOROOT}/trunk: holding an export of a checkout from svn's trunk/base
+# dir (ToT);
+#
+# ${REPOROOT}/dpupdate: backwards compatible path & module, a filesystem
+# level (relative) symlink to the trunk path above
+#    (relative to ${REPOROOT}: dpupdate --> trunk);
+#
+# ${REPOROOT}/dpupdate1: backwards compatible path & module, a filesystem
+# level (relative) symlink to the release path
+#    (relative to ${REPOROOT}: dpupdate1 --> release).
+#
+# 
+# Futhermore the ${REPOROOT}/trunk path must also hold a (relative) `dports'
+# symlink to `../release/ports', so that a sync operation against
+# `dpupdate/ports' for the ports tree works on legacy MacPorts installations
+# (DarwinPorts namespace). Overall, the ${REPOROOT} skeleton should look like:
+#
+# release/
+# release/base/
+# release/ports/
+# trunk/
+# trunk/base/
+# trunk/dports --> ../release/ports
+# dpupdate --> trunk
+# dpupdate1 --> release
+#
+#
+# Whatever server uses this file should simply add the modules listed here to
+# an already tailored rsyncd.conf file, as no other particular config options
+# are supplied. Repositories themselves are created and maintained by the
+# base/portmgr/mprsyncup.new script, as stated above (that is, no manual
+# intervention what-so-ever is needed, other than adding the repos to the local
+# rsyncd.conf file).
+#
+# Created by Juan Manuel Palacios,
+# e-mail: jmpp at macports.org
+# $Id$
+#######
+
+
+[release]
+	comment = MacPorts rsync release repo, ports tree and base sources.
+	path = /Volumes/data/rsync/macports/release
+
+[trunk]
+	comment = MacPorts ToT rsync repo, base component.
+	path = /Volumes/data/rsync/macports/trunk
+
+[dpupdate]
+	comment = Legacy MacPorts ToT rsync repo, ports tree and base component (solely for backwards compatibility purposes).
+	path = /Volumes/data/rsync/macports/dpupdate
+
+[dpupdate1]
+	comment = Legacy MacPorts rsync dpupdate1 repo, release base component (solely for backwards compatibility purposes).
+	path = /Volumes/data/rsync/macports/dpupdate1

Modified: trunk/base/src/Makefile.in
===================================================================
--- trunk/base/src/Makefile.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/Makefile.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,5 +1,5 @@
-TCLPKG=		@OUR_INCLUDED_PACKAGES@ darwinports1.0 port1.0 package1.0 \
-			pextlib1.0 registry1.0 darwintracelib1.0  tclobjc1.0
+TCLPKG=		@OUR_INCLUDED_PACKAGES@ macports1.0 port1.0 package1.0 \
+			pextlib1.0 registry1.0 darwintracelib1.0 tclobjc1.0
 SUBDIR=		${TCLPKG} port programs
 
 all::
@@ -10,4 +10,4 @@
 
 test::
 
-include ../Mk/dports.subdir.mk
+include ../Mk/macports.subdir.mk

Modified: trunk/base/src/cflib1.0/Makefile
===================================================================
--- trunk/base/src/cflib1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/cflib1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 OBJS=		CFLib.o
 SHLIB_NAME=	CFLib${SHLIB_SUFFIX}
 LIBS+=		-framework CoreFoundation
-INSTALLDIR= ${DESTDIR}${datadir}/darwinports/Tcl/cflib1.0
+INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/cflib1.0
 
-include ../../Mk/dports.autoconf.mk
-include ../../Mk/dports.tea.mk
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk

Modified: trunk/base/src/darwintracelib1.0/Makefile
===================================================================
--- trunk/base/src/darwintracelib1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/darwintracelib1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,8 +1,8 @@
 OBJS=		darwintrace.o
 SHLIB_NAME=	darwintrace${SHLIB_SUFFIX}
-INSTALLDIR= ${DESTDIR}${datadir}/darwinports/Tcl/darwintrace1.0
+INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/darwintrace1.0
 
 test::
 
-include ../../Mk/dports.autoconf.mk
-include ../../Mk/dports.tea.mk
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk

Copied: trunk/base/src/macports1.0 (from rev 26176, branches/dp2mp-move/base/src/macports1.0)


Property changes on: trunk/base/src/macports1.0
___________________________________________________________________
Name: svn:ignore
   + *.dylib
darwinports_autoconf.tcl
darwinports_fastload.tcl


Deleted: trunk/base/src/macports1.0/Makefile
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,25 +0,0 @@
-SRCS=		macports.tcl macports_dlist.tcl macports_util.tcl \
-		macports_autoconf.tcl macports_index.tcl macports_fastload.tcl
-OBJS=		macports.o portconf.o session.o util.o
-SHLIB_NAME=	MacPorts${SHLIB_SUFFIX}
-
-INSTALLDIR=	${DESTDIR}${TCL_PACKAGE_DIR}/macports1.0
-
-include ../../Mk/macports.autoconf.mk
-include ../../Mk/macports.tea.mk
-
-test::
-
-distclean:: clean
-	rm -f macports_autoconf.tcl macports_fastload.tcl ${SHLIB_NAME}
-
-install::
-	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
-
-	$(SILENT) set -x; for file in ${SRCS}; do \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}/$$file; \
-	done
-
-	echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
-
-	$(SILENT) $(TCLSH) ../pkg_mkindex.tcl ${INSTALLDIR}

Copied: trunk/base/src/macports1.0/Makefile (from rev 26176, branches/dp2mp-move/base/src/macports1.0/Makefile)
===================================================================
--- trunk/base/src/macports1.0/Makefile	                        (rev 0)
+++ trunk/base/src/macports1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,25 @@
+SRCS=		macports.tcl macports_dlist.tcl macports_util.tcl \
+		macports_autoconf.tcl macports_index.tcl macports_fastload.tcl
+OBJS=		macports.o portconf.o session.o util.o
+SHLIB_NAME=	MacPorts${SHLIB_SUFFIX}
+
+INSTALLDIR=	${DESTDIR}${TCL_PACKAGE_DIR}/macports1.0
+
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk
+
+test::
+
+distclean:: clean
+	rm -f macports_autoconf.tcl macports_fastload.tcl ${SHLIB_NAME}
+
+install::
+	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
+
+	$(SILENT) set -x; for file in ${SRCS}; do \
+		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}/$$file; \
+	done
+
+	echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
+
+	$(SILENT) $(TCLSH) ../pkg_mkindex.tcl ${INSTALLDIR}

Deleted: trunk/base/src/macports1.0/macports.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,46 +0,0 @@
-/*
- * macports.c
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <tcl.h>
-
-int macports_Init(Tcl_Interp *interp)
-{
-	if(Tcl_InitStubs(interp, "8.3", 0) == NULL)
-		return TCL_ERROR;
-	if(Tcl_PkgProvide(interp, "macports", "1.0") != TCL_OK)
-		return TCL_ERROR;
-	return TCL_OK;
-}

Copied: trunk/base/src/macports1.0/macports.c (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports.c)
===================================================================
--- trunk/base/src/macports1.0/macports.c	                        (rev 0)
+++ trunk/base/src/macports1.0/macports.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,46 @@
+/*
+ * macports.c
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <tcl.h>
+
+int macports_Init(Tcl_Interp *interp)
+{
+	if(Tcl_InitStubs(interp, "8.3", 0) == NULL)
+		return TCL_ERROR;
+	if(Tcl_PkgProvide(interp, "macports", "1.0") != TCL_OK)
+		return TCL_ERROR;
+	return TCL_OK;
+}

Deleted: trunk/base/src/macports1.0/macports.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,60 +0,0 @@
-/*
- * macports.h
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __MACPORTS_H__
-#define __MACPORTS_H__
-
-typedef void* mp_session_t;
-typedef void* mp_software_t;
-
-typedef void* mp_array_t;
-mp_array_t mp_array_create();
-mp_array_t mp_array_create_copy(mp_array_t a);
-mp_array_t mp_array_retain(mp_array_t a);
-void mp_array_release(mp_array_t a);
-void mp_array_append(mp_array_t a, const void* data);
-int mp_array_get_count(mp_array_t a);
-const void* mp_array_get_index(mp_array_t a, int index);
-/* something for delete */
-
-mp_session_t mp_session_open();
-int mp_session_sync_index();
-
-int mp_software_search(mp_session_t mp, const char* regexp, mp_software_t* out_matches, int* out_count);
-mp_software_t mp_software_open_portfile(mp_session_t mp, const char* path, const char** options);
-mp_session_t mp_software_get_session(mp_software_t sw);
-mp_software_t mp_software_exec(mp_software_t sw, const char* target);
-int mp_softare_close(mp_software_t sw);
-
-int mp_session_close();
-
-#endif /* __MACPORTS_H__ */

Copied: trunk/base/src/macports1.0/macports.h (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports.h)
===================================================================
--- trunk/base/src/macports1.0/macports.h	                        (rev 0)
+++ trunk/base/src/macports1.0/macports.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,60 @@
+/*
+ * macports.h
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MACPORTS_H__
+#define __MACPORTS_H__
+
+typedef void* mp_session_t;
+typedef void* mp_software_t;
+
+typedef void* mp_array_t;
+mp_array_t mp_array_create();
+mp_array_t mp_array_create_copy(mp_array_t a);
+mp_array_t mp_array_retain(mp_array_t a);
+void mp_array_release(mp_array_t a);
+void mp_array_append(mp_array_t a, const void* data);
+int mp_array_get_count(mp_array_t a);
+const void* mp_array_get_index(mp_array_t a, int index);
+/* something for delete */
+
+mp_session_t mp_session_open();
+int mp_session_sync_index();
+
+int mp_software_search(mp_session_t mp, const char* regexp, mp_software_t* out_matches, int* out_count);
+mp_software_t mp_software_open_portfile(mp_session_t mp, const char* path, const char** options);
+mp_session_t mp_software_get_session(mp_software_t sw);
+mp_software_t mp_software_exec(mp_software_t sw, const char* target);
+int mp_softare_close(mp_software_t sw);
+
+int mp_session_close();
+
+#endif /* __MACPORTS_H__ */

Deleted: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,1911 +0,0 @@
-# macports.tcl
-# $Id$
-#
-# Copyright (c) 2002 Apple Computer, Inc.
-# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot at kallisys.net>.
-# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb at opendarwin.org>.
-# Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-package provide macports 1.0
-package require macports_dlist 1.0
-package require macports_index 1.0
-package require macports_util 1.0
-
-namespace eval macports {
-    namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
-    variable bootstrap_options "\
-    	portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
-    	portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
-    	porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
-    	rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
-        mp_remote_url mp_remote_submit_url"
-    variable user_options "submitter_name submitter_email submitter_key"
-    variable portinterp_options "\
-    	portdbpath portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
-    	registry.path registry.format registry.installtype portarchivemode portarchivepath \
-    	portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
-    	rsync_options rsync_dir startupitem_type place_worksymlink \
-        mp_remote_url mp_remote_submit_url \
-    	$user_options"
-    
-    # deferred options are only computed when needed.
-    # they are not exported to the trace thread.
-    # they are not exported to the interpreter in system_options array.
-    variable portinterp_deferred_options "xcodeversion xcodebuildcmd"
-	
-    variable open_mports {}
-    
-    variable ui_priorities "debug info msg error warn"
-}
-
-# Provided UI instantiations
-# For standard messages, the following priorities are defined
-#     debug, info, msg, warn, error
-# Clients of the library are expected to provide ui_prefix and ui_channels with
-# the following prototypes.
-#     proc ui_prefix {priority}
-#     proc ui_channels {priority}
-# ui_prefix returns the prefix for the messages, if any.
-# ui_channels returns a list of channels to output the message to, empty for
-#     no message.
-# if these functions are not provided, defaults are used, but this should
-# not be relied upon for production code
-
-proc macports::ui_init {priority message} {
-	# Get the list of channels.
-	if {[llength [info commands ui_channels]] > 0} {
-		set channels [ui_channels $priority]
-	} else {
-	    set channels [ui_channels_default $priority]
-	}
-
-	# Simplify ui_$priority.
-	set nbchans [llength $channels]
-	if {$nbchans == 0} {
-		proc ::ui_$priority {str} {}
-	} else {
-		if {[llength [info commands ui_prefix]] > 0} {
-			set prefix [ui_prefix $priority]
-		} else {
-		    set prefix [ui_prefix_default $priority]
-		}
-
-		if {$nbchans == 1} {
-			set chan [lindex $channels 0]
-			proc ::ui_$priority {str} [subst { puts $chan "$prefix\$str" }]
-		} else {
-			proc ::ui_$priority {str} [subst {
-				foreach chan \$channels {
-					puts $chan "$prefix\$str"
-				}
-			}]
-		}
-
-		# Call ui_$priority
-		::ui_$priority $message
-	}
-}
-
-# Defult implementation of ui_prefix
-proc macports::ui_prefix_default {priority} {
-	switch $priority {
-		debug {
-			return "DEBUG: "
-		}
-		error {
-			return "Error: "
-		}
-		warn {
-			return "Warning: "
-		}
-		default {
-			return ""
-		} 
-	}
-}
-
-# Default implementation of ui_channels
-proc macports::ui_channels_default {priority} {
-    switch $priority {
-        debug -
-        info {
-            return {}
-        }
-        msg {
-            return {stdout}
-        }
-        error {
-            return {stderr}
-        }
-        default {
-            return {stdout}
-        }
-    }
-}
-
-foreach priority ${macports::ui_priorities} {
-    proc ui_$priority {str} [subst { macports::ui_init $priority \$str }]
-}
-
-# Replace puts to catch errors (typically broken pipes when being piped to head)
-rename puts tcl::puts
-proc puts {args} {
-	catch "tcl::puts $args"
-}
-
-# find a binary either in a path defined at MacPorts' configuration time
-# or in the PATH environment variable through macports::binaryInPath (fallback)
-proc macports::findBinary {prog {autoconf_hint ""}} {
-    if {${autoconf_hint} != "" && [file executable ${autoconf_hint}]} {
-	return ${autoconf_hint}
-    } else {
-	if {[catch {set cmd_path [macports::binaryInPath ${prog}]} result] == 0} {
-	    return ${cmd_path}
-	} else {
-	    return -code error "${result} or at its MacPorts configuration time location, did you move it?"
-	}
-    }
-}
-
-# check for a binary in the path
-# returns an error code if it can not be found
-proc macports::binaryInPath {prog} {
-    global env
-    foreach dir [split $env(PATH) :] { 
-	if {[file executable [file join $dir $prog]]} {
-	    return [file join $dir $prog]
-	}
-    }
-    return -code error [format [msgcat::mc "Failed to locate '%s' in path: '%s'"] $prog $env(PATH)];
-}
-
-# deferred option processing
-proc macports::getoption {name} {
-	global macports::$name
-	return [expr $$name]
-}
-
-# deferred and on-need extraction of xcodeversion and xcodebuildcmd.
-proc macports::setxcodeinfo {name1 name2 op} {
-	global macports::xcodeversion
-	global macports::xcodebuildcmd
-	
-	trace remove variable macports::xcodeversion read macports::setxcodeinfo
-	trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
-
-	if {[catch {set xcodebuild [binaryInPath "xcodebuild"]}] == 0} {
-		if {![info exists xcodeversion]} {
-			# Determine xcode version (<= 2.0 or 2.1)
-			if {[catch {set xcodebuildversion [exec xcodebuild -version]}] == 0} {
-				if {[regexp "DevToolsCore-(.*); DevToolsSupport-(.*)" $xcodebuildversion devtoolscore_v devtoolssupport_v] == 1} {
-					if {$devtoolscore_v >= 620.0 && $devtoolssupport_v >= 610.0} {
-						# for now, we don't need to distinguish 2.1 from 2.1 or higher.
-						set macports::xcodeversion "2.1"
-					} else {
-						set macports::xcodeversion "2.0orlower"
-					}
-				} else {
-					set macports::xcodeversion "2.0orlower"
-				}
-			} else {
-				set macports::xcodeversion "2.0orlower"
-			}
-		}
-		
-		if {![info exists xcodebuildcmd]} {
-			set macports::xcodebuildcmd "xcodebuild"
-		}
-	} elseif {[catch {set pbxbuild [binaryInPath "pbxbuild"]}] == 0} {
-		if {![info exists xcodeversion]} {
-			set macports::xcodeversion "pb"
-		}
-		if {![info exists xcodebuildcmd]} {
-			set macports::xcodebuildcmd "pbxbuild"
-		}
-	} else {
-		if {![info exists xcodeversion]} {
-			set macports::xcodeversion "none"
-		}
-		if {![info exists xcodebuildcmd]} {
-			set macports::xcodebuildcmd "none"
-		}
-	}
-}
-
-
-proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
-	if {$up_ui_options eq ""} {
-		array set ui_options {}
-	} else {
-		upvar $up_ui_options ui_options
-	}
-	if {$up_options eq ""} {
-		array set options {}
-	} else {
-		upvar $up_options options
-	}
-	if {$up_variations eq ""} {
-		array set $up_variations {}
-	} else {
-		upvar $up_variations variations
-	}
-	
-	global auto_path env
-	global macports::autoconf::macports_conf_path
-        global macports::macports_user_dir
-	global macports::bootstrap_options
-	global macports::user_options
-	global macports::extra_env
-	global macports::portconf
-	global macports::portdbpath
-	global macports::portsharepath
-	global macports::registry.format
-	global macports::registry.path
-	global macports::sources
-	global macports::sources_conf
-   	global macports::destroot_umask
-   	global macports::libpath
-   	global macports::prefix
-        global macports::prefix_frozen
-   	global macports::registry.installtype
-   	global macports::rsync_dir
-   	global macports::rsync_options
-   	global macports::rsync_server
-   	global macports::variants_conf
-   	global macports::xcodebuildcmd
-   	global macports::xcodeversion
-
-        # Set the system encoding to utf-8
-        encoding system utf-8
-
-        # Ensure that the macports user directory exists if HOME is defined
-        if {[info exists env(HOME)]} {
-	    set macports::macports_user_dir [file normalize $macports::autoconf::macports_user_dir]
-	    if { ![file exists $macports_user_dir] } {
-		# If not, create it with ownership of the enclosing directory, rwx by the user only
-		file mkdir $macports_user_dir
-		file attributes $macports_user_dir -permissions u=rwx,go= \
-		    -owner [file attributes $macports_user_dir/.. -owner] \
-		    -group [file attributes $macports_user_dir/.. -group]
-	    }
-	} else {
-	    # Otherwise define the user directory as a direcotory that will never exist
-	    set macports::macports_user_dir "/dev/null/NO_HOME_DIR"
-	}
-   	
-   	# Configure the search path for configuration files
-   	set conf_files ""
-        if {[info exists env(PORTSRC)]} {
-	    set PORTSRC $env(PORTSRC)
-	    lappend conf_files ${PORTSRC}
-	}
-    if { [file isdirectory macports_user_dir] } {
-	lappend conf_files "${macports_user_dir}/macports.conf"
-    }
-    lappend conf_files "${macports_conf_path}/macports.conf"
-    
-    # Process the first configuration file we find on conf_files list
-	foreach file $conf_files {
-		if [file exists $file] {
-			set portconf $file
-			set fd [open $file r]
-			while {[gets $fd line] >= 0} {
-				if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
-					if {[lsearch $bootstrap_options $option] >= 0} {
-						set macports::$option $val
-						global macports::$option
-					}
-				}
-			}
-			
-			break
-		}
-	}
-	
-	# Process per-user only settings
-        set per_user "${macports_user_dir}/user.conf"
-	if [file exists $per_user] {
-		set fd [open $per_user r]
-		while {[gets $fd line] >= 0} {
-			if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
-				if {[lsearch $user_options $option] >= 0} {
-					set macports::$option $val
-					global macports::$option
-				}
-			}
-		}
-	}
-	
-    if {![info exists sources_conf]} {
-        return -code error "sources_conf must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf file"
-    }
-    set fd [open $sources_conf r]
-    while {[gets $fd line] >= 0} {
-        set line [string trimright $line]
-	if {![regexp {^\s*#|^$} $line]} {
-	    if {[regexp {^([\w-]+://\S+)(?:\s+\[(\w+(?:,\w+)*)\])?$} $line _ url flags]} {
-		set flags [split $flags ,]
-		foreach flag $flags {
-		    if {[lsearch -exact [list nosync] $flag] == -1} {
-			ui_warn "$sources_conf source '$line' specifies invalid flag '$flag'"
-		    }
-		}
-		lappend sources [concat [list $url] $flags]
-	    } else {
-		ui_warn "$sources_conf specifies invalid source '$line', ignored."
-	    }
-	}
-    }
-    if {![info exists sources]} {
-	if {[file isdirectory ports]} {
-	    set sources "file://[pwd]/ports"
-	} else {
-	    return -code error "No sources defined in $sources_conf"
-	}
-    }
-
-	if {[info exists variants_conf]} {
-		if {[file exist $variants_conf]} {
-		        set fd [open $variants_conf r]
-			while {[gets $fd line] >= 0} {
-				set line [string trimright $line]
-				if {![regexp {^[\ \t]*#.*$|^$} $line]} {
-					foreach arg [split $line " \t"] {
-						if {[regexp {^([-+])([-A-Za-z0-9_+\.]+)$} $arg match sign opt] == 1} {
-							if {![info exists variations($opt)]} {
-								set variations($opt) $sign
-							}
-						} else {
-							ui_warn "$variants_conf specifies invalid variant syntax '$arg', ignored."
-						}
-					}
-				}
-			}
-		} else {
-			ui_debug "$variants_conf does not exist, variants_conf setting ignored."
-		}
-	}
-
-    if {![info exists portdbpath]} {
-	return -code error "portdbpath must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf"
-    }
-    if {![file isdirectory $portdbpath]} {
-	if {![file exists $portdbpath]} {
-	    if {[catch {file mkdir $portdbpath} result]} {
-		return -code error "portdbpath $portdbpath does not exist and could not be created: $result"
-	    }
-	}
-    }
-    if {![file isdirectory $portdbpath]} {
-	return -code error "$portdbpath is not a directory. Please create the directory $portdbpath and try again"
-    }
-
-    set registry.path $portdbpath
-    if {![file isdirectory ${registry.path}]} {
-	if {![file exists ${registry.path}]} {
-	    if {[catch {file mkdir ${registry.path}} result]} {
-		return -code error "portdbpath ${registry.path} does not exist and could not be created: $result"
-	    }
-	}
-    }
-    if {![file isdirectory ${macports::registry.path}]} {
-	return -code error "${macports::registry.path} is not a directory. Please create the directory $portdbpath and try again"
-    }
-
-	# Format for receipts, can currently be either "flat" or "sqlite"
-	if {[info exists portdbformat]} {
-		if { $portdbformat == "sqlite" } {
-			return -code error "SQLite is not yet supported for registry storage."
-		} 
-		set registry.format receipt_${portdbformat}
-	} else {
-		set registry.format receipt_flat
-	}
-
-	# Installation type, whether to use port "images" or install "direct"
-	if {[info exists portinstalltype]} {
-		set registry.installtype $portinstalltype
-	} else {
-		set registry.installtype image
-	}
-    
-	# Autoclean mode, whether to automatically call clean after "install"
-	if {![info exists portautoclean]} {
-		set macports::portautoclean "yes"
-		global macports::portautoclean
-	}
-	# Check command line override for autoclean
-	if {[info exists options(ports_autoclean)]} {
-		if {![string equal $options(ports_autoclean) $portautoclean]} {
-			set macports::portautoclean $options(ports_autoclean)
-		}
-	}
-	# Trace mode, whether to use darwintrace to debug ports.
-	if {![info exists porttrace]} {
-		set macports::porttrace "no"
-		global macports::porttrace
-	}
-	# Check command line override for trace
-	if {[info exists options(ports_trace)]} {
-		if {![string equal $options(ports_trace) $porttrace]} {
-			set macports::porttrace $options(ports_trace)
-		}
-	}
-
-        # Duplicate prefix into prefix_frozen, so that port actions
-        # can always get to the original prefix, even if a portfile overrides prefix
-        set macports::prefix_frozen $prefix
-
-	# Export verbosity.
-	if {![info exists portverbose]} {
-		set macports::portverbose "no"
-		global macports::portverbose
-	}
-	if {[info exists ui_options(ports_verbose)]} {
-		if {![string equal $ui_options(ports_verbose) $portverbose]} {
-			set macports::portverbose $ui_options(ports_verbose)
-		}
-	}
-
-	# Archive mode, whether to create/use binary archive packages
-	if {![info exists portarchivemode]} {
-		set macports::portarchivemode "yes"
-		global macports::portarchivemode
-	}
-
-	# Archive path, where to store/retrieve binary archive packages
-	if {![info exists portarchivepath]} {
-		set macports::portarchivepath [file join $portdbpath packages]
-		global macports::portarchivepath
-	}
-	if {$portarchivemode == "yes"} {
-		if {![file isdirectory $portarchivepath]} {
-			if {![file exists $portarchivepath]} {
-				if {[catch {file mkdir $portarchivepath} result]} {
-					return -code error "portarchivepath $portarchivepath does not exist and could not be created: $result"
-				}
-			}
-		}
-		if {![file isdirectory $portarchivepath]} {
-			return -code error "$portarchivepath is not a directory. Please create the directory $portarchivepath and try again"
-		}
-	}
-
-	# Archive type, what type of binary archive to use (CPIO, gzipped
-	# CPIO, XAR, etc.)
-	if {![info exists portarchivetype]} {
-		set macports::portarchivetype "cpgz"
-		global macports::portarchivetype
-	}
-	# Convert archive type to a list for multi-archive support, colon or
-	# comma separators indicates to use multiple archive formats
-	# (reading and writing)
-	set macports::portarchivetype [split $portarchivetype {:,}]
-
-	# Set rync options
-	if {![info exists rsync_server]} {
-		set macports::rsync_server rsync.macports.org
-		global macports::rsync_server
-	}
-	if {![info exists rsync_dir]} {
-		set macports::rsync_dir release/base/
-		global macports::rsync_dir
-	}
-	if {![info exists rsync_options]} {
-		set rsync_options "-rtzv --delete-after"
-		global macports::rsync_options
-	}
-
-    set portsharepath ${prefix}/share/macports
-    if {![file isdirectory $portsharepath]} {
-	return -code error "Data files directory '$portsharepath' must exist"
-    }
-    
-    if {![info exists libpath]} {
-	set libpath "${prefix}/share/macports/Tcl"
-    }
-
-    if {![info exists binpath]} {
-	set env(PATH) "${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin"
-    } else {
-	set env(PATH) "$binpath"
-    }
-    
-    # Set startupitem default type (can be overridden by portfile)
-    if {![info exists macports::startupitem_type]} {
-    	set macports::startupitem_type "default"
-    }
-
-    # Default place_worksymlink
-    if {![info exists macports::place_worksymlink]} {
-	set macports::place_worksymlink yes
-    }
-
-    # Default mp remote options
-    if {![info exists macports::mp_remote_url]} {
-	set macports::mp_remote_url "http://db.macports.org"
-    }
-    if {![info exists macports::mp_remote_submit_url]} {
-	set macports::mp_remote_submit_url "${macports::mp_remote_url}/submit"
-    }
-    
-    # ENV cleanup.
-	set keepenvkeys { DISPLAY DYLD_FALLBACK_FRAMEWORK_PATH
-	                  DYLD_FALLBACK_LIBRARY_PATH DYLD_FRAMEWORK_PATH
-	                  DYLD_LIBRARY_PATH DYLD_INSERT_LIBRARIES
-	                  HOME JAVA_HOME LD_PREBIND
-	                  LD_PREBIND_ALLOW_OVERLAP MASTER_SITE_LOCAL
-	                  PATCH_SITE_LOCAL PATH PORTSRC RSYNC_PROXY TMP TMPDIR
-	                  USER GROUP
-	                  http_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY NO_PROXY
-					}
-    if {[info exists extra_env]} {
-    	set keepenvkeys [concat ${keepenvkeys} ${extra_env}]
-    }
-	
-	foreach envkey [array names env] {
-		if {[lsearch $keepenvkeys $envkey] == -1} {
-			array unset env $envkey
-		}
-	}
-
-	if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
-		# We'll resolve these later (if needed)
-		trace add variable macports::xcodeversion read macports::setxcodeinfo
-		trace add variable macports::xcodebuildcmd read macports::setxcodeinfo
-	}
-
-    # Set the default umask
-    if {![info exists destroot_umask]} {
-        set destroot_umask 022
-    }
-
-    if {[info exists master_site_local] && ![info exists env(MASTER_SITE_LOCAL)]} {
-	set env(MASTER_SITE_LOCAL) "$master_site_local"
-    }
-
-	# Prebinding. useful with MacOS X's ld, harmless elsewhere.
-	# With both variables, prebinding will always succeed but we might need
-	# to redo it.
-    if {![info exists env(LD_PREBIND)] && ![info exists env(LD_PREBIND_ALLOW_OVERLAP)]} {
-	set env(LD_PREBIND) "1"
-	set env(LD_PREBIND_ALLOW_OVERLAP) "1"
-    }
-
-    if {[file isdirectory $libpath]} {
-		lappend auto_path $libpath
-		set macports::auto_path $auto_path
-
-		# XXX: not sure if this the best place, but it needs to happen
-		# early, and after auto_path has been set.  Or maybe Pextlib
-		# should ship with macports1.0 API?
-		package require Pextlib 1.0
-		package require registry 1.0
-    } else {
-		return -code error "Library directory '$libpath' must exist"
-    }
-}
-
-proc macports::worker_init {workername portpath portbuildpath options variations} {
-    global macports::portinterp_options macports::portinterp_deferred_options registry.installtype
-
-	# Tell the sub interpreter about all the Tcl packages we already
-	# know about so it won't glob for packages.
-	foreach pkgName [package names] {
-		foreach pkgVers [package versions $pkgName] {
-			set pkgLoadScript [package ifneeded $pkgName $pkgVers]
-			$workername eval "package ifneeded $pkgName $pkgVers {$pkgLoadScript}"
-		}
-	}
-
-    # Create package require abstraction procedure
-    $workername eval "proc PortSystem \{version\} \{ \n\
-			package require port \$version \}"
-
-    # Clearly separate slave interpreters and the master interpreter.
-	$workername alias mport_exec mportexec
-	$workername alias mport_open mportopen
-	$workername alias mport_close mportclose
-	$workername alias mport_search mportsearch
-
-    # instantiate the UI call-backs
-	foreach priority ${macports::ui_priorities} {
-		$workername alias ui_$priority ui_$priority
-	}
-	$workername alias ui_prefix ui_prefix
-	$workername alias ui_channels ui_channels
-    
-    # Export some utility functions defined here.
-    $workername alias macports_create_thread macports::create_thread
-    $workername alias getportworkpath_from_buildpath macports::getportworkpath_from_buildpath
-
-	# New Registry/Receipts stuff
-	$workername alias registry_new registry::new_entry
-	$workername alias registry_open registry::open_entry
-	$workername alias registry_write registry::write_entry
-	$workername alias registry_prop_store registry::property_store
-	$workername alias registry_prop_retr registry::property_retrieve
-	$workername alias registry_delete registry::delete_entry
-	$workername alias registry_exists registry::entry_exists
-	$workername alias registry_activate portimage::activate
-	$workername alias registry_deactivate portimage::deactivate
-	$workername alias registry_register_deps registry::register_dependencies
-	$workername alias registry_fileinfo_for_index registry::fileinfo_for_index
-	$workername alias registry_bulk_register_files registry::register_bulk_files
-	$workername alias registry_installed registry::installed
-	$workername alias registry_active registry::active
-
-	# deferred options processing.
-	$workername alias getoption macports::getoption
-
-    foreach opt $portinterp_options {
-		if {![info exists $opt]} {
-		    global macports::$opt
-		}
-        if {[info exists $opt]} {
-            $workername eval set system_options($opt) \{[set $opt]\}
-            $workername eval set $opt \{[set $opt]\}
-        }
-    }
-    
-	foreach opt $portinterp_deferred_options {
-		global macports::$opt
-		# define the trace hook.
-		$workername eval \
-			"proc trace_$opt {name1 name2 op} { \n\
-				trace remove variable ::$opt read ::trace_$opt \n\
-				global $opt \n\
-				set $opt \[getoption $opt\] \n\
-			}"
-		# next access will actually define the variable.
-		$workername eval "trace add variable ::$opt read ::trace_$opt"
-		# define some value now
-		$workername eval set $opt "?"
-	}		
-
-    foreach {opt val} $options {
-        $workername eval set user_options($opt) $val
-        $workername eval set $opt $val
-    }
-
-    foreach {var val} $variations {
-        $workername eval set variations($var) $val
-    }
-
-    if { [info exists registry.installtype] } {
-	    $workername eval set installtype ${registry.installtype}
-    }
-}
-
-# Create a thread with most configuration options set.
-# The newly created thread is sent portinterp_options vars and knows where to
-# find all packages we know.
-proc macports::create_thread {} {
-    package require Thread
-
-    global macports::portinterp_options
-
-	# Create the thread.
-	set result [thread::create -preserved {thread::wait}]
-
-	# Tell the thread about all the Tcl packages we already
-	# know about so it won't glob for packages.
-	foreach pkgName [package names] {
-		foreach pkgVers [package versions $pkgName] {
-			set pkgLoadScript [package ifneeded $pkgName $pkgVers]
-			thread::send -async $result "package ifneeded $pkgName $pkgVers {$pkgLoadScript}"
-		}
-	}
-
-	# inherit configuration variables.
-	thread::send -async $result "namespace eval macports {}"
-	foreach opt $portinterp_options {
-		if {![info exists $opt]} {
-			global macports::$opt
-		}
-        if {[info exists $opt]} {
-			thread::send -async $result "global macports::$opt"
-			set val [set macports::$opt]
-			thread::send -async $result "set macports::$opt \"$val\""
-		}
-	}
-	
-	return $result
-}
-
-proc macports::fetch_port {url} {
-    global macports::portdbpath tcl_platform
-    set fetchdir [file join $portdbpath portdirs]
-    set fetchfile [file tail $url]
-    file mkdir $fetchdir
-    if {![file writable $fetchdir]} {
-    	return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
-    }
-    if {[catch {exec curl -L -s -S -o [file join $fetchdir $fetchfile] $url} result]} {
-        return -code error "Port remote fetch failed: $result"
-    }
-    cd $fetchdir
-    if {[catch {exec tar -zxf $fetchfile} result]} {
-	return -code error "Port extract failed: $result"
-    }
-    if {[regexp {(.+).tgz} $fetchfile match portdir] != 1} {
-        return -code error "Can't decipher portdir from $fetchfile"
-    }
-    return [file join $fetchdir $portdir]
-}
-
-proc macports::getprotocol {url} {
-    if {[regexp {(?x)([^:]+)://.+} $url match protocol] == 1} {
-        return ${protocol}
-    } else {
-        return -code error "Can't parse url $url"
-    }
-}
-
-# XXX: this really needs to be rethought in light of the remote index
-# I've added the destdir parameter.  This is the location a remotely
-# fetched port will be downloaded to (currently only applies to
-# mports:// sources).
-proc macports::getportdir {url {destdir "."}} {
-	if {[regexp {(?x)([^:]+)://(.+)} $url match protocol string] == 1} {
-		switch -regexp -- ${protocol} {
-			{^file$} {
-			    return [file normalize $string]
-			}
-			{^mports$} {
-				return [macports::index::fetch_port $url $destdir]
-			}
-			{^https?$|^ftp$} {
-				return [macports::fetch_port $url]
-			}
-			default {
-				return -code error "Unsupported protocol $protocol"
-			}
-		}
-	} else {
-		return -code error "Can't parse url $url"
-	}
-}
-
-# mportopen
-# Opens a MacPorts portfile specified by a URL.  The Portfile is
-# opened with the given list of options and variations.  The result
-# of this function should be treated as an opaque handle to a
-# MacPorts Portfile.
-
-proc mportopen {porturl {options ""} {variations ""} {nocache ""}} {
-    global macports::portdbpath macports::portconf macports::open_mports auto_path
-
-	# Look for an already-open MPort with the same URL.
-	# XXX: should compare options and variations here too.
-	# if found, return the existing reference and bump the refcount.
-	if {$nocache != ""} {
-		set mport {}
-	} else {
-		set mport [dlist_search $macports::open_mports porturl $porturl]
-	}
-	if {$mport != {}} {
-		set refcnt [ditem_key $mport refcnt]
-		incr refcnt
-		ditem_key $mport refcnt $refcnt
-		return $mport
-	}
-
-	array set options_array $options
-	if {[info exists options_array(portdir)]} {
-		set portdir $options_array(portdir)
-	} else {
-		set portdir ""
-	}
-
-	set portpath [macports::getportdir $porturl $portdir]
-	ui_debug "Changing to port directory: $portpath"
-	cd $portpath
-    if {![file isfile Portfile]} {
-        return -code error "Could not find Portfile in $portpath"
-    }
-
-	set workername [interp create]
-
-	set mport [ditem_create]
-	lappend macports::open_mports $mport
-	ditem_key $mport porturl $porturl
-	ditem_key $mport portpath $portpath
-	ditem_key $mport workername $workername
-	ditem_key $mport options $options
-	ditem_key $mport variations $variations
-	ditem_key $mport refcnt 1
-	
-    macports::worker_init $workername $portpath [macports::getportbuildpath $portpath] $options $variations
-
-    $workername eval source Portfile
-
-    # evaluate the variants
-    if {[$workername eval eval_variants variations] != 0} {
-	mportclose $mport
-	error "Error evaluating variants"
-    }
-
-    ditem_key $mport provides [$workername eval return \$portname]
-
-    return $mport
-}
-
-# Traverse a directory with ports, calling a function on the path of ports
-# (at the second depth).
-# I.e. the structure of dir shall be:
-# category/port/
-# with a Portfile file in category/port/
-#
-# func:		function to call on every port directory (it is passed
-#			category/port/ as its parameter)
-# root:		the directory with all the categories directories.
-proc mporttraverse {func {root .}} {
-	# Save the current directory
-	set pwd [pwd]
-	
-	# Join the root.
-	set pathToRoot [file join $pwd $root]
-
-	# Go to root because some callers expects us to be there.
-	cd $pathToRoot
-
-    foreach category [lsort -increasing -unique [readdir $root]] {
-    	set pathToCategory [file join $root $category]
-        if {[file isdirectory $pathToCategory]} {
-        	# Iterate on port directories.
-			foreach port [lsort -increasing -unique [readdir $pathToCategory]] {
-				set pathToPort [file join $pathToCategory $port]
-				if {[file isdirectory $pathToPort] &&
-					[file exists [file join $pathToPort "Portfile"]]} {
-					# Call the function.
-					$func [file join $category $port]
-					
-					# Restore the current directory because some
-					# functions changes it.
-					cd $pathToRoot
-				}
-			}
-        }
-	}
-	
-	# Restore the current directory.
-	cd $pwd
-}
-
-### _mportsearchpath is private; subject to change without notice
-
-# depregex -> regex on the filename to find.
-# search_path -> directories to search
-# executable -> whether we want to check that the file is executable by current
-#				user or not.
-proc _mportsearchpath {depregex search_path {executable 0}} {
-    set found 0
-    foreach path $search_path {
-	if {![file isdirectory $path]} {
-	    continue
-	}
-
-	if {[catch {set filelist [readdir $path]} result]} {
-		return -code error "$result ($path)"
-		set filelist ""
-	}
-
-	foreach filename $filelist {
-	    if {[regexp $depregex $filename] &&
-	    	(($executable == 0) || [file executable [file join $path $filename]])} {
-		ui_debug "Found Dependency: path: $path filename: $filename regex: $depregex"
-		set found 1
-		break
-	    }
-	}
-    }
-    return $found
-}
-
-### _libtest is private; subject to change without notice
-# XXX - Architecture specific
-# XXX - Rely on information from internal defines in cctools/dyld:
-# define DEFAULT_FALLBACK_FRAMEWORK_PATH
-# /Library/Frameworks:/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
-# define DEFAULT_FALLBACK_LIBRARY_PATH /lib:/usr/local/lib:/lib:/usr/lib
-#   -- Since /usr/local is bad, using /lib:/usr/lib only.
-# Environment variables DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH,
-# DYLD_FALLBACK_FRAMEWORK_PATH, and DYLD_FALLBACK_LIBRARY_PATH take precedence
-
-proc _libtest {mport depspec} {
-    global env tcl_platform
-	set depline [lindex [split $depspec :] 1]
-	set prefix [_mportkey $mport prefix]
-	
-	if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
-	    lappend search_path $env(DYLD_FRAMEWORK_PATH)
-	} else {
-	    lappend search_path /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks
-	}
-	if {[info exists env(DYLD_FALLBACK_FRAMEWORK_PATH)]} {
-	    lappend search_path $env(DYLD_FALLBACK_FRAMEWORK_PATH)
-	}
-	if {[info exists env(DYLD_LIBRARY_PATH)]} {
-	    lappend search_path $env(DYLD_LIBRARY_PATH)
-	}
-	lappend search_path /lib /usr/lib /usr/X11R6/lib ${prefix}/lib
-	if {[info exists env(DYLD_FALLBACK_LIBRARY_PATH)]} {
-	    lappend search_path $env(DYLD_FALLBACK_LIBRARY_PATH)
-	}
-
-	set i [string first . $depline]
-	if {$i < 0} {set i [string length $depline]}
-	set depname [string range $depline 0 [expr $i - 1]]
-	set depversion [string range $depline $i end]
-	regsub {\.} $depversion {\.} depversion
-	if {$tcl_platform(os) == "Darwin"} {
-		set depregex \^${depname}${depversion}\\.dylib\$
-	} else {
-		set depregex \^${depname}\\.so${depversion}\$
-	}
-
-	return [_mportsearchpath $depregex $search_path]
-}
-
-### _bintest is private; subject to change without notice
-
-proc _bintest {mport depspec} {
-    global env
-	set depregex [lindex [split $depspec :] 1]
-	set prefix [_mportkey $mport prefix] 
-	
-	set search_path [split $env(PATH) :]
-	
-	set depregex \^$depregex\$
-	
-	return [_mportsearchpath $depregex $search_path 1]
-}
-
-### _pathtest is private; subject to change without notice
-
-proc _pathtest {mport depspec} {
-    global env
-	set depregex [lindex [split $depspec :] 1]
-	set prefix [_mportkey $mport prefix] 
-    
-	# separate directory from regex
-	set fullname $depregex
-
-	regexp {^(.*)/(.*?)$} "$fullname" match search_path depregex
-
-	if {[string index $search_path 0] != "/"} {
-		# Prepend prefix if not an absolute path
-		set search_path "${prefix}/${search_path}"
-	}
-
-	set depregex \^$depregex\$
-
-	return [_mportsearchpath $depregex $search_path]
-}
-
-### _porttest is private; subject to change without notice
-
-proc _porttest {mport depspec} {
-	# We don't actually look for the port, but just return false
-	# in order to let the mportdepends handle the dependency
-	return 0
-}
-
-### _mportinstalled is private; may change without notice
-
-# Determine if a port is already *installed*, as in "in the registry".
-proc _mportinstalled {mport} {
-	# Check for the presense of the port in the registry
-	set workername [ditem_key $mport workername]
-	set res [$workername eval registry_exists \${portname} \${portversion}]
-	if {$res != 0} {
-		ui_debug "[ditem_key $mport provides] is installed"
-		return 1
-	} else {
-		return 0
-	}
-}
-
-### _mportispresent is private; may change without notice
-
-# Determine if some depspec is satisfied or if the given port is installed.
-# We actually start with the registry (faster?)
-#
-# mport		the port to test (to figure out if it's present)
-# depspec	the dependency test specification (path, bin, lib, etc.)
-proc _mportispresent {mport depspec} {
-	# Check for the presense of the port in the registry
-	set workername [ditem_key $mport workername]
-	ui_debug "Searching for dependency: [ditem_key $mport provides]"
-	if {[catch {set reslist [$workername eval registry_installed \${portname}]} res]} {
-		set res 0
-	} else {
-		set res [llength $reslist]
-	}
-	if {$res != 0} {
-		ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
-		return 1
-	} else {
-		# The receipt test failed, use one of the depspec regex mechanisms
-		ui_debug "Didn't find receipt, going to depspec regex for: [ditem_key $mport provides]"
-		set type [lindex [split $depspec :] 0]
-		switch $type {
-			lib { return [_libtest $mport $depspec] }
-			bin { return [_bintest $mport $depspec] }
-			path { return [_pathtest $mport $depspec] }
-			port { return [_porttest $mport $depspec] }
-			default {return -code error "unknown depspec type: $type"}
-		}
-		return 0
-	}
-}
-
-### _mportexec is private; may change without notice
-
-proc _mportexec {target mport} {
-	# xxx: set the work path?
-	set workername [ditem_key $mport workername]
-	if {![catch {$workername eval check_variants variations $target} result] && $result == 0 &&
-		![catch {$workername eval eval_targets $target} result] && $result == 0} {
-		# If auto-clean mode, clean-up after dependency install
-		if {[string equal ${macports::portautoclean} "yes"]} {
-			# Make sure we are back in the port path before clean
-			# otherwise if the current directory had been changed to
-			# inside the port,  the next port may fail when trying to
-			# install because [pwd] will return a "no file or directory"
-			# error since the directory it was in is now gone.
-			set portpath [ditem_key $mport portpath]
-			catch {cd $portpath}
-			$workername eval eval_targets clean
-		}
-		return 0
-	} else {
-		# An error occurred.
-		return 1
-	}
-}
-
-# mportexec
-# Execute the specified target of the given mport.
-
-proc mportexec {mport target} {
-    global macports::registry.installtype
-
-	set workername [ditem_key $mport workername]
-
-	# check variants
-	if {[$workername eval check_variants variations $target] != 0} {
-		return 1
-	}
-	
-	# Before we build the port, we must build its dependencies.
-	# XXX: need a more general way of comparing against targets
-	set dlist {}
-	if {$target == "package"} {
-		ui_warn "package target replaced by pkg target, please use the pkg target in the future."
-		set target "pkg"
-	}
-	if {$target == "configure" || $target == "build"
-		|| $target == "test"
-		|| $target == "destroot" || $target == "install"
-		|| $target == "archive"
-		|| $target == "pkg" || $target == "mpkg"
-		|| $target == "rpmpackage" || $target == "dpkg" } {
-
-		if {[mportdepends $mport $target] != 0} {
-			return 1
-		}
-		
-		# Select out the dependents along the critical path,
-		# but exclude this mport, we might not be installing it.
-		set dlist [dlist_append_dependents $macports::open_mports $mport {}]
-		
-		dlist_delete dlist $mport
-
-		# install them
-		# xxx: as with below, this is ugly.  and deps need to be fixed to
-		# understand Port Images before this can get prettier
-		if { [string equal ${macports::registry.installtype} "image"] } {
-			set result [dlist_eval $dlist _mportinstalled [list _mportexec "activate"]]
-		} else {
-			set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
-		}
-		
-		if {$result != {}} {
-			set errstring "The following dependencies failed to build:"
-			foreach ditem $result {
-				append errstring " [ditem_key $ditem provides]"
-			}
-			ui_error $errstring
-			return 1
-		}
-		
-		# Close the dependencies, we're done installing them.
-		foreach ditem $dlist {
-			mportclose $ditem
-		}
-	}
-
-	# If we're doing an install, check if we should clean after
-	set clean 0
-	if {[string equal ${macports::portautoclean} "yes"] && [string equal $target "install"] } {
-		set clean 1
-	}
-
-	# If we're doing image installs, then we should activate after install
-	# xxx: This isn't pretty
-	if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
-		set target activate
-	}
-	
-	# Build this port with the specified target
-	set result [$workername eval eval_targets $target]
-
-	# If auto-clean mode and successful install, clean-up after install
-	if {$result == 0 && $clean == 1} {
-		# Make sure we are back in the port path, just in case
-		set portpath [ditem_key $mport portpath]
-		catch {cd $portpath}
-		$workername eval eval_targets clean
-	}
-
-	return $result
-}
-
-proc macports::getsourcepath {url} {
-    global macports::portdbpath
-    set source_path [split $url ://]
-    return [file join $portdbpath sources [lindex $source_path 3] [lindex $source_path 4] [lindex $source_path 5]]
-}
-
-proc macports::getportbuildpath {id} {
-	global macports::portdbpath
-	regsub {://} $id {.} port_path
-	regsub -all {/} $port_path {_} port_path
-	return [file join $portdbpath build $port_path]
-}
-
-proc macports::getportworkpath_from_buildpath {portbuildpath} {
-    return [file join $portbuildpath work]
-}
-
-proc macports::getportworkpath_from_portdir {portpath} {
-    return [macports::getportworkpath_from_buildpath [macports::getportbuildpath $portpath]]
-}
-
-proc macports::getindex {source} {
-	# Special case file:// sources
-	if {[macports::getprotocol $source] == "file"} {
-		return [file join [macports::getportdir $source] PortIndex]
-	}
-
-	return [file join [macports::getsourcepath $source] PortIndex]
-}
-
-proc mportsync {} {
-    global macports::sources macports::portdbpath macports::rsync_options tcl_platform
-    global macports::autoconf::rsync_path 
-    
-    ui_debug "Synchronizing ports tree(s)"
-    foreach source $sources {
-	set flags [lrange $source 1 end]
-	set source [lindex $source 0]
-	if {[lsearch -exact $flags nosync] != -1} {
-	    ui_debug "Skipping $source"
-	    continue
-	}
-	ui_info "Synchronizing from $source"
-	switch -regexp -- [macports::getprotocol $source] {
-	    {^file$} {
-		set portdir [macports::getportdir $source]
-		if {[file exists $portdir/.svn]} {
-		    set svn_commandline "[macports::findBinary svn ${macports::autoconf::svn_path}] update --non-interactive ${portdir}"
-		    ui_debug $svn_commandline
-		    if {[catch {
-			set euid [geteuid]
-			set egid [getegid]
-			ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
-			setegid [name_to_gid [file attributes $portdir -group]]
-			seteuid [name_to_uid [file attributes $portdir -owner]]
-			system $svn_commandline
-			seteuid $euid
-			setegid $egid
-		    }]} {
-			ui_debug "$::errorInfo"
-			return -code error "sync failed doing svn update"
-		    }
-		}
-	    }
-	    {^mports$} {
-		macports::index::sync $macports::portdbpath $source
-	    }
-	    {^rsync$} {
-		# Where to, boss?
-		set destdir [file dirname [macports::getindex $source]]
-
-		file mkdir $destdir
-		
-		# Keep rsync happy with a trailing slash
-		if {[string index $source end] != "/"} {
-		    set source "${source}/"
-		}
-
-		# Do rsync fetch
-		set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${source} ${destdir}"
-		ui_debug $rsync_commandline
-		if {[catch {system $rsync_commandline}]} {
-		    return -code error "sync failed doing rsync"
-		}
-		if {[catch {system "chmod -R a+r \"$destdir\""}]} {
-		    ui_warn "Setting world read permissions on parts of the ports tree failed, need root?"
-		}
-	    }
-	    {^https?$|^ftp$} {
-		set indexfile [macports::getindex $source]
-		file mkdir [file dirname $indexfile]
-		exec curl -L -s -S -o $indexfile $source/PortIndex
-	    }
-	    default {
-		ui_warn "Unknown protocol for $source"
-	    }
-	}
-    }
-}
-
-proc mportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
-	global macports::portdbpath macports::sources
-	set matches [list]
-	set easy [expr { $field == "name" }]
-	
-	set found 0
-	foreach source $sources {
-	        set flags [lrange $source 1 end]
-	        set source [lindex $source 0]
-		if {[macports::getprotocol $source] == "mports"} {
-			array set attrs [list name $pattern]
-			set res [macports::index::search $macports::portdbpath $source [array get attrs]]
-			eval lappend matches $res
-		} else {
-			if {[catch {set fd [open [macports::getindex $source] r]} result]} {
-				ui_warn "Can't open index file for source: $source"
-			} else {
-			    try {
-				incr found 1
-				while {[gets $fd line] >= 0} {
-					array unset portinfo
-					set name [lindex $line 0]
-				        set len [lindex $line 1]
-				        set line [read $fd $len]
-
-						if {$easy} {
-						    set target $name
-						} else {
-							array set portinfo $line
-						    if {![info exists portinfo($field)]} continue
-						    set target $portinfo($field)
-						}
-
-				    switch $matchstyle {
-					exact { set matchres [expr 0 == ( {$case_sensitive == "yes"} ? [string compare $pattern $target] : [string compare -nocase $pattern $target] )] }
-					glob { set matchres [expr {$case_sensitive == "yes"} ? [string match $pattern $target] : [string match -nocase $pattern $target]] }
-					regexp -
-					default { set matchres [expr {$case_sensitive == "yes"} ? [regexp -- $pattern $target] : [regexp -nocase -- $pattern $target]] }
-				    }
-
-				    if {$matchres == 1} {
-					if {$easy} {
-					    array set portinfo $line
-					}
-					switch -regexp -- [macports::getprotocol ${source}] {
-					    {^rsync$} {
-						# Rsync files are local
-						set source_url "file://[macports::getsourcepath $source]"
-					    }
-					    default {
-						set source_url $source
-					    }
-					}
-					if {[info exists portinfo(portarchive)]} {
-					    set porturl ${source_url}/$portinfo(portarchive)
-					} elseif {[info exists portinfo(portdir)]} {
-					    set porturl ${source_url}/$portinfo(portdir)
-					}
-					if {[info exists porturl]} {
-					    lappend line porturl $porturl
-					    ui_debug "Found port in $porturl"
-					} else {
-					    ui_debug "Found port info: $line"
-					}
-					lappend matches $name
-					lappend matches $line
-				    }
-				}
-			    } catch {*} {
-				ui_warn "It looks like your PortIndex file may be corrupt."
-				throw
-			    } finally {
-				close $fd
-			    }
-			}
-		}
-	}
-	if {!$found} {
-		return -code error "No index(es) found! Have you synced your source indexes?"
-	}
-
-	return $matches
-}
-
-proc mportinfo {mport} {
-	set workername [ditem_key $mport workername]
-    return [$workername eval array get PortInfo]
-}
-
-proc mportclose {mport} {
-	global macports::open_mports
-	set refcnt [ditem_key $mport refcnt]
-	incr refcnt -1
-	ditem_key $mport refcnt $refcnt
-	if {$refcnt == 0} {
-		dlist_delete macports::open_mports $mport
-		set workername [ditem_key $mport workername]
-		interp delete $workername
-	}
-}
-
-##### Private Depspec API #####
-# This API should be considered work in progress and subject to change without notice.
-##### "
-
-# _mportkey
-# - returns a variable from the port's interpreter
-
-proc _mportkey {mport key} {
-	set workername [ditem_key $mport workername]
-	return [$workername eval "return \$${key}"]
-}
-
-# mportdepends builds the list of mports which the given port depends on.
-# This list is added to $mport.
-# This list actually depends on the target.
-# This method can optionally recurse through the dependencies, looking for
-#   dependencies of dependencies.
-# This method can optionally cut the search when ports are already installed or
-#   the dependencies are satisfied.
-#
-# mport -> mport item
-# target -> target to consider the dependency for
-# recurseDeps -> if the search should be recursive
-# skipSatisfied -> cut the search tree when encountering installed/satisfied
-#                  dependencies ports.
-# accDeps -> accumulator for recursive calls
-# return 0 if everything was ok, an non zero integer otherwise.
-proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDeps {}}} {
-
-	array set portinfo [mportinfo $mport]
-	set depends {}
-	set deptypes {}
-		
-	# Determine deptypes to look for based on target
-	switch $target {
-		configure	{ set deptypes "depends_lib" }
-		
-		build		{ set deptypes "depends_lib depends_build" }
-		
-		test		-
-		destroot	-
-		install		-
-		archive		-
-		pkg			-
-		mpkg		-
-		rpmpackage	-
-		dpkg		-
-		""			{ set deptypes "depends_lib depends_build depends_run" }
-	}
-	
-	# Gather the dependencies for deptypes
-	foreach deptype $deptypes {
-		# Add to the list of dependencies if the option exists and isn't empty.
-		if {[info exists portinfo($deptype)] && $portinfo($deptype) != ""} {
-			set depends [concat $depends $portinfo($deptype)]
-		}
-	}
-
-	set subPorts {}
-	
-	foreach depspec $depends {
-		# grab the portname portion of the depspec
-		set dep_portname [lindex [split $depspec :] end]
-		
-		# Find the porturl
-		if {[catch {set res [mportsearch $dep_portname false exact]} error]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Internal error: port search failed: $error"
-			return 1
-		}
-		foreach {name array} $res {
-			array set portinfo $array
-			if {[info exists portinfo(porturl)]} {
-				set porturl $portinfo(porturl)
-				break
-			}
-		}
-
-		if {![info exists porturl]} {
-			ui_error "Dependency '$dep_portname' not found."
-			return 1
-		}
-
-		set options [ditem_key $mport options]
-		set variations [ditem_key $mport variations]
-
-		# Figure out the subport.	
-		set subport [mportopen $porturl $options $variations]
-
-		# Is that dependency satisfied or this port installed?
-		# If we don't skip or if it is not, add it to the list.
-		if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
-			# Append the sub-port's provides to the port's requirements list.
-			ditem_append_unique $mport requires "[ditem_key $subport provides]"
-	
-			if {$recurseDeps} {
-				# Skip the port if it's already in the accumulated list.
-				if {[lsearch $accDeps $dep_portname] == -1} {
-					# Add it to the list
-					lappend accDeps $dep_portname
-				
-					# We'll recursively iterate on it.
-					lappend subPorts $subport
-				}
-			}
-		}
-	}
-
-	# Loop on the subports.
-	if {$recurseDeps} {
-		foreach subport $subPorts {
-			# Sub ports should be installed (all dependencies must be satisfied).
-			set res [mportdepends $subport "" $recurseDeps $skipSatisfied $accDeps]
-			if {$res != 0} {
-				return $res
-			}
-		}
-	}
-	
-	return 0
-}
-
-# selfupdate procedure
-proc macports::selfupdate {optionslist} {
-	global macports::prefix macports::portdbpath macports::rsync_server macports::rsync_dir macports::rsync_options
-	global macports::autoconf::macports_conf_path macports::autoconf::rsync_path
-	array set options $optionslist
-	
-	if { [info exists options(ports_force)] && $options(ports_force) == "yes" } {
-		set use_the_force_luke yes
-		ui_debug "Forcing a rebuild of the MacPorts base system."
-	} else {
-		set use_the_force_luke no
-		ui_debug "Rebuilding the MacPorts base system if needed."
-	}
-	# syncing ports tree. We expect the user have rsync:// in the sources.conf
-	if {[catch {mportsync} result]} {
-		return -code error "Couldn't sync the ports tree: $result"
-	}
-
-	set mp_base_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}/]
-	if {![file exists $mp_base_path]} {
-		file mkdir $mp_base_path
-	}
-	ui_debug "MacPorts base dir: $mp_base_path"
-
-	# get user of the MacPorts system
-	set user [file attributes [file join $portdbpath sources/] -owner]
-	ui_debug "Setting user: $user"
-
-	# get MacPorts version 
-    set mp_version_path [file join ${macports_conf_path} mp_version]
-	if { [file exists $mp_version_path]} {
-		set fd [open $mp_version_path r]
-		gets $fd mp_version_old
-		close $fd
-	} else {
-		set mp_version_old 0
-	}
-	ui_msg "MacPorts base version $mp_version_old installed"
-
-	ui_debug "Updating using rsync"
-	if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir} $mp_base_path" } ] } {
-		return -code error "Error: rsync failed in selfupdate"
-	}
-
-	# get downloaded macports version and write the old version back
-	set fd [open [file join $mp_base_path config mp_version] r]
-	gets $fd mp_version_new
-	close $fd
-	ui_msg "Downloaded MacPorts base version $mp_version_new"
-
-	# check if we we need to rebuild base
-	if {$mp_version_new > $mp_version_old || $use_the_force_luke == "yes"} {
-		ui_msg "Configuring, Building and Installing new MacPorts base"
-		# check if $prefix/bin/port is writable, if so we go !
-		# get installation user / group 
-		set owner root
-		set group admin
-	        set portprog [file join $prefix bin port]
-		if {[file exists $portprog ]} {
-			# set owner
-			set owner [file attributes $portprog -owner]
-			# set group
-			set group [file attributes $portprog -group]
-		}
-		set p_user [exec /usr/bin/whoami]
-		if {[file writable $portprog] || [string equal $p_user $owner] } {
-			ui_debug "permissions OK"
-		} else {
-			return -code error "Error: $p_user cannot write to ${prefix}/bin - try using sudo"
-		}
-		ui_debug "Setting owner: $owner group: $group"
-
-		set mp_tclpackage_path [file join $portdbpath .tclpackage]
-		if { [file exists $mp_tclpackage_path]} {
-			set fd [open $mp_tclpackage_path r]
-			gets $fd tclpackage
-			close $fd
-		} else {
-			set tclpackage [file join ${prefix} share macports Tcl]
-		}
-		# do the actual installation of new base
-		ui_debug "Install in: $prefix as $owner : $group - TCL-PACKAGE in $tclpackage"
-		if { [catch { system "cd $mp_base_path && ./configure --prefix=$prefix --with-install-user=$owner --with-install-group=$group --with-tclpackage=$tclpackage && make && make install" } result] } {
-			return -code error "Error installing new MacPorts base: $result"
-		}
-	} else {
-		ui_msg "The MacPorts installation is not outdated and so was not updated"
-	}
-
-	# set the macports system to the right owner 
-	ui_debug "Setting ownership to $user"
-	if { [catch { exec chown -R $user [file join $portdbpath sources/] } result] } {
-		return -code error "Couldn't change permissions: $result"
-	}
-
-	# set the right version
-	ui_msg "selfupdate done!"
-
-	return 0
-}
-
-proc macports::version {} {
-	global macports::rsync_server macports::rsync_dir
-        global macports::autoconf::macports_conf_path
-	
-    set mp_version_path [file join ${macports_conf_path} mp_version]
-
-	if [file exists $mp_version_path] {
-		set fd [open $mp_version_path r]
-		gets $fd retval
-	        close $fd
-		return $retval
-	} else {
-		return -1
-	}
-}
-
-# upgrade procedure
-proc macports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
-	global macports::registry.installtype
-	global macports::portarchivemode
-	array set options $optionslist
-	array set variations $variationslist
-	if {![string match "" $depscachename]} {
-		upvar $depscachename depscache
-	} 
-
-	# set to no-zero is epoch overrides version
-	set epoch_override 0
-
-	# check if the port is in tree
-	if {[catch {mportsearch $portname false exact} result]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "port search failed: $result"
-		return 1
-	}
-	# argh! port doesnt exist!
-	if {$result == ""} {
-		ui_error "No port $portname found."
-		return 1
-	}
-	# fill array with information
-	array set portinfo [lindex $result 1]
-
-	# set version_in_tree
-	if {![info exists portinfo(version)]} {
-		ui_error "Invalid port entry for $portname, missing version"
-		return 1
-	}
-	set version_in_tree "$portinfo(version)_$portinfo(revision)"
-	set epoch_in_tree "$portinfo(epoch)"
-
-	# the depflag tells us if we should follow deps (this is for stuff installed outside MacPorts)
-	# if this is set (not 0) we dont follow the deps
-	set depflag 0
-
-	# set version_installed
-	set ilist {}
-	if { [catch {set ilist [registry::installed $portname ""]} result] } {
-		if {$result == "Registry error: $portname not registered as installed." } {
-			ui_debug "$portname is *not* installed by MacPorts"
-			# open porthandle    
-			set porturl $portinfo(porturl)
-		    if {![info exists porturl]} {
-		        set porturl file://./    
-			}    
-			if {[catch {set workername [mportopen $porturl [array get options] ]} result]} {
-					global errorInfo
-					ui_debug "$errorInfo"
-			        ui_error "Unable to open port: $result"        
-					return 1
-		    }
-
-			if {![_mportispresent $workername $dspec ] } {
-				# port in not installed - install it!
-				if {[catch {set result [mportexec $workername install]} result]} {
-					global errorInfo
-					ui_debug "$errorInfo"
-					ui_error "Unable to exec port: $result"
-					return 1
-				}
-			} else {
-				# port installed outside MacPorts
-				ui_debug "$portname installed outside the MacPorts system"
-				set depflag 1
-			}
-
-		} else {
-			ui_error "Checking installed version failed: $result"
-			exit 1
-		}
-	}
-	set anyactive 0
-	set version_installed 0
-	set epoch_installed 0
-	if {$ilist == ""} {
-		# XXX  this sets $version_installed to $version_in_tree even if not installed!!
-		set version_installed $version_in_tree
-		# That was a very dirty hack showing how ugly our depencendy and upgrade code is.
-		# To get it working when user provides -f, we also need to set the variant to
-		# avoid a future failure.
-		set variant ""
-	} else {
-		# a port could be installed but not activated
-		# so, deactivate all and save newest for activation later
-		set num 0
-		set variant ""
-		foreach i $ilist {
-			set variant [lindex $i 3]
-			set version "[lindex $i 1]_[lindex $i 2]"
-			if { [rpm-vercomp $version $version_installed] > 0} {
-				set version_installed $version
-				set epoch_installed [registry::property_retrieve [registry::open_entry $portname [lindex $i 1] [lindex $i 2] $variant] epoch]
-				set num $i
-			}
-
-			set isactive [lindex $i 4]
-			if {$isactive == 1 && [rpm-vercomp $version_installed $version] < 0 } {
-				# deactivate version
-    			if {[catch {portimage::deactivate $portname $version $optionslist} result]} {
-					global errorInfo
-					ui_debug "$errorInfo"
-    	    		ui_error "Deactivating $portname $version_installed failed: $result"
-    	    		return 1
-    			}
-			}
-		}
-        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
-			# activate the latest installed version
-			if {[catch {portimage::activate $portname $version_installed$variant $optionslist} result]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-    			ui_error "Activating $portname $version_installed failed: $result"
-				return 1
-			}
-		}
-	}
-
-	# output version numbers
-	ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed"
-	ui_debug "$portname $version_in_tree exists in the ports tree"
-	ui_debug "$portname $version_installed is installed"
-
-	# set the nodeps option  
-	if {![info exists options(ports_nodeps)]} {
-		set nodeps no
-	} else {	
-		set nodeps yes
-	}
-
-	if {$nodeps == "yes" || $depflag == 1} {
-		ui_debug "Not following dependencies"
-		set depflag 0
-	} else {
-		# build depends is upgraded
-		if {[info exists portinfo(depends_build)]} {
-			foreach i $portinfo(depends_build) {
-				if {![llength [array get depscache $i]]} {
-				set d [lindex [split $i :] end]
-					set depscache($i) 1
-					upgrade $d $i $variationslist $optionslist depscache
-				} 
-			}
-		}
-		# library depends is upgraded
-		if {[info exists portinfo(depends_lib)]} {
-			foreach i $portinfo(depends_lib) {
-				if {![llength [array get depscache $i]]} {
-				set d [lindex [split $i :] end]
-					set depscache($i) 1
-					upgrade $d $i $variationslist $optionslist depscache
-				} 
-			}
-		}
-		# runtime depends is upgraded
-		if {[info exists portinfo(depends_run)]} {
-			foreach i $portinfo(depends_run) {
-				if {![llength [array get depscache $i]]} {
-				set d [lindex [split $i :] end]
-					set depscache($i) 1
-					upgrade $d $i $variationslist $optionslist depscache
-				} 
-			}
-		}
-	}
-
-	# check installed version against version in ports
-	if { [rpm-vercomp $version_installed $version_in_tree] >= 0 && ![info exists options(ports_force)] } {
-		ui_debug "No need to upgrade! $portname $version_installed >= $portname $version_in_tree"
-		if { $epoch_installed >= $epoch_in_tree } {
-			# Check if we have to do dependents
-			if {[info exists options(ports_do_dependents)]} {
-				# We do dependents ..
-				set options(ports_nodeps) 1
-
-				registry::open_dep_map
-	   			set deplist [registry::list_dependents $portname]
-
-				if { [llength deplist] > 0 } {
-					foreach dep $deplist {
-						set mpname [lindex $dep 2] 
-						macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
-					}
-				}
-			}
-
-			return 0
-		} else {
-			ui_debug "epoch override ... upgrading!"
-			set epoch_override 1
-		}
-	}
-
-	# open porthandle
-	set porturl $portinfo(porturl)
-	if {![info exists porturl]} {
-		set porturl file://./
-	}
-
-	# check if the variants is present in $version_in_tree
-	set oldvariant $variant
-	set variant [split $variant +]
-	ui_debug "variants to install $variant"
-	if {[info exists portinfo(variants)]} {
-		set avariants $portinfo(variants)
-	} else {
-		set avariants {}
-	}
-	ui_debug "available variants are : $avariants"
-	foreach v $variant {
-		if {[lsearch $avariants $v] == -1} {
-		} else {
-			ui_debug "variant $v is present in $portname $version_in_tree"
-			set variations($v) "+"
-		}
-	}
-	ui_debug "new portvariants: [array get variations]"
-	
-	if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Unable to open port: $result"
-		return 1
-	}
-
-	# install version_in_tree
-	if {0 == [string compare "yes" ${macports::portarchivemode}]} {
-		set upgrade_action "archive"
-	} else {
-		set upgrade_action "destroot"
-	}
-
-	if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Unable to upgrade port: $result"
-		return 1
-	}
-
-	# uninstall old ports
-    if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${macports::registry.installtype}] } {
-		# uninstall old
-		ui_debug "Uninstalling $portname $version_installed$oldvariant"
-		if {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-     		ui_error "Uninstall $portname $version_installed$oldvariant failed: $result"
-       		return 1
-    	}
-	} else {
-		# XXX deactivate version_installed
-		if {[catch {portimage::deactivate $portname $version_installed$oldvariant $optionslist} result]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Deactivating $portname $version_installed failed: $result"
-			return 1
-		}
-	}
-
-	if {[catch {set result [mportexec $workername install]} result]} {
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Couldn't activate $portname $version_in_tree$oldvariant: $result"
-		return 1
-	}
-
-	# Check if we have to do dependents
-	if {[info exists options(ports_do_dependents)]} {
-		# We do dependents ..
-		set options(ports_nodeps) 1
-
-		registry::open_dep_map
-	   	set deplist [registry::list_dependents $portname]
-
-		if { [llength deplist] > 0 } {
-			foreach dep $deplist {
-				set mpname [lindex $dep 2] 
-				macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
-			}
-		}
-	}
-
-	
-	# close the port handle
-	mportclose $workername
-}

Copied: trunk/base/src/macports1.0/macports.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports.tcl)
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/macports.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,1911 @@
+# macports.tcl
+# $Id$
+#
+# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot at kallisys.net>.
+# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb at opendarwin.org>.
+# Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+package provide macports 1.0
+package require macports_dlist 1.0
+package require macports_index 1.0
+package require macports_util 1.0
+
+namespace eval macports {
+    namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
+    variable bootstrap_options "\
+    	portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
+    	portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
+    	porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
+    	rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
+        mp_remote_url mp_remote_submit_url"
+    variable user_options "submitter_name submitter_email submitter_key"
+    variable portinterp_options "\
+    	portdbpath portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
+    	registry.path registry.format registry.installtype portarchivemode portarchivepath \
+    	portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
+    	rsync_options rsync_dir startupitem_type place_worksymlink \
+        mp_remote_url mp_remote_submit_url \
+    	$user_options"
+    
+    # deferred options are only computed when needed.
+    # they are not exported to the trace thread.
+    # they are not exported to the interpreter in system_options array.
+    variable portinterp_deferred_options "xcodeversion xcodebuildcmd"
+	
+    variable open_mports {}
+    
+    variable ui_priorities "debug info msg error warn"
+}
+
+# Provided UI instantiations
+# For standard messages, the following priorities are defined
+#     debug, info, msg, warn, error
+# Clients of the library are expected to provide ui_prefix and ui_channels with
+# the following prototypes.
+#     proc ui_prefix {priority}
+#     proc ui_channels {priority}
+# ui_prefix returns the prefix for the messages, if any.
+# ui_channels returns a list of channels to output the message to, empty for
+#     no message.
+# if these functions are not provided, defaults are used, but this should
+# not be relied upon for production code
+
+proc macports::ui_init {priority message} {
+	# Get the list of channels.
+	if {[llength [info commands ui_channels]] > 0} {
+		set channels [ui_channels $priority]
+	} else {
+	    set channels [ui_channels_default $priority]
+	}
+
+	# Simplify ui_$priority.
+	set nbchans [llength $channels]
+	if {$nbchans == 0} {
+		proc ::ui_$priority {str} {}
+	} else {
+		if {[llength [info commands ui_prefix]] > 0} {
+			set prefix [ui_prefix $priority]
+		} else {
+		    set prefix [ui_prefix_default $priority]
+		}
+
+		if {$nbchans == 1} {
+			set chan [lindex $channels 0]
+			proc ::ui_$priority {str} [subst { puts $chan "$prefix\$str" }]
+		} else {
+			proc ::ui_$priority {str} [subst {
+				foreach chan \$channels {
+					puts $chan "$prefix\$str"
+				}
+			}]
+		}
+
+		# Call ui_$priority
+		::ui_$priority $message
+	}
+}
+
+# Defult implementation of ui_prefix
+proc macports::ui_prefix_default {priority} {
+	switch $priority {
+		debug {
+			return "DEBUG: "
+		}
+		error {
+			return "Error: "
+		}
+		warn {
+			return "Warning: "
+		}
+		default {
+			return ""
+		} 
+	}
+}
+
+# Default implementation of ui_channels
+proc macports::ui_channels_default {priority} {
+    switch $priority {
+        debug -
+        info {
+            return {}
+        }
+        msg {
+            return {stdout}
+        }
+        error {
+            return {stderr}
+        }
+        default {
+            return {stdout}
+        }
+    }
+}
+
+foreach priority ${macports::ui_priorities} {
+    proc ui_$priority {str} [subst { macports::ui_init $priority \$str }]
+}
+
+# Replace puts to catch errors (typically broken pipes when being piped to head)
+rename puts tcl::puts
+proc puts {args} {
+	catch "tcl::puts $args"
+}
+
+# find a binary either in a path defined at MacPorts' configuration time
+# or in the PATH environment variable through macports::binaryInPath (fallback)
+proc macports::findBinary {prog {autoconf_hint ""}} {
+    if {${autoconf_hint} != "" && [file executable ${autoconf_hint}]} {
+	return ${autoconf_hint}
+    } else {
+	if {[catch {set cmd_path [macports::binaryInPath ${prog}]} result] == 0} {
+	    return ${cmd_path}
+	} else {
+	    return -code error "${result} or at its MacPorts configuration time location, did you move it?"
+	}
+    }
+}
+
+# check for a binary in the path
+# returns an error code if it can not be found
+proc macports::binaryInPath {prog} {
+    global env
+    foreach dir [split $env(PATH) :] { 
+	if {[file executable [file join $dir $prog]]} {
+	    return [file join $dir $prog]
+	}
+    }
+    return -code error [format [msgcat::mc "Failed to locate '%s' in path: '%s'"] $prog $env(PATH)];
+}
+
+# deferred option processing
+proc macports::getoption {name} {
+	global macports::$name
+	return [expr $$name]
+}
+
+# deferred and on-need extraction of xcodeversion and xcodebuildcmd.
+proc macports::setxcodeinfo {name1 name2 op} {
+	global macports::xcodeversion
+	global macports::xcodebuildcmd
+	
+	trace remove variable macports::xcodeversion read macports::setxcodeinfo
+	trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
+
+	if {[catch {set xcodebuild [binaryInPath "xcodebuild"]}] == 0} {
+		if {![info exists xcodeversion]} {
+			# Determine xcode version (<= 2.0 or 2.1)
+			if {[catch {set xcodebuildversion [exec xcodebuild -version]}] == 0} {
+				if {[regexp "DevToolsCore-(.*); DevToolsSupport-(.*)" $xcodebuildversion devtoolscore_v devtoolssupport_v] == 1} {
+					if {$devtoolscore_v >= 620.0 && $devtoolssupport_v >= 610.0} {
+						# for now, we don't need to distinguish 2.1 from 2.1 or higher.
+						set macports::xcodeversion "2.1"
+					} else {
+						set macports::xcodeversion "2.0orlower"
+					}
+				} else {
+					set macports::xcodeversion "2.0orlower"
+				}
+			} else {
+				set macports::xcodeversion "2.0orlower"
+			}
+		}
+		
+		if {![info exists xcodebuildcmd]} {
+			set macports::xcodebuildcmd "xcodebuild"
+		}
+	} elseif {[catch {set pbxbuild [binaryInPath "pbxbuild"]}] == 0} {
+		if {![info exists xcodeversion]} {
+			set macports::xcodeversion "pb"
+		}
+		if {![info exists xcodebuildcmd]} {
+			set macports::xcodebuildcmd "pbxbuild"
+		}
+	} else {
+		if {![info exists xcodeversion]} {
+			set macports::xcodeversion "none"
+		}
+		if {![info exists xcodebuildcmd]} {
+			set macports::xcodebuildcmd "none"
+		}
+	}
+}
+
+
+proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
+	if {$up_ui_options eq ""} {
+		array set ui_options {}
+	} else {
+		upvar $up_ui_options ui_options
+	}
+	if {$up_options eq ""} {
+		array set options {}
+	} else {
+		upvar $up_options options
+	}
+	if {$up_variations eq ""} {
+		array set $up_variations {}
+	} else {
+		upvar $up_variations variations
+	}
+	
+	global auto_path env
+	global macports::autoconf::macports_conf_path
+        global macports::macports_user_dir
+	global macports::bootstrap_options
+	global macports::user_options
+	global macports::extra_env
+	global macports::portconf
+	global macports::portdbpath
+	global macports::portsharepath
+	global macports::registry.format
+	global macports::registry.path
+	global macports::sources
+	global macports::sources_conf
+   	global macports::destroot_umask
+   	global macports::libpath
+   	global macports::prefix
+        global macports::prefix_frozen
+   	global macports::registry.installtype
+   	global macports::rsync_dir
+   	global macports::rsync_options
+   	global macports::rsync_server
+   	global macports::variants_conf
+   	global macports::xcodebuildcmd
+   	global macports::xcodeversion
+
+        # Set the system encoding to utf-8
+        encoding system utf-8
+
+        # Ensure that the macports user directory exists if HOME is defined
+        if {[info exists env(HOME)]} {
+	    set macports::macports_user_dir [file normalize $macports::autoconf::macports_user_dir]
+	    if { ![file exists $macports_user_dir] } {
+		# If not, create it with ownership of the enclosing directory, rwx by the user only
+		file mkdir $macports_user_dir
+		file attributes $macports_user_dir -permissions u=rwx,go= \
+		    -owner [file attributes $macports_user_dir/.. -owner] \
+		    -group [file attributes $macports_user_dir/.. -group]
+	    }
+	} else {
+	    # Otherwise define the user directory as a direcotory that will never exist
+	    set macports::macports_user_dir "/dev/null/NO_HOME_DIR"
+	}
+   	
+   	# Configure the search path for configuration files
+   	set conf_files ""
+        if {[info exists env(PORTSRC)]} {
+	    set PORTSRC $env(PORTSRC)
+	    lappend conf_files ${PORTSRC}
+	}
+    if { [file isdirectory macports_user_dir] } {
+	lappend conf_files "${macports_user_dir}/macports.conf"
+    }
+    lappend conf_files "${macports_conf_path}/macports.conf"
+    
+    # Process the first configuration file we find on conf_files list
+	foreach file $conf_files {
+		if [file exists $file] {
+			set portconf $file
+			set fd [open $file r]
+			while {[gets $fd line] >= 0} {
+				if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
+					if {[lsearch $bootstrap_options $option] >= 0} {
+						set macports::$option $val
+						global macports::$option
+					}
+				}
+			}
+			
+			break
+		}
+	}
+	
+	# Process per-user only settings
+        set per_user "${macports_user_dir}/user.conf"
+	if [file exists $per_user] {
+		set fd [open $per_user r]
+		while {[gets $fd line] >= 0} {
+			if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
+				if {[lsearch $user_options $option] >= 0} {
+					set macports::$option $val
+					global macports::$option
+				}
+			}
+		}
+	}
+	
+    if {![info exists sources_conf]} {
+        return -code error "sources_conf must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf file"
+    }
+    set fd [open $sources_conf r]
+    while {[gets $fd line] >= 0} {
+        set line [string trimright $line]
+	if {![regexp {^\s*#|^$} $line]} {
+	    if {[regexp {^([\w-]+://\S+)(?:\s+\[(\w+(?:,\w+)*)\])?$} $line _ url flags]} {
+		set flags [split $flags ,]
+		foreach flag $flags {
+		    if {[lsearch -exact [list nosync] $flag] == -1} {
+			ui_warn "$sources_conf source '$line' specifies invalid flag '$flag'"
+		    }
+		}
+		lappend sources [concat [list $url] $flags]
+	    } else {
+		ui_warn "$sources_conf specifies invalid source '$line', ignored."
+	    }
+	}
+    }
+    if {![info exists sources]} {
+	if {[file isdirectory ports]} {
+	    set sources "file://[pwd]/ports"
+	} else {
+	    return -code error "No sources defined in $sources_conf"
+	}
+    }
+
+	if {[info exists variants_conf]} {
+		if {[file exist $variants_conf]} {
+		        set fd [open $variants_conf r]
+			while {[gets $fd line] >= 0} {
+				set line [string trimright $line]
+				if {![regexp {^[\ \t]*#.*$|^$} $line]} {
+					foreach arg [split $line " \t"] {
+						if {[regexp {^([-+])([-A-Za-z0-9_+\.]+)$} $arg match sign opt] == 1} {
+							if {![info exists variations($opt)]} {
+								set variations($opt) $sign
+							}
+						} else {
+							ui_warn "$variants_conf specifies invalid variant syntax '$arg', ignored."
+						}
+					}
+				}
+			}
+		} else {
+			ui_debug "$variants_conf does not exist, variants_conf setting ignored."
+		}
+	}
+
+    if {![info exists portdbpath]} {
+	return -code error "portdbpath must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf"
+    }
+    if {![file isdirectory $portdbpath]} {
+	if {![file exists $portdbpath]} {
+	    if {[catch {file mkdir $portdbpath} result]} {
+		return -code error "portdbpath $portdbpath does not exist and could not be created: $result"
+	    }
+	}
+    }
+    if {![file isdirectory $portdbpath]} {
+	return -code error "$portdbpath is not a directory. Please create the directory $portdbpath and try again"
+    }
+
+    set registry.path $portdbpath
+    if {![file isdirectory ${registry.path}]} {
+	if {![file exists ${registry.path}]} {
+	    if {[catch {file mkdir ${registry.path}} result]} {
+		return -code error "portdbpath ${registry.path} does not exist and could not be created: $result"
+	    }
+	}
+    }
+    if {![file isdirectory ${macports::registry.path}]} {
+	return -code error "${macports::registry.path} is not a directory. Please create the directory $portdbpath and try again"
+    }
+
+	# Format for receipts, can currently be either "flat" or "sqlite"
+	if {[info exists portdbformat]} {
+		if { $portdbformat == "sqlite" } {
+			return -code error "SQLite is not yet supported for registry storage."
+		} 
+		set registry.format receipt_${portdbformat}
+	} else {
+		set registry.format receipt_flat
+	}
+
+	# Installation type, whether to use port "images" or install "direct"
+	if {[info exists portinstalltype]} {
+		set registry.installtype $portinstalltype
+	} else {
+		set registry.installtype image
+	}
+    
+	# Autoclean mode, whether to automatically call clean after "install"
+	if {![info exists portautoclean]} {
+		set macports::portautoclean "yes"
+		global macports::portautoclean
+	}
+	# Check command line override for autoclean
+	if {[info exists options(ports_autoclean)]} {
+		if {![string equal $options(ports_autoclean) $portautoclean]} {
+			set macports::portautoclean $options(ports_autoclean)
+		}
+	}
+	# Trace mode, whether to use darwintrace to debug ports.
+	if {![info exists porttrace]} {
+		set macports::porttrace "no"
+		global macports::porttrace
+	}
+	# Check command line override for trace
+	if {[info exists options(ports_trace)]} {
+		if {![string equal $options(ports_trace) $porttrace]} {
+			set macports::porttrace $options(ports_trace)
+		}
+	}
+
+        # Duplicate prefix into prefix_frozen, so that port actions
+        # can always get to the original prefix, even if a portfile overrides prefix
+        set macports::prefix_frozen $prefix
+
+	# Export verbosity.
+	if {![info exists portverbose]} {
+		set macports::portverbose "no"
+		global macports::portverbose
+	}
+	if {[info exists ui_options(ports_verbose)]} {
+		if {![string equal $ui_options(ports_verbose) $portverbose]} {
+			set macports::portverbose $ui_options(ports_verbose)
+		}
+	}
+
+	# Archive mode, whether to create/use binary archive packages
+	if {![info exists portarchivemode]} {
+		set macports::portarchivemode "yes"
+		global macports::portarchivemode
+	}
+
+	# Archive path, where to store/retrieve binary archive packages
+	if {![info exists portarchivepath]} {
+		set macports::portarchivepath [file join $portdbpath packages]
+		global macports::portarchivepath
+	}
+	if {$portarchivemode == "yes"} {
+		if {![file isdirectory $portarchivepath]} {
+			if {![file exists $portarchivepath]} {
+				if {[catch {file mkdir $portarchivepath} result]} {
+					return -code error "portarchivepath $portarchivepath does not exist and could not be created: $result"
+				}
+			}
+		}
+		if {![file isdirectory $portarchivepath]} {
+			return -code error "$portarchivepath is not a directory. Please create the directory $portarchivepath and try again"
+		}
+	}
+
+	# Archive type, what type of binary archive to use (CPIO, gzipped
+	# CPIO, XAR, etc.)
+	if {![info exists portarchivetype]} {
+		set macports::portarchivetype "cpgz"
+		global macports::portarchivetype
+	}
+	# Convert archive type to a list for multi-archive support, colon or
+	# comma separators indicates to use multiple archive formats
+	# (reading and writing)
+	set macports::portarchivetype [split $portarchivetype {:,}]
+
+	# Set rync options
+	if {![info exists rsync_server]} {
+		set macports::rsync_server rsync.macports.org
+		global macports::rsync_server
+	}
+	if {![info exists rsync_dir]} {
+		set macports::rsync_dir release/base/
+		global macports::rsync_dir
+	}
+	if {![info exists rsync_options]} {
+		set rsync_options "-rtzv --delete-after"
+		global macports::rsync_options
+	}
+
+    set portsharepath ${prefix}/share/macports
+    if {![file isdirectory $portsharepath]} {
+	return -code error "Data files directory '$portsharepath' must exist"
+    }
+    
+    if {![info exists libpath]} {
+	set libpath "${prefix}/share/macports/Tcl"
+    }
+
+    if {![info exists binpath]} {
+	set env(PATH) "${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin"
+    } else {
+	set env(PATH) "$binpath"
+    }
+    
+    # Set startupitem default type (can be overridden by portfile)
+    if {![info exists macports::startupitem_type]} {
+    	set macports::startupitem_type "default"
+    }
+
+    # Default place_worksymlink
+    if {![info exists macports::place_worksymlink]} {
+	set macports::place_worksymlink yes
+    }
+
+    # Default mp remote options
+    if {![info exists macports::mp_remote_url]} {
+	set macports::mp_remote_url "http://db.macports.org"
+    }
+    if {![info exists macports::mp_remote_submit_url]} {
+	set macports::mp_remote_submit_url "${macports::mp_remote_url}/submit"
+    }
+    
+    # ENV cleanup.
+	set keepenvkeys { DISPLAY DYLD_FALLBACK_FRAMEWORK_PATH
+	                  DYLD_FALLBACK_LIBRARY_PATH DYLD_FRAMEWORK_PATH
+	                  DYLD_LIBRARY_PATH DYLD_INSERT_LIBRARIES
+	                  HOME JAVA_HOME LD_PREBIND
+	                  LD_PREBIND_ALLOW_OVERLAP MASTER_SITE_LOCAL
+	                  PATCH_SITE_LOCAL PATH PORTSRC RSYNC_PROXY TMP TMPDIR
+	                  USER GROUP
+	                  http_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY NO_PROXY
+					}
+    if {[info exists extra_env]} {
+    	set keepenvkeys [concat ${keepenvkeys} ${extra_env}]
+    }
+	
+	foreach envkey [array names env] {
+		if {[lsearch $keepenvkeys $envkey] == -1} {
+			array unset env $envkey
+		}
+	}
+
+	if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
+		# We'll resolve these later (if needed)
+		trace add variable macports::xcodeversion read macports::setxcodeinfo
+		trace add variable macports::xcodebuildcmd read macports::setxcodeinfo
+	}
+
+    # Set the default umask
+    if {![info exists destroot_umask]} {
+        set destroot_umask 022
+    }
+
+    if {[info exists master_site_local] && ![info exists env(MASTER_SITE_LOCAL)]} {
+	set env(MASTER_SITE_LOCAL) "$master_site_local"
+    }
+
+	# Prebinding. useful with MacOS X's ld, harmless elsewhere.
+	# With both variables, prebinding will always succeed but we might need
+	# to redo it.
+    if {![info exists env(LD_PREBIND)] && ![info exists env(LD_PREBIND_ALLOW_OVERLAP)]} {
+	set env(LD_PREBIND) "1"
+	set env(LD_PREBIND_ALLOW_OVERLAP) "1"
+    }
+
+    if {[file isdirectory $libpath]} {
+		lappend auto_path $libpath
+		set macports::auto_path $auto_path
+
+		# XXX: not sure if this the best place, but it needs to happen
+		# early, and after auto_path has been set.  Or maybe Pextlib
+		# should ship with macports1.0 API?
+		package require Pextlib 1.0
+		package require registry 1.0
+    } else {
+		return -code error "Library directory '$libpath' must exist"
+    }
+}
+
+proc macports::worker_init {workername portpath portbuildpath options variations} {
+    global macports::portinterp_options macports::portinterp_deferred_options registry.installtype
+
+	# Tell the sub interpreter about all the Tcl packages we already
+	# know about so it won't glob for packages.
+	foreach pkgName [package names] {
+		foreach pkgVers [package versions $pkgName] {
+			set pkgLoadScript [package ifneeded $pkgName $pkgVers]
+			$workername eval "package ifneeded $pkgName $pkgVers {$pkgLoadScript}"
+		}
+	}
+
+    # Create package require abstraction procedure
+    $workername eval "proc PortSystem \{version\} \{ \n\
+			package require port \$version \}"
+
+    # Clearly separate slave interpreters and the master interpreter.
+	$workername alias mport_exec mportexec
+	$workername alias mport_open mportopen
+	$workername alias mport_close mportclose
+	$workername alias mport_search mportsearch
+
+    # instantiate the UI call-backs
+	foreach priority ${macports::ui_priorities} {
+		$workername alias ui_$priority ui_$priority
+	}
+	$workername alias ui_prefix ui_prefix
+	$workername alias ui_channels ui_channels
+    
+    # Export some utility functions defined here.
+    $workername alias macports_create_thread macports::create_thread
+    $workername alias getportworkpath_from_buildpath macports::getportworkpath_from_buildpath
+
+	# New Registry/Receipts stuff
+	$workername alias registry_new registry::new_entry
+	$workername alias registry_open registry::open_entry
+	$workername alias registry_write registry::write_entry
+	$workername alias registry_prop_store registry::property_store
+	$workername alias registry_prop_retr registry::property_retrieve
+	$workername alias registry_delete registry::delete_entry
+	$workername alias registry_exists registry::entry_exists
+	$workername alias registry_activate portimage::activate
+	$workername alias registry_deactivate portimage::deactivate
+	$workername alias registry_register_deps registry::register_dependencies
+	$workername alias registry_fileinfo_for_index registry::fileinfo_for_index
+	$workername alias registry_bulk_register_files registry::register_bulk_files
+	$workername alias registry_installed registry::installed
+	$workername alias registry_active registry::active
+
+	# deferred options processing.
+	$workername alias getoption macports::getoption
+
+    foreach opt $portinterp_options {
+		if {![info exists $opt]} {
+		    global macports::$opt
+		}
+        if {[info exists $opt]} {
+            $workername eval set system_options($opt) \{[set $opt]\}
+            $workername eval set $opt \{[set $opt]\}
+        }
+    }
+    
+	foreach opt $portinterp_deferred_options {
+		global macports::$opt
+		# define the trace hook.
+		$workername eval \
+			"proc trace_$opt {name1 name2 op} { \n\
+				trace remove variable ::$opt read ::trace_$opt \n\
+				global $opt \n\
+				set $opt \[getoption $opt\] \n\
+			}"
+		# next access will actually define the variable.
+		$workername eval "trace add variable ::$opt read ::trace_$opt"
+		# define some value now
+		$workername eval set $opt "?"
+	}		
+
+    foreach {opt val} $options {
+        $workername eval set user_options($opt) $val
+        $workername eval set $opt $val
+    }
+
+    foreach {var val} $variations {
+        $workername eval set variations($var) $val
+    }
+
+    if { [info exists registry.installtype] } {
+	    $workername eval set installtype ${registry.installtype}
+    }
+}
+
+# Create a thread with most configuration options set.
+# The newly created thread is sent portinterp_options vars and knows where to
+# find all packages we know.
+proc macports::create_thread {} {
+    package require Thread
+
+    global macports::portinterp_options
+
+	# Create the thread.
+	set result [thread::create -preserved {thread::wait}]
+
+	# Tell the thread about all the Tcl packages we already
+	# know about so it won't glob for packages.
+	foreach pkgName [package names] {
+		foreach pkgVers [package versions $pkgName] {
+			set pkgLoadScript [package ifneeded $pkgName $pkgVers]
+			thread::send -async $result "package ifneeded $pkgName $pkgVers {$pkgLoadScript}"
+		}
+	}
+
+	# inherit configuration variables.
+	thread::send -async $result "namespace eval macports {}"
+	foreach opt $portinterp_options {
+		if {![info exists $opt]} {
+			global macports::$opt
+		}
+        if {[info exists $opt]} {
+			thread::send -async $result "global macports::$opt"
+			set val [set macports::$opt]
+			thread::send -async $result "set macports::$opt \"$val\""
+		}
+	}
+	
+	return $result
+}
+
+proc macports::fetch_port {url} {
+    global macports::portdbpath tcl_platform
+    set fetchdir [file join $portdbpath portdirs]
+    set fetchfile [file tail $url]
+    file mkdir $fetchdir
+    if {![file writable $fetchdir]} {
+    	return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
+    }
+    if {[catch {exec curl -L -s -S -o [file join $fetchdir $fetchfile] $url} result]} {
+        return -code error "Port remote fetch failed: $result"
+    }
+    cd $fetchdir
+    if {[catch {exec tar -zxf $fetchfile} result]} {
+	return -code error "Port extract failed: $result"
+    }
+    if {[regexp {(.+).tgz} $fetchfile match portdir] != 1} {
+        return -code error "Can't decipher portdir from $fetchfile"
+    }
+    return [file join $fetchdir $portdir]
+}
+
+proc macports::getprotocol {url} {
+    if {[regexp {(?x)([^:]+)://.+} $url match protocol] == 1} {
+        return ${protocol}
+    } else {
+        return -code error "Can't parse url $url"
+    }
+}
+
+# XXX: this really needs to be rethought in light of the remote index
+# I've added the destdir parameter.  This is the location a remotely
+# fetched port will be downloaded to (currently only applies to
+# mports:// sources).
+proc macports::getportdir {url {destdir "."}} {
+	if {[regexp {(?x)([^:]+)://(.+)} $url match protocol string] == 1} {
+		switch -regexp -- ${protocol} {
+			{^file$} {
+			    return [file normalize $string]
+			}
+			{^mports$} {
+				return [macports::index::fetch_port $url $destdir]
+			}
+			{^https?$|^ftp$} {
+				return [macports::fetch_port $url]
+			}
+			default {
+				return -code error "Unsupported protocol $protocol"
+			}
+		}
+	} else {
+		return -code error "Can't parse url $url"
+	}
+}
+
+# mportopen
+# Opens a MacPorts portfile specified by a URL.  The Portfile is
+# opened with the given list of options and variations.  The result
+# of this function should be treated as an opaque handle to a
+# MacPorts Portfile.
+
+proc mportopen {porturl {options ""} {variations ""} {nocache ""}} {
+    global macports::portdbpath macports::portconf macports::open_mports auto_path
+
+	# Look for an already-open MPort with the same URL.
+	# XXX: should compare options and variations here too.
+	# if found, return the existing reference and bump the refcount.
+	if {$nocache != ""} {
+		set mport {}
+	} else {
+		set mport [dlist_search $macports::open_mports porturl $porturl]
+	}
+	if {$mport != {}} {
+		set refcnt [ditem_key $mport refcnt]
+		incr refcnt
+		ditem_key $mport refcnt $refcnt
+		return $mport
+	}
+
+	array set options_array $options
+	if {[info exists options_array(portdir)]} {
+		set portdir $options_array(portdir)
+	} else {
+		set portdir ""
+	}
+
+	set portpath [macports::getportdir $porturl $portdir]
+	ui_debug "Changing to port directory: $portpath"
+	cd $portpath
+    if {![file isfile Portfile]} {
+        return -code error "Could not find Portfile in $portpath"
+    }
+
+	set workername [interp create]
+
+	set mport [ditem_create]
+	lappend macports::open_mports $mport
+	ditem_key $mport porturl $porturl
+	ditem_key $mport portpath $portpath
+	ditem_key $mport workername $workername
+	ditem_key $mport options $options
+	ditem_key $mport variations $variations
+	ditem_key $mport refcnt 1
+	
+    macports::worker_init $workername $portpath [macports::getportbuildpath $portpath] $options $variations
+
+    $workername eval source Portfile
+
+    # evaluate the variants
+    if {[$workername eval eval_variants variations] != 0} {
+	mportclose $mport
+	error "Error evaluating variants"
+    }
+
+    ditem_key $mport provides [$workername eval return \$portname]
+
+    return $mport
+}
+
+# Traverse a directory with ports, calling a function on the path of ports
+# (at the second depth).
+# I.e. the structure of dir shall be:
+# category/port/
+# with a Portfile file in category/port/
+#
+# func:		function to call on every port directory (it is passed
+#			category/port/ as its parameter)
+# root:		the directory with all the categories directories.
+proc mporttraverse {func {root .}} {
+	# Save the current directory
+	set pwd [pwd]
+	
+	# Join the root.
+	set pathToRoot [file join $pwd $root]
+
+	# Go to root because some callers expects us to be there.
+	cd $pathToRoot
+
+    foreach category [lsort -increasing -unique [readdir $root]] {
+    	set pathToCategory [file join $root $category]
+        if {[file isdirectory $pathToCategory]} {
+        	# Iterate on port directories.
+			foreach port [lsort -increasing -unique [readdir $pathToCategory]] {
+				set pathToPort [file join $pathToCategory $port]
+				if {[file isdirectory $pathToPort] &&
+					[file exists [file join $pathToPort "Portfile"]]} {
+					# Call the function.
+					$func [file join $category $port]
+					
+					# Restore the current directory because some
+					# functions changes it.
+					cd $pathToRoot
+				}
+			}
+        }
+	}
+	
+	# Restore the current directory.
+	cd $pwd
+}
+
+### _mportsearchpath is private; subject to change without notice
+
+# depregex -> regex on the filename to find.
+# search_path -> directories to search
+# executable -> whether we want to check that the file is executable by current
+#				user or not.
+proc _mportsearchpath {depregex search_path {executable 0}} {
+    set found 0
+    foreach path $search_path {
+	if {![file isdirectory $path]} {
+	    continue
+	}
+
+	if {[catch {set filelist [readdir $path]} result]} {
+		return -code error "$result ($path)"
+		set filelist ""
+	}
+
+	foreach filename $filelist {
+	    if {[regexp $depregex $filename] &&
+	    	(($executable == 0) || [file executable [file join $path $filename]])} {
+		ui_debug "Found Dependency: path: $path filename: $filename regex: $depregex"
+		set found 1
+		break
+	    }
+	}
+    }
+    return $found
+}
+
+### _libtest is private; subject to change without notice
+# XXX - Architecture specific
+# XXX - Rely on information from internal defines in cctools/dyld:
+# define DEFAULT_FALLBACK_FRAMEWORK_PATH
+# /Library/Frameworks:/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
+# define DEFAULT_FALLBACK_LIBRARY_PATH /lib:/usr/local/lib:/lib:/usr/lib
+#   -- Since /usr/local is bad, using /lib:/usr/lib only.
+# Environment variables DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH,
+# DYLD_FALLBACK_FRAMEWORK_PATH, and DYLD_FALLBACK_LIBRARY_PATH take precedence
+
+proc _libtest {mport depspec} {
+    global env tcl_platform
+	set depline [lindex [split $depspec :] 1]
+	set prefix [_mportkey $mport prefix]
+	
+	if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
+	    lappend search_path $env(DYLD_FRAMEWORK_PATH)
+	} else {
+	    lappend search_path /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks
+	}
+	if {[info exists env(DYLD_FALLBACK_FRAMEWORK_PATH)]} {
+	    lappend search_path $env(DYLD_FALLBACK_FRAMEWORK_PATH)
+	}
+	if {[info exists env(DYLD_LIBRARY_PATH)]} {
+	    lappend search_path $env(DYLD_LIBRARY_PATH)
+	}
+	lappend search_path /lib /usr/lib /usr/X11R6/lib ${prefix}/lib
+	if {[info exists env(DYLD_FALLBACK_LIBRARY_PATH)]} {
+	    lappend search_path $env(DYLD_FALLBACK_LIBRARY_PATH)
+	}
+
+	set i [string first . $depline]
+	if {$i < 0} {set i [string length $depline]}
+	set depname [string range $depline 0 [expr $i - 1]]
+	set depversion [string range $depline $i end]
+	regsub {\.} $depversion {\.} depversion
+	if {$tcl_platform(os) == "Darwin"} {
+		set depregex \^${depname}${depversion}\\.dylib\$
+	} else {
+		set depregex \^${depname}\\.so${depversion}\$
+	}
+
+	return [_mportsearchpath $depregex $search_path]
+}
+
+### _bintest is private; subject to change without notice
+
+proc _bintest {mport depspec} {
+    global env
+	set depregex [lindex [split $depspec :] 1]
+	set prefix [_mportkey $mport prefix] 
+	
+	set search_path [split $env(PATH) :]
+	
+	set depregex \^$depregex\$
+	
+	return [_mportsearchpath $depregex $search_path 1]
+}
+
+### _pathtest is private; subject to change without notice
+
+proc _pathtest {mport depspec} {
+    global env
+	set depregex [lindex [split $depspec :] 1]
+	set prefix [_mportkey $mport prefix] 
+    
+	# separate directory from regex
+	set fullname $depregex
+
+	regexp {^(.*)/(.*?)$} "$fullname" match search_path depregex
+
+	if {[string index $search_path 0] != "/"} {
+		# Prepend prefix if not an absolute path
+		set search_path "${prefix}/${search_path}"
+	}
+
+	set depregex \^$depregex\$
+
+	return [_mportsearchpath $depregex $search_path]
+}
+
+### _porttest is private; subject to change without notice
+
+proc _porttest {mport depspec} {
+	# We don't actually look for the port, but just return false
+	# in order to let the mportdepends handle the dependency
+	return 0
+}
+
+### _mportinstalled is private; may change without notice
+
+# Determine if a port is already *installed*, as in "in the registry".
+proc _mportinstalled {mport} {
+	# Check for the presense of the port in the registry
+	set workername [ditem_key $mport workername]
+	set res [$workername eval registry_exists \${portname} \${portversion}]
+	if {$res != 0} {
+		ui_debug "[ditem_key $mport provides] is installed"
+		return 1
+	} else {
+		return 0
+	}
+}
+
+### _mportispresent is private; may change without notice
+
+# Determine if some depspec is satisfied or if the given port is installed.
+# We actually start with the registry (faster?)
+#
+# mport		the port to test (to figure out if it's present)
+# depspec	the dependency test specification (path, bin, lib, etc.)
+proc _mportispresent {mport depspec} {
+	# Check for the presense of the port in the registry
+	set workername [ditem_key $mport workername]
+	ui_debug "Searching for dependency: [ditem_key $mport provides]"
+	if {[catch {set reslist [$workername eval registry_installed \${portname}]} res]} {
+		set res 0
+	} else {
+		set res [llength $reslist]
+	}
+	if {$res != 0} {
+		ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
+		return 1
+	} else {
+		# The receipt test failed, use one of the depspec regex mechanisms
+		ui_debug "Didn't find receipt, going to depspec regex for: [ditem_key $mport provides]"
+		set type [lindex [split $depspec :] 0]
+		switch $type {
+			lib { return [_libtest $mport $depspec] }
+			bin { return [_bintest $mport $depspec] }
+			path { return [_pathtest $mport $depspec] }
+			port { return [_porttest $mport $depspec] }
+			default {return -code error "unknown depspec type: $type"}
+		}
+		return 0
+	}
+}
+
+### _mportexec is private; may change without notice
+
+proc _mportexec {target mport} {
+	# xxx: set the work path?
+	set workername [ditem_key $mport workername]
+	if {![catch {$workername eval check_variants variations $target} result] && $result == 0 &&
+		![catch {$workername eval eval_targets $target} result] && $result == 0} {
+		# If auto-clean mode, clean-up after dependency install
+		if {[string equal ${macports::portautoclean} "yes"]} {
+			# Make sure we are back in the port path before clean
+			# otherwise if the current directory had been changed to
+			# inside the port,  the next port may fail when trying to
+			# install because [pwd] will return a "no file or directory"
+			# error since the directory it was in is now gone.
+			set portpath [ditem_key $mport portpath]
+			catch {cd $portpath}
+			$workername eval eval_targets clean
+		}
+		return 0
+	} else {
+		# An error occurred.
+		return 1
+	}
+}
+
+# mportexec
+# Execute the specified target of the given mport.
+
+proc mportexec {mport target} {
+    global macports::registry.installtype
+
+	set workername [ditem_key $mport workername]
+
+	# check variants
+	if {[$workername eval check_variants variations $target] != 0} {
+		return 1
+	}
+	
+	# Before we build the port, we must build its dependencies.
+	# XXX: need a more general way of comparing against targets
+	set dlist {}
+	if {$target == "package"} {
+		ui_warn "package target replaced by pkg target, please use the pkg target in the future."
+		set target "pkg"
+	}
+	if {$target == "configure" || $target == "build"
+		|| $target == "test"
+		|| $target == "destroot" || $target == "install"
+		|| $target == "archive"
+		|| $target == "pkg" || $target == "mpkg"
+		|| $target == "rpmpackage" || $target == "dpkg" } {
+
+		if {[mportdepends $mport $target] != 0} {
+			return 1
+		}
+		
+		# Select out the dependents along the critical path,
+		# but exclude this mport, we might not be installing it.
+		set dlist [dlist_append_dependents $macports::open_mports $mport {}]
+		
+		dlist_delete dlist $mport
+
+		# install them
+		# xxx: as with below, this is ugly.  and deps need to be fixed to
+		# understand Port Images before this can get prettier
+		if { [string equal ${macports::registry.installtype} "image"] } {
+			set result [dlist_eval $dlist _mportinstalled [list _mportexec "activate"]]
+		} else {
+			set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
+		}
+		
+		if {$result != {}} {
+			set errstring "The following dependencies failed to build:"
+			foreach ditem $result {
+				append errstring " [ditem_key $ditem provides]"
+			}
+			ui_error $errstring
+			return 1
+		}
+		
+		# Close the dependencies, we're done installing them.
+		foreach ditem $dlist {
+			mportclose $ditem
+		}
+	}
+
+	# If we're doing an install, check if we should clean after
+	set clean 0
+	if {[string equal ${macports::portautoclean} "yes"] && [string equal $target "install"] } {
+		set clean 1
+	}
+
+	# If we're doing image installs, then we should activate after install
+	# xxx: This isn't pretty
+	if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
+		set target activate
+	}
+	
+	# Build this port with the specified target
+	set result [$workername eval eval_targets $target]
+
+	# If auto-clean mode and successful install, clean-up after install
+	if {$result == 0 && $clean == 1} {
+		# Make sure we are back in the port path, just in case
+		set portpath [ditem_key $mport portpath]
+		catch {cd $portpath}
+		$workername eval eval_targets clean
+	}
+
+	return $result
+}
+
+proc macports::getsourcepath {url} {
+    global macports::portdbpath
+    set source_path [split $url ://]
+    return [file join $portdbpath sources [lindex $source_path 3] [lindex $source_path 4] [lindex $source_path 5]]
+}
+
+proc macports::getportbuildpath {id} {
+	global macports::portdbpath
+	regsub {://} $id {.} port_path
+	regsub -all {/} $port_path {_} port_path
+	return [file join $portdbpath build $port_path]
+}
+
+proc macports::getportworkpath_from_buildpath {portbuildpath} {
+    return [file join $portbuildpath work]
+}
+
+proc macports::getportworkpath_from_portdir {portpath} {
+    return [macports::getportworkpath_from_buildpath [macports::getportbuildpath $portpath]]
+}
+
+proc macports::getindex {source} {
+	# Special case file:// sources
+	if {[macports::getprotocol $source] == "file"} {
+		return [file join [macports::getportdir $source] PortIndex]
+	}
+
+	return [file join [macports::getsourcepath $source] PortIndex]
+}
+
+proc mportsync {} {
+    global macports::sources macports::portdbpath macports::rsync_options tcl_platform
+    global macports::autoconf::rsync_path 
+    
+    ui_debug "Synchronizing ports tree(s)"
+    foreach source $sources {
+	set flags [lrange $source 1 end]
+	set source [lindex $source 0]
+	if {[lsearch -exact $flags nosync] != -1} {
+	    ui_debug "Skipping $source"
+	    continue
+	}
+	ui_info "Synchronizing from $source"
+	switch -regexp -- [macports::getprotocol $source] {
+	    {^file$} {
+		set portdir [macports::getportdir $source]
+		if {[file exists $portdir/.svn]} {
+		    set svn_commandline "[macports::findBinary svn ${macports::autoconf::svn_path}] update --non-interactive ${portdir}"
+		    ui_debug $svn_commandline
+		    if {[catch {
+			set euid [geteuid]
+			set egid [getegid]
+			ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+			setegid [name_to_gid [file attributes $portdir -group]]
+			seteuid [name_to_uid [file attributes $portdir -owner]]
+			system $svn_commandline
+			seteuid $euid
+			setegid $egid
+		    }]} {
+			ui_debug "$::errorInfo"
+			return -code error "sync failed doing svn update"
+		    }
+		}
+	    }
+	    {^mports$} {
+		macports::index::sync $macports::portdbpath $source
+	    }
+	    {^rsync$} {
+		# Where to, boss?
+		set destdir [file dirname [macports::getindex $source]]
+
+		file mkdir $destdir
+		
+		# Keep rsync happy with a trailing slash
+		if {[string index $source end] != "/"} {
+		    set source "${source}/"
+		}
+
+		# Do rsync fetch
+		set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${source} ${destdir}"
+		ui_debug $rsync_commandline
+		if {[catch {system $rsync_commandline}]} {
+		    return -code error "sync failed doing rsync"
+		}
+		if {[catch {system "chmod -R a+r \"$destdir\""}]} {
+		    ui_warn "Setting world read permissions on parts of the ports tree failed, need root?"
+		}
+	    }
+	    {^https?$|^ftp$} {
+		set indexfile [macports::getindex $source]
+		file mkdir [file dirname $indexfile]
+		exec curl -L -s -S -o $indexfile $source/PortIndex
+	    }
+	    default {
+		ui_warn "Unknown protocol for $source"
+	    }
+	}
+    }
+}
+
+proc mportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
+	global macports::portdbpath macports::sources
+	set matches [list]
+	set easy [expr { $field == "name" }]
+	
+	set found 0
+	foreach source $sources {
+	        set flags [lrange $source 1 end]
+	        set source [lindex $source 0]
+		if {[macports::getprotocol $source] == "mports"} {
+			array set attrs [list name $pattern]
+			set res [macports::index::search $macports::portdbpath $source [array get attrs]]
+			eval lappend matches $res
+		} else {
+			if {[catch {set fd [open [macports::getindex $source] r]} result]} {
+				ui_warn "Can't open index file for source: $source"
+			} else {
+			    try {
+				incr found 1
+				while {[gets $fd line] >= 0} {
+					array unset portinfo
+					set name [lindex $line 0]
+				        set len [lindex $line 1]
+				        set line [read $fd $len]
+
+						if {$easy} {
+						    set target $name
+						} else {
+							array set portinfo $line
+						    if {![info exists portinfo($field)]} continue
+						    set target $portinfo($field)
+						}
+
+				    switch $matchstyle {
+					exact { set matchres [expr 0 == ( {$case_sensitive == "yes"} ? [string compare $pattern $target] : [string compare -nocase $pattern $target] )] }
+					glob { set matchres [expr {$case_sensitive == "yes"} ? [string match $pattern $target] : [string match -nocase $pattern $target]] }
+					regexp -
+					default { set matchres [expr {$case_sensitive == "yes"} ? [regexp -- $pattern $target] : [regexp -nocase -- $pattern $target]] }
+				    }
+
+				    if {$matchres == 1} {
+					if {$easy} {
+					    array set portinfo $line
+					}
+					switch -regexp -- [macports::getprotocol ${source}] {
+					    {^rsync$} {
+						# Rsync files are local
+						set source_url "file://[macports::getsourcepath $source]"
+					    }
+					    default {
+						set source_url $source
+					    }
+					}
+					if {[info exists portinfo(portarchive)]} {
+					    set porturl ${source_url}/$portinfo(portarchive)
+					} elseif {[info exists portinfo(portdir)]} {
+					    set porturl ${source_url}/$portinfo(portdir)
+					}
+					if {[info exists porturl]} {
+					    lappend line porturl $porturl
+					    ui_debug "Found port in $porturl"
+					} else {
+					    ui_debug "Found port info: $line"
+					}
+					lappend matches $name
+					lappend matches $line
+				    }
+				}
+			    } catch {*} {
+				ui_warn "It looks like your PortIndex file may be corrupt."
+				throw
+			    } finally {
+				close $fd
+			    }
+			}
+		}
+	}
+	if {!$found} {
+		return -code error "No index(es) found! Have you synced your source indexes?"
+	}
+
+	return $matches
+}
+
+proc mportinfo {mport} {
+	set workername [ditem_key $mport workername]
+    return [$workername eval array get PortInfo]
+}
+
+proc mportclose {mport} {
+	global macports::open_mports
+	set refcnt [ditem_key $mport refcnt]
+	incr refcnt -1
+	ditem_key $mport refcnt $refcnt
+	if {$refcnt == 0} {
+		dlist_delete macports::open_mports $mport
+		set workername [ditem_key $mport workername]
+		interp delete $workername
+	}
+}
+
+##### Private Depspec API #####
+# This API should be considered work in progress and subject to change without notice.
+##### "
+
+# _mportkey
+# - returns a variable from the port's interpreter
+
+proc _mportkey {mport key} {
+	set workername [ditem_key $mport workername]
+	return [$workername eval "return \$${key}"]
+}
+
+# mportdepends builds the list of mports which the given port depends on.
+# This list is added to $mport.
+# This list actually depends on the target.
+# This method can optionally recurse through the dependencies, looking for
+#   dependencies of dependencies.
+# This method can optionally cut the search when ports are already installed or
+#   the dependencies are satisfied.
+#
+# mport -> mport item
+# target -> target to consider the dependency for
+# recurseDeps -> if the search should be recursive
+# skipSatisfied -> cut the search tree when encountering installed/satisfied
+#                  dependencies ports.
+# accDeps -> accumulator for recursive calls
+# return 0 if everything was ok, an non zero integer otherwise.
+proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDeps {}}} {
+
+	array set portinfo [mportinfo $mport]
+	set depends {}
+	set deptypes {}
+		
+	# Determine deptypes to look for based on target
+	switch $target {
+		configure	{ set deptypes "depends_lib" }
+		
+		build		{ set deptypes "depends_lib depends_build" }
+		
+		test		-
+		destroot	-
+		install		-
+		archive		-
+		pkg			-
+		mpkg		-
+		rpmpackage	-
+		dpkg		-
+		""			{ set deptypes "depends_lib depends_build depends_run" }
+	}
+	
+	# Gather the dependencies for deptypes
+	foreach deptype $deptypes {
+		# Add to the list of dependencies if the option exists and isn't empty.
+		if {[info exists portinfo($deptype)] && $portinfo($deptype) != ""} {
+			set depends [concat $depends $portinfo($deptype)]
+		}
+	}
+
+	set subPorts {}
+	
+	foreach depspec $depends {
+		# grab the portname portion of the depspec
+		set dep_portname [lindex [split $depspec :] end]
+		
+		# Find the porturl
+		if {[catch {set res [mportsearch $dep_portname false exact]} error]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Internal error: port search failed: $error"
+			return 1
+		}
+		foreach {name array} $res {
+			array set portinfo $array
+			if {[info exists portinfo(porturl)]} {
+				set porturl $portinfo(porturl)
+				break
+			}
+		}
+
+		if {![info exists porturl]} {
+			ui_error "Dependency '$dep_portname' not found."
+			return 1
+		}
+
+		set options [ditem_key $mport options]
+		set variations [ditem_key $mport variations]
+
+		# Figure out the subport.	
+		set subport [mportopen $porturl $options $variations]
+
+		# Is that dependency satisfied or this port installed?
+		# If we don't skip or if it is not, add it to the list.
+		if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
+			# Append the sub-port's provides to the port's requirements list.
+			ditem_append_unique $mport requires "[ditem_key $subport provides]"
+	
+			if {$recurseDeps} {
+				# Skip the port if it's already in the accumulated list.
+				if {[lsearch $accDeps $dep_portname] == -1} {
+					# Add it to the list
+					lappend accDeps $dep_portname
+				
+					# We'll recursively iterate on it.
+					lappend subPorts $subport
+				}
+			}
+		}
+	}
+
+	# Loop on the subports.
+	if {$recurseDeps} {
+		foreach subport $subPorts {
+			# Sub ports should be installed (all dependencies must be satisfied).
+			set res [mportdepends $subport "" $recurseDeps $skipSatisfied $accDeps]
+			if {$res != 0} {
+				return $res
+			}
+		}
+	}
+	
+	return 0
+}
+
+# selfupdate procedure
+proc macports::selfupdate {optionslist} {
+	global macports::prefix macports::portdbpath macports::rsync_server macports::rsync_dir macports::rsync_options
+	global macports::autoconf::macports_conf_path macports::autoconf::rsync_path
+	array set options $optionslist
+	
+	if { [info exists options(ports_force)] && $options(ports_force) == "yes" } {
+		set use_the_force_luke yes
+		ui_debug "Forcing a rebuild of the MacPorts base system."
+	} else {
+		set use_the_force_luke no
+		ui_debug "Rebuilding the MacPorts base system if needed."
+	}
+	# syncing ports tree. We expect the user have rsync:// in the sources.conf
+	if {[catch {mportsync} result]} {
+		return -code error "Couldn't sync the ports tree: $result"
+	}
+
+	set mp_base_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}/]
+	if {![file exists $mp_base_path]} {
+		file mkdir $mp_base_path
+	}
+	ui_debug "MacPorts base dir: $mp_base_path"
+
+	# get user of the MacPorts system
+	set user [file attributes [file join $portdbpath sources/] -owner]
+	ui_debug "Setting user: $user"
+
+	# get MacPorts version 
+    set mp_version_path [file join ${macports_conf_path} mp_version]
+	if { [file exists $mp_version_path]} {
+		set fd [open $mp_version_path r]
+		gets $fd mp_version_old
+		close $fd
+	} else {
+		set mp_version_old 0
+	}
+	ui_msg "MacPorts base version $mp_version_old installed"
+
+	ui_debug "Updating using rsync"
+	if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir} $mp_base_path" } ] } {
+		return -code error "Error: rsync failed in selfupdate"
+	}
+
+	# get downloaded macports version and write the old version back
+	set fd [open [file join $mp_base_path config mp_version] r]
+	gets $fd mp_version_new
+	close $fd
+	ui_msg "Downloaded MacPorts base version $mp_version_new"
+
+	# check if we we need to rebuild base
+	if {$mp_version_new > $mp_version_old || $use_the_force_luke == "yes"} {
+		ui_msg "Configuring, Building and Installing new MacPorts base"
+		# check if $prefix/bin/port is writable, if so we go !
+		# get installation user / group 
+		set owner root
+		set group admin
+	        set portprog [file join $prefix bin port]
+		if {[file exists $portprog ]} {
+			# set owner
+			set owner [file attributes $portprog -owner]
+			# set group
+			set group [file attributes $portprog -group]
+		}
+		set p_user [exec /usr/bin/whoami]
+		if {[file writable $portprog] || [string equal $p_user $owner] } {
+			ui_debug "permissions OK"
+		} else {
+			return -code error "Error: $p_user cannot write to ${prefix}/bin - try using sudo"
+		}
+		ui_debug "Setting owner: $owner group: $group"
+
+		set mp_tclpackage_path [file join $portdbpath .tclpackage]
+		if { [file exists $mp_tclpackage_path]} {
+			set fd [open $mp_tclpackage_path r]
+			gets $fd tclpackage
+			close $fd
+		} else {
+			set tclpackage [file join ${prefix} share macports Tcl]
+		}
+		# do the actual installation of new base
+		ui_debug "Install in: $prefix as $owner : $group - TCL-PACKAGE in $tclpackage"
+		if { [catch { system "cd $mp_base_path && ./configure --prefix=$prefix --with-install-user=$owner --with-install-group=$group --with-tclpackage=$tclpackage && make && make install" } result] } {
+			return -code error "Error installing new MacPorts base: $result"
+		}
+	} else {
+		ui_msg "The MacPorts installation is not outdated and so was not updated"
+	}
+
+	# set the macports system to the right owner 
+	ui_debug "Setting ownership to $user"
+	if { [catch { exec chown -R $user [file join $portdbpath sources/] } result] } {
+		return -code error "Couldn't change permissions: $result"
+	}
+
+	# set the right version
+	ui_msg "selfupdate done!"
+
+	return 0
+}
+
+proc macports::version {} {
+	global macports::rsync_server macports::rsync_dir
+        global macports::autoconf::macports_conf_path
+	
+    set mp_version_path [file join ${macports_conf_path} mp_version]
+
+	if [file exists $mp_version_path] {
+		set fd [open $mp_version_path r]
+		gets $fd retval
+	        close $fd
+		return $retval
+	} else {
+		return -1
+	}
+}
+
+# upgrade procedure
+proc macports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
+	global macports::registry.installtype
+	global macports::portarchivemode
+	array set options $optionslist
+	array set variations $variationslist
+	if {![string match "" $depscachename]} {
+		upvar $depscachename depscache
+	} 
+
+	# set to no-zero is epoch overrides version
+	set epoch_override 0
+
+	# check if the port is in tree
+	if {[catch {mportsearch $portname false exact} result]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "port search failed: $result"
+		return 1
+	}
+	# argh! port doesnt exist!
+	if {$result == ""} {
+		ui_error "No port $portname found."
+		return 1
+	}
+	# fill array with information
+	array set portinfo [lindex $result 1]
+
+	# set version_in_tree
+	if {![info exists portinfo(version)]} {
+		ui_error "Invalid port entry for $portname, missing version"
+		return 1
+	}
+	set version_in_tree "$portinfo(version)_$portinfo(revision)"
+	set epoch_in_tree "$portinfo(epoch)"
+
+	# the depflag tells us if we should follow deps (this is for stuff installed outside MacPorts)
+	# if this is set (not 0) we dont follow the deps
+	set depflag 0
+
+	# set version_installed
+	set ilist {}
+	if { [catch {set ilist [registry::installed $portname ""]} result] } {
+		if {$result == "Registry error: $portname not registered as installed." } {
+			ui_debug "$portname is *not* installed by MacPorts"
+			# open porthandle    
+			set porturl $portinfo(porturl)
+		    if {![info exists porturl]} {
+		        set porturl file://./    
+			}    
+			if {[catch {set workername [mportopen $porturl [array get options] ]} result]} {
+					global errorInfo
+					ui_debug "$errorInfo"
+			        ui_error "Unable to open port: $result"        
+					return 1
+		    }
+
+			if {![_mportispresent $workername $dspec ] } {
+				# port in not installed - install it!
+				if {[catch {set result [mportexec $workername install]} result]} {
+					global errorInfo
+					ui_debug "$errorInfo"
+					ui_error "Unable to exec port: $result"
+					return 1
+				}
+			} else {
+				# port installed outside MacPorts
+				ui_debug "$portname installed outside the MacPorts system"
+				set depflag 1
+			}
+
+		} else {
+			ui_error "Checking installed version failed: $result"
+			exit 1
+		}
+	}
+	set anyactive 0
+	set version_installed 0
+	set epoch_installed 0
+	if {$ilist == ""} {
+		# XXX  this sets $version_installed to $version_in_tree even if not installed!!
+		set version_installed $version_in_tree
+		# That was a very dirty hack showing how ugly our depencendy and upgrade code is.
+		# To get it working when user provides -f, we also need to set the variant to
+		# avoid a future failure.
+		set variant ""
+	} else {
+		# a port could be installed but not activated
+		# so, deactivate all and save newest for activation later
+		set num 0
+		set variant ""
+		foreach i $ilist {
+			set variant [lindex $i 3]
+			set version "[lindex $i 1]_[lindex $i 2]"
+			if { [rpm-vercomp $version $version_installed] > 0} {
+				set version_installed $version
+				set epoch_installed [registry::property_retrieve [registry::open_entry $portname [lindex $i 1] [lindex $i 2] $variant] epoch]
+				set num $i
+			}
+
+			set isactive [lindex $i 4]
+			if {$isactive == 1 && [rpm-vercomp $version_installed $version] < 0 } {
+				# deactivate version
+    			if {[catch {portimage::deactivate $portname $version $optionslist} result]} {
+					global errorInfo
+					ui_debug "$errorInfo"
+    	    		ui_error "Deactivating $portname $version_installed failed: $result"
+    	    		return 1
+    			}
+			}
+		}
+        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
+			# activate the latest installed version
+			if {[catch {portimage::activate $portname $version_installed$variant $optionslist} result]} {
+				global errorInfo
+				ui_debug "$errorInfo"
+    			ui_error "Activating $portname $version_installed failed: $result"
+				return 1
+			}
+		}
+	}
+
+	# output version numbers
+	ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed"
+	ui_debug "$portname $version_in_tree exists in the ports tree"
+	ui_debug "$portname $version_installed is installed"
+
+	# set the nodeps option  
+	if {![info exists options(ports_nodeps)]} {
+		set nodeps no
+	} else {	
+		set nodeps yes
+	}
+
+	if {$nodeps == "yes" || $depflag == 1} {
+		ui_debug "Not following dependencies"
+		set depflag 0
+	} else {
+		# build depends is upgraded
+		if {[info exists portinfo(depends_build)]} {
+			foreach i $portinfo(depends_build) {
+				if {![llength [array get depscache $i]]} {
+				set d [lindex [split $i :] end]
+					set depscache($i) 1
+					upgrade $d $i $variationslist $optionslist depscache
+				} 
+			}
+		}
+		# library depends is upgraded
+		if {[info exists portinfo(depends_lib)]} {
+			foreach i $portinfo(depends_lib) {
+				if {![llength [array get depscache $i]]} {
+				set d [lindex [split $i :] end]
+					set depscache($i) 1
+					upgrade $d $i $variationslist $optionslist depscache
+				} 
+			}
+		}
+		# runtime depends is upgraded
+		if {[info exists portinfo(depends_run)]} {
+			foreach i $portinfo(depends_run) {
+				if {![llength [array get depscache $i]]} {
+				set d [lindex [split $i :] end]
+					set depscache($i) 1
+					upgrade $d $i $variationslist $optionslist depscache
+				} 
+			}
+		}
+	}
+
+	# check installed version against version in ports
+	if { [rpm-vercomp $version_installed $version_in_tree] >= 0 && ![info exists options(ports_force)] } {
+		ui_debug "No need to upgrade! $portname $version_installed >= $portname $version_in_tree"
+		if { $epoch_installed >= $epoch_in_tree } {
+			# Check if we have to do dependents
+			if {[info exists options(ports_do_dependents)]} {
+				# We do dependents ..
+				set options(ports_nodeps) 1
+
+				registry::open_dep_map
+	   			set deplist [registry::list_dependents $portname]
+
+				if { [llength deplist] > 0 } {
+					foreach dep $deplist {
+						set mpname [lindex $dep 2] 
+						macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
+					}
+				}
+			}
+
+			return 0
+		} else {
+			ui_debug "epoch override ... upgrading!"
+			set epoch_override 1
+		}
+	}
+
+	# open porthandle
+	set porturl $portinfo(porturl)
+	if {![info exists porturl]} {
+		set porturl file://./
+	}
+
+	# check if the variants is present in $version_in_tree
+	set oldvariant $variant
+	set variant [split $variant +]
+	ui_debug "variants to install $variant"
+	if {[info exists portinfo(variants)]} {
+		set avariants $portinfo(variants)
+	} else {
+		set avariants {}
+	}
+	ui_debug "available variants are : $avariants"
+	foreach v $variant {
+		if {[lsearch $avariants $v] == -1} {
+		} else {
+			ui_debug "variant $v is present in $portname $version_in_tree"
+			set variations($v) "+"
+		}
+	}
+	ui_debug "new portvariants: [array get variations]"
+	
+	if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "Unable to open port: $result"
+		return 1
+	}
+
+	# install version_in_tree
+	if {0 == [string compare "yes" ${macports::portarchivemode}]} {
+		set upgrade_action "archive"
+	} else {
+		set upgrade_action "destroot"
+	}
+
+	if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "Unable to upgrade port: $result"
+		return 1
+	}
+
+	# uninstall old ports
+    if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${macports::registry.installtype}] } {
+		# uninstall old
+		ui_debug "Uninstalling $portname $version_installed$oldvariant"
+		if {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+     		ui_error "Uninstall $portname $version_installed$oldvariant failed: $result"
+       		return 1
+    	}
+	} else {
+		# XXX deactivate version_installed
+		if {[catch {portimage::deactivate $portname $version_installed$oldvariant $optionslist} result]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Deactivating $portname $version_installed failed: $result"
+			return 1
+		}
+	}
+
+	if {[catch {set result [mportexec $workername install]} result]} {
+		global errorInfo
+		ui_debug "$errorInfo"
+		ui_error "Couldn't activate $portname $version_in_tree$oldvariant: $result"
+		return 1
+	}
+
+	# Check if we have to do dependents
+	if {[info exists options(ports_do_dependents)]} {
+		# We do dependents ..
+		set options(ports_nodeps) 1
+
+		registry::open_dep_map
+	   	set deplist [registry::list_dependents $portname]
+
+		if { [llength deplist] > 0 } {
+			foreach dep $deplist {
+				set mpname [lindex $dep 2] 
+				macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
+			}
+		}
+	}
+
+	
+	# close the port handle
+	mportclose $workername
+}

Deleted: trunk/base/src/macports1.0/macports_autoconf.tcl.in
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports_autoconf.tcl.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,39 +0,0 @@
-# macports-autoconf.tcl.in
-# $Id$
-#
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-package provide macports 1.0
-
-namespace eval macports::autoconf {
-	variable macports_conf_path "@MPCONFIGDIR_EXPANDED@"
-        variable macports_user_dir "~/.macports"
-        variable svn_path "@SVN@"
-	variable rsync_path "@RSYNC@"
-        variable open_path "@OPEN@"
-}

Copied: trunk/base/src/macports1.0/macports_autoconf.tcl.in (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in)
===================================================================
--- trunk/base/src/macports1.0/macports_autoconf.tcl.in	                        (rev 0)
+++ trunk/base/src/macports1.0/macports_autoconf.tcl.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,39 @@
+# macports-autoconf.tcl.in
+# $Id$
+#
+# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+package provide macports 1.0
+
+namespace eval macports::autoconf {
+	variable macports_conf_path "@MPCONFIGDIR_EXPANDED@"
+        variable macports_user_dir "~/.macports"
+        variable svn_path "@SVN@"
+	variable rsync_path "@RSYNC@"
+        variable open_path "@OPEN@"
+}

Deleted: trunk/base/src/macports1.0/macports_dlist.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports_dlist.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,393 +0,0 @@
-# macports1.0/macports_dlist.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package provide macports_dlist 1.0
-
-# dependency dependency list evaluation package
-#
-# This package provides a generic mechanism for managing a list of
-# dependencies.  The basic model is that each dependency item
-# contains a list of tokens it Requires and tokens it Provides.
-# A dependency is selected once all of the tokens it Requires have
-# been provided by another dependency, or if a dependency has no
-# requirements.
-
-# Conceptually a dlist is an ordered list of ditem elements.
-# The order perserves the dependency hierarchy.
-
-# A dlist is an ordinary TCL list.
-# A ditem should be created with the [ditem_create] procedure,
-# and treated as an opaque reference.
-# A statusdict is an ordinary TCL array, though macports_dlist
-# should be given complete domain over its contents.
-# XXX: should statusdict and dlist be part of a ditem tuple?
-# Values in the status dict will be {-1, 0, 1} for {failure,
-# pending, success} respectively.
-
-# dlist_search
-# Returns all dependency entries whose 'key' contains 'value'.
-#	dlist - the dependency list to search
-#	key   - the key to compare: Requires, Provides, et al.
-#	value - the value to compare
-
-proc dlist_search {dlist key value} {
-	set result {}
-	foreach ditem $dlist {
-		if {[ditem_contains $ditem $key $value]} {
-			lappend result $ditem
-		}
-	}
-	return $result
-}
-
-# dlist_delete
-# Deletes the specified ditem from the dlist.
-#	dlist - the list to search
-#	ditem - the item to delete
-proc dlist_delete {dlist ditem} {
-    upvar $dlist uplist
-    set ix [lsearch -exact $uplist $ditem]
-    if {$ix >= 0} {
-		set uplist [lreplace $uplist $ix $ix]
-    }
-}
-
-# dlist_has_pending
-# Returns true if the dlist contains ditems
-# which will provide one of the specified names,
-# and thus are still "pending".
-#	dlist  - the dependency list to search
-#	tokens - the list of pending tokens to check for
-
-proc dlist_has_pending {dlist tokens} {
-	foreach token $tokens {
-		if {[llength [dlist_search $dlist provides $token]] > 0} {
-			return 1
-		}
-	}
-	return 0
-}
-
-# dlist_count_unmet
-# Returns the total number of unmet dependencies in
-# the list of tokens.  If the tokens are in the status
-# dictionary with a successful result code, they are 
-# considered met.
-proc dlist_count_unmet {dlist statusdict tokens} {
-	upvar $statusdict upstatus
-	set result 0
-	foreach token $tokens {
-		if {[info exists upstatus($token)] &&
-			$upstatus($token) == 1} {
-			continue
-		} else {
-			incr result
-		}
-	}
-	return $result
-}
-
-# ditem_create
-# Create a new array in the macports_dlist namespace
-# returns the name of the array.  This should be used as
-# the ditem handle.
-
-proc ditem_create {} {
-	return [macports_dlist::ditem_create]
-}
-
-# ditem_key
-# Sets and returns the given key of the dependency item.
-#	ditem - the dependency item to operate on
-#	key   - the key to set
-#	value - optional value to set the key to
-
-proc ditem_key {ditem args} {
-	set nbargs [llength $args]
-	if {$nbargs > 1} {
-		return [macports_dlist::ditem_key $ditem [lindex $args 0] [lindex $args 1]]
-	} elseif {$nbargs == 1} {
-		return [macports_dlist::ditem_key $ditem [lindex $args 0]]
-	} else {
-		return [macports_dlist::ditem_key $ditem]
-	}
-}
-
-# ditem_append
-# Appends the value to the given key of the dependency item.
-#	ditem - the dependency item to operate on
-#	key   - the key to append to
-#	value - the value to append to the key
-
-proc ditem_append {ditem key args} {
-	eval "return \[macports_dlist::ditem_append $ditem $key $args\]"
-}
-
-# ditem_append_unique
-# Appends the value to the given key of the dependency item if
-# they were not there yet.
-#	ditem - the dependency item to operate on
-#	key   - the key to append to
-#	value - the value to append to the key
-
-proc ditem_append_unique {ditem key args} {
-	eval "return \[macports_dlist::ditem_append_unique $ditem $key $args\]"
-}
-
-# ditem_contains
-# Tests whether the ditem key contains the specified value;
-# or if the value is omitted, tests whether the key exists.
-#	ditem - the dependency item to test
-#	key   - the key to examine
-#	value - optional value to search for in the key
-proc ditem_contains {ditem key args} {
-	eval "return \[macports_dlist::ditem_contains $ditem $key $args\]"
-}
-
-# dlist_append_dependents
-# Returns the ditems which are dependents of the ditem specified.
-#	dlist - the dependency list to search
-#	ditem - the item which itself, and its dependents should be selected
-#	result - used for recursing, pass empty initially.
-
-proc dlist_append_dependents {dlist ditem result} {
-	# Only append things if the root item is not in the list.
-	# (otherwise, it means we already did this sub-graph)
-	if {[lsearch $result $ditem] == -1} {
-		lappend result $ditem
-
-		# Recursively append any hard dependencies.
-		foreach token [ditem_key $ditem requires] {
-			foreach provider [dlist_search $dlist provides $token] {
-				set result [dlist_append_dependents $dlist $provider $result]
-			}
-		}
-		# XXX: add soft-dependencies?
-	}
-	return $result
-}
-
-# dlist_get_next
-# Returns the any eligible item from the dependency list.
-# Eligibility is a function of the ditems in the list and
-# the status dictionary.  A ditem is eligible when all of
-# the services it Requires are present in the status
-# dictionary with a successful result code.
-#
-# Notes: this implementation of get next defers items based
-# on unfulfilled tokens in the Uses key.  However these items
-# will eventually be returned if there are no alternatives.
-# Soft-dependencies can be implemented in this way.
-#	dlist      - the dependency list to select from
-#	statusdict - the status dictionary describing the history
-#	             of the dependency list.
-
-proc dlist_get_next {dlist statusdict} {
-	upvar $statusdict upstatus
-	set nextitem {}
-	
-	# arbitrary large number ~ INT_MAX
-	set minfailed 2000000000
-	
-	foreach ditem $dlist {
-		# Skip if the ditem has unsatisfied hard dependencies
-		if {[dlist_count_unmet $dlist upstatus [ditem_key $ditem requires]]} {
-			continue
-		}
-		
-		# We will favor the ditem with the fewest unmet soft dependencies
-		set unmet [dlist_count_unmet $dlist upstatus [ditem_key $ditem uses]]
-		
-		# Delay items with unment soft dependencies that can eventually be met
-		if {$unmet > 0 && [dlist_has_pending $dlist [ditem_key $ditem uses]]} {
-			continue
-		}
-		
-		if {$unmet >= $minfailed} {
-			# not better than the last pick
-			continue
-		} else {
-			# better than the last pick (fewer unmet soft deps)
-			set minfailed $unmet
-			set nextitem $ditem
-		}
-	}
-	return $nextitem
-}
-
-# dlist_eval
-# Evaluate the dlist, select each eligible ditem according to
-# the optional selector argument (the default selector is 
-# dlist_get_next).  The specified handler is then invoked on
-# each ditem in the order they are selected.  When no more
-# ditems are eligible to run (the selector returns {}) then
-# dlist_eval will exit with a list of the remaining ditems,
-# or {} if all ditems were evaluated.
-#	dlist    - the dependency list to evaluate
-#	testcond - test condition to populate the status dictionary
-#	           should return {-1, 0, 1}
-#	handler  - the handler to invoke on each ditem
-#	canfail  - If 1, then progress will not stop when a failure
-#	           occures; if 0, then dlist_eval will return on the
-#	           first failure
-#	selector - the selector for determining eligibility
-
-proc dlist_eval {dlist testcond handler {canfail "0"} {selector "dlist_get_next"}} {
-	array set statusdict [list]
-	
-	# Do a pre-run seeing if any items automagically
-	# can evaluate to true.
-	if {$testcond != ""} {
-		foreach ditem $dlist {
-			if {[eval "expr \[\$testcond \$ditem\] == 1"]} {
-				foreach token [ditem_key $ditem provides] {
-					set statusdict($token) 1
-				}
-				dlist_delete dlist $ditem
-			}
-		}
-	}
-	
-	# Loop for as long as there are ditems in the dlist.
-	while {1} {
-		set ditem [$selector $dlist statusdict]
-		
-		if {$ditem == {}} {
-			break
-		} else {
-			# $handler should return a unix status code, 0 for success.
-			# statusdict notation is 1 for success
-			if {[catch {eval "$handler $ditem"} result]} {
-				puts $result
-				return $dlist
-			}
-			# No news is good news at this point.
-			if {$result == {}} { set result 0 }
-			
-			foreach token [ditem_key $ditem provides] {
-				set statusdict($token) [expr $result == 0]
-			}
-			
-			# Abort if we're not allowed to fail
-			if {$canfail == 0 && $result != 0} {
-				return $dlist
-			}
-			
-			# Delete the ditem from the waiting list.
-			dlist_delete dlist $ditem
-		}
-	}
-	
-	# Return the list of lusers
-	return $dlist
-}
-
-
-##### Private API #####
-# Anything below this point is subject to change without notice.
-#####
-
-# Each ditem is actually an array in the macports_dlist
-# namespace.  ditem keys correspond to the equivalent array
-# key.  A dlist is simply a list of names of ditem arrays.
-# All private API functions exist in the macports_dlist
-# namespace.
-
-namespace eval macports_dlist {
-
-variable ditem_uniqid 0
-
-proc ditem_create {} {
-	variable ditem_uniqid
-	incr ditem_uniqid
-	set ditem "ditem_${ditem_uniqid}"
-	variable $ditem
-	array set $ditem [list]
-	return $ditem
-}
-
-proc ditem_key {ditem args} {
-	variable $ditem
-	set nbargs [llength $args]
-	if {$nbargs > 1} {
-		set key [lindex $args 0]
-		array set $ditem [list $key [lindex $args 1]]
-		return [lindex [array get $ditem $key] 1]
-	} elseif {$nbargs == 1} {
-		set key [lindex $args 0]
-		return [lindex [array get $ditem $key] 1]
-	} else {
-		return [array get $ditem]
-	}
-}
-
-proc ditem_append {ditem key args} {
-	variable $ditem
-	set x [lindex [array get $ditem $key] 1]
-	if {$x != {}} {
-		eval "lappend x $args"
-	} else {
-		set x $args
-	}
-	array set $ditem [list $key $x]
-	return $x
-}
-
-proc ditem_append_unique {ditem key args} {
-	variable $ditem
-	set x [lindex [array get $ditem $key] 1]
-	if {$x != {}} {
-		eval "lappend x $args"
-		set x [lsort -unique $x]
-	} else {
-		set x $args
-	}
-	array set $ditem [list $key $x]
-	return $x
-}
-
-proc ditem_contains {ditem key args} {
-	variable $ditem
-	if {[llength $args] == 0} {
-		eval "return \[info exists ${ditem}($key)\]"
-	} else {
-		set x [lindex [array get $ditem $key] 1]
-		if {[llength $x] > 0 && [lsearch -exact $x [lindex $args 0]] != -1} {
-			return 1
-		} else {
-			return 0
-		}
-	}
-}
-
-# End of macports_dlist namespace
-}
-

Copied: trunk/base/src/macports1.0/macports_dlist.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl)
===================================================================
--- trunk/base/src/macports1.0/macports_dlist.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/macports_dlist.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,393 @@
+# macports1.0/macports_dlist.tcl
+# $Id$
+#
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2002 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+package provide macports_dlist 1.0
+
+# dependency dependency list evaluation package
+#
+# This package provides a generic mechanism for managing a list of
+# dependencies.  The basic model is that each dependency item
+# contains a list of tokens it Requires and tokens it Provides.
+# A dependency is selected once all of the tokens it Requires have
+# been provided by another dependency, or if a dependency has no
+# requirements.
+
+# Conceptually a dlist is an ordered list of ditem elements.
+# The order perserves the dependency hierarchy.
+
+# A dlist is an ordinary TCL list.
+# A ditem should be created with the [ditem_create] procedure,
+# and treated as an opaque reference.
+# A statusdict is an ordinary TCL array, though macports_dlist
+# should be given complete domain over its contents.
+# XXX: should statusdict and dlist be part of a ditem tuple?
+# Values in the status dict will be {-1, 0, 1} for {failure,
+# pending, success} respectively.
+
+# dlist_search
+# Returns all dependency entries whose 'key' contains 'value'.
+#	dlist - the dependency list to search
+#	key   - the key to compare: Requires, Provides, et al.
+#	value - the value to compare
+
+proc dlist_search {dlist key value} {
+	set result {}
+	foreach ditem $dlist {
+		if {[ditem_contains $ditem $key $value]} {
+			lappend result $ditem
+		}
+	}
+	return $result
+}
+
+# dlist_delete
+# Deletes the specified ditem from the dlist.
+#	dlist - the list to search
+#	ditem - the item to delete
+proc dlist_delete {dlist ditem} {
+    upvar $dlist uplist
+    set ix [lsearch -exact $uplist $ditem]
+    if {$ix >= 0} {
+		set uplist [lreplace $uplist $ix $ix]
+    }
+}
+
+# dlist_has_pending
+# Returns true if the dlist contains ditems
+# which will provide one of the specified names,
+# and thus are still "pending".
+#	dlist  - the dependency list to search
+#	tokens - the list of pending tokens to check for
+
+proc dlist_has_pending {dlist tokens} {
+	foreach token $tokens {
+		if {[llength [dlist_search $dlist provides $token]] > 0} {
+			return 1
+		}
+	}
+	return 0
+}
+
+# dlist_count_unmet
+# Returns the total number of unmet dependencies in
+# the list of tokens.  If the tokens are in the status
+# dictionary with a successful result code, they are 
+# considered met.
+proc dlist_count_unmet {dlist statusdict tokens} {
+	upvar $statusdict upstatus
+	set result 0
+	foreach token $tokens {
+		if {[info exists upstatus($token)] &&
+			$upstatus($token) == 1} {
+			continue
+		} else {
+			incr result
+		}
+	}
+	return $result
+}
+
+# ditem_create
+# Create a new array in the macports_dlist namespace
+# returns the name of the array.  This should be used as
+# the ditem handle.
+
+proc ditem_create {} {
+	return [macports_dlist::ditem_create]
+}
+
+# ditem_key
+# Sets and returns the given key of the dependency item.
+#	ditem - the dependency item to operate on
+#	key   - the key to set
+#	value - optional value to set the key to
+
+proc ditem_key {ditem args} {
+	set nbargs [llength $args]
+	if {$nbargs > 1} {
+		return [macports_dlist::ditem_key $ditem [lindex $args 0] [lindex $args 1]]
+	} elseif {$nbargs == 1} {
+		return [macports_dlist::ditem_key $ditem [lindex $args 0]]
+	} else {
+		return [macports_dlist::ditem_key $ditem]
+	}
+}
+
+# ditem_append
+# Appends the value to the given key of the dependency item.
+#	ditem - the dependency item to operate on
+#	key   - the key to append to
+#	value - the value to append to the key
+
+proc ditem_append {ditem key args} {
+	eval "return \[macports_dlist::ditem_append $ditem $key $args\]"
+}
+
+# ditem_append_unique
+# Appends the value to the given key of the dependency item if
+# they were not there yet.
+#	ditem - the dependency item to operate on
+#	key   - the key to append to
+#	value - the value to append to the key
+
+proc ditem_append_unique {ditem key args} {
+	eval "return \[macports_dlist::ditem_append_unique $ditem $key $args\]"
+}
+
+# ditem_contains
+# Tests whether the ditem key contains the specified value;
+# or if the value is omitted, tests whether the key exists.
+#	ditem - the dependency item to test
+#	key   - the key to examine
+#	value - optional value to search for in the key
+proc ditem_contains {ditem key args} {
+	eval "return \[macports_dlist::ditem_contains $ditem $key $args\]"
+}
+
+# dlist_append_dependents
+# Returns the ditems which are dependents of the ditem specified.
+#	dlist - the dependency list to search
+#	ditem - the item which itself, and its dependents should be selected
+#	result - used for recursing, pass empty initially.
+
+proc dlist_append_dependents {dlist ditem result} {
+	# Only append things if the root item is not in the list.
+	# (otherwise, it means we already did this sub-graph)
+	if {[lsearch $result $ditem] == -1} {
+		lappend result $ditem
+
+		# Recursively append any hard dependencies.
+		foreach token [ditem_key $ditem requires] {
+			foreach provider [dlist_search $dlist provides $token] {
+				set result [dlist_append_dependents $dlist $provider $result]
+			}
+		}
+		# XXX: add soft-dependencies?
+	}
+	return $result
+}
+
+# dlist_get_next
+# Returns the any eligible item from the dependency list.
+# Eligibility is a function of the ditems in the list and
+# the status dictionary.  A ditem is eligible when all of
+# the services it Requires are present in the status
+# dictionary with a successful result code.
+#
+# Notes: this implementation of get next defers items based
+# on unfulfilled tokens in the Uses key.  However these items
+# will eventually be returned if there are no alternatives.
+# Soft-dependencies can be implemented in this way.
+#	dlist      - the dependency list to select from
+#	statusdict - the status dictionary describing the history
+#	             of the dependency list.
+
+proc dlist_get_next {dlist statusdict} {
+	upvar $statusdict upstatus
+	set nextitem {}
+	
+	# arbitrary large number ~ INT_MAX
+	set minfailed 2000000000
+	
+	foreach ditem $dlist {
+		# Skip if the ditem has unsatisfied hard dependencies
+		if {[dlist_count_unmet $dlist upstatus [ditem_key $ditem requires]]} {
+			continue
+		}
+		
+		# We will favor the ditem with the fewest unmet soft dependencies
+		set unmet [dlist_count_unmet $dlist upstatus [ditem_key $ditem uses]]
+		
+		# Delay items with unment soft dependencies that can eventually be met
+		if {$unmet > 0 && [dlist_has_pending $dlist [ditem_key $ditem uses]]} {
+			continue
+		}
+		
+		if {$unmet >= $minfailed} {
+			# not better than the last pick
+			continue
+		} else {
+			# better than the last pick (fewer unmet soft deps)
+			set minfailed $unmet
+			set nextitem $ditem
+		}
+	}
+	return $nextitem
+}
+
+# dlist_eval
+# Evaluate the dlist, select each eligible ditem according to
+# the optional selector argument (the default selector is 
+# dlist_get_next).  The specified handler is then invoked on
+# each ditem in the order they are selected.  When no more
+# ditems are eligible to run (the selector returns {}) then
+# dlist_eval will exit with a list of the remaining ditems,
+# or {} if all ditems were evaluated.
+#	dlist    - the dependency list to evaluate
+#	testcond - test condition to populate the status dictionary
+#	           should return {-1, 0, 1}
+#	handler  - the handler to invoke on each ditem
+#	canfail  - If 1, then progress will not stop when a failure
+#	           occures; if 0, then dlist_eval will return on the
+#	           first failure
+#	selector - the selector for determining eligibility
+
+proc dlist_eval {dlist testcond handler {canfail "0"} {selector "dlist_get_next"}} {
+	array set statusdict [list]
+	
+	# Do a pre-run seeing if any items automagically
+	# can evaluate to true.
+	if {$testcond != ""} {
+		foreach ditem $dlist {
+			if {[eval "expr \[\$testcond \$ditem\] == 1"]} {
+				foreach token [ditem_key $ditem provides] {
+					set statusdict($token) 1
+				}
+				dlist_delete dlist $ditem
+			}
+		}
+	}
+	
+	# Loop for as long as there are ditems in the dlist.
+	while {1} {
+		set ditem [$selector $dlist statusdict]
+		
+		if {$ditem == {}} {
+			break
+		} else {
+			# $handler should return a unix status code, 0 for success.
+			# statusdict notation is 1 for success
+			if {[catch {eval "$handler $ditem"} result]} {
+				puts $result
+				return $dlist
+			}
+			# No news is good news at this point.
+			if {$result == {}} { set result 0 }
+			
+			foreach token [ditem_key $ditem provides] {
+				set statusdict($token) [expr $result == 0]
+			}
+			
+			# Abort if we're not allowed to fail
+			if {$canfail == 0 && $result != 0} {
+				return $dlist
+			}
+			
+			# Delete the ditem from the waiting list.
+			dlist_delete dlist $ditem
+		}
+	}
+	
+	# Return the list of lusers
+	return $dlist
+}
+
+
+##### Private API #####
+# Anything below this point is subject to change without notice.
+#####
+
+# Each ditem is actually an array in the macports_dlist
+# namespace.  ditem keys correspond to the equivalent array
+# key.  A dlist is simply a list of names of ditem arrays.
+# All private API functions exist in the macports_dlist
+# namespace.
+
+namespace eval macports_dlist {
+
+variable ditem_uniqid 0
+
+proc ditem_create {} {
+	variable ditem_uniqid
+	incr ditem_uniqid
+	set ditem "ditem_${ditem_uniqid}"
+	variable $ditem
+	array set $ditem [list]
+	return $ditem
+}
+
+proc ditem_key {ditem args} {
+	variable $ditem
+	set nbargs [llength $args]
+	if {$nbargs > 1} {
+		set key [lindex $args 0]
+		array set $ditem [list $key [lindex $args 1]]
+		return [lindex [array get $ditem $key] 1]
+	} elseif {$nbargs == 1} {
+		set key [lindex $args 0]
+		return [lindex [array get $ditem $key] 1]
+	} else {
+		return [array get $ditem]
+	}
+}
+
+proc ditem_append {ditem key args} {
+	variable $ditem
+	set x [lindex [array get $ditem $key] 1]
+	if {$x != {}} {
+		eval "lappend x $args"
+	} else {
+		set x $args
+	}
+	array set $ditem [list $key $x]
+	return $x
+}
+
+proc ditem_append_unique {ditem key args} {
+	variable $ditem
+	set x [lindex [array get $ditem $key] 1]
+	if {$x != {}} {
+		eval "lappend x $args"
+		set x [lsort -unique $x]
+	} else {
+		set x $args
+	}
+	array set $ditem [list $key $x]
+	return $x
+}
+
+proc ditem_contains {ditem key args} {
+	variable $ditem
+	if {[llength $args] == 0} {
+		eval "return \[info exists ${ditem}($key)\]"
+	} else {
+		set x [lindex [array get $ditem $key] 1]
+		if {[llength $x] > 0 && [lsearch -exact $x [lindex $args 0]] != -1} {
+			return 1
+		} else {
+			return 0
+		}
+	}
+}
+
+# End of macports_dlist namespace
+}
+

Deleted: trunk/base/src/macports1.0/macports_fastload.tcl.in
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports_fastload.tcl.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,83 +0,0 @@
-# macports_fastload.tcl.in
-# $Id$
-#
-# Copyright (c) 2004 Paul Guyot, MacPorts Team.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-# This script is here to fast load all the MacPorts related packages.
-# This avoids the very expensive globbing of Tcl' package mechanism.
-# Please note that this is not required and base/ should work even if some
-# packages are moved as long as their new location is in Tcl's package paths.
-# However, this file also defines a workaround to avoid conflicts between a /
-# installation of MacPorts and a user installation of MacPorts (on the same box).
-# (this workaround isn't required on 10.4.2).
-#
-# The package command that's replaced in this code works somewhat differently
-# than the original version. In particular, users with multiple copies of a
-# package such as portuninstall (due to obsolete files being left from previous
-# installations) may experience problems due to different package loading
-# behavior.
-#
-if { ($tcl_version < 8.4) ||
-	(($tcl_version == 8.4) && ([lindex [split [info patchlevel] .] 3] < 7))} {
-	global allpackages
-	if {![info exists allpackages]} {
-		# Only patch once.
-		array set allpackages {}
-		rename package package_native
-		proc package {args} {
-				global allpackages
-				if {([lindex $args 0] == "ifneeded") && ([llength $args] == 4)} {
-						set package_name [lindex $args 1]
-						set package_version [lindex $args 2]
-						set package_key ${package_name}::${package_version}
-						if {![info exists allpackages($package_key)]} {
-								set allpackages($package_key) 1
-								set result [eval package_native $args]
-						} else {
-								set result ""
-						}
-				} else {
-						set result [eval package_native $args]
-				}
-				return $result
-		}
-	}
-}
-
-set dir [file join "@TCL_PACKAGE_DIR@" macports1.0]
-catch {source [file join $dir pkgIndex.tcl]}
-
-foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
-	catch {source [file join $dir pkgIndex.tcl]}
-}
-
-if { "@SQLITE3_DIR@" != "" } {
-	set dir "@SQLITE3_DIR@"
-	catch {source [file join $dir pkgIndex.tcl]}
-}

Copied: trunk/base/src/macports1.0/macports_fastload.tcl.in (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in)
===================================================================
--- trunk/base/src/macports1.0/macports_fastload.tcl.in	                        (rev 0)
+++ trunk/base/src/macports1.0/macports_fastload.tcl.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,83 @@
+# macports_fastload.tcl.in
+# $Id$
+#
+# Copyright (c) 2004 Paul Guyot, MacPorts Team.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# This script is here to fast load all the MacPorts related packages.
+# This avoids the very expensive globbing of Tcl' package mechanism.
+# Please note that this is not required and base/ should work even if some
+# packages are moved as long as their new location is in Tcl's package paths.
+# However, this file also defines a workaround to avoid conflicts between a /
+# installation of MacPorts and a user installation of MacPorts (on the same box).
+# (this workaround isn't required on 10.4.2).
+#
+# The package command that's replaced in this code works somewhat differently
+# than the original version. In particular, users with multiple copies of a
+# package such as portuninstall (due to obsolete files being left from previous
+# installations) may experience problems due to different package loading
+# behavior.
+#
+if { ($tcl_version < 8.4) ||
+	(($tcl_version == 8.4) && ([lindex [split [info patchlevel] .] 3] < 7))} {
+	global allpackages
+	if {![info exists allpackages]} {
+		# Only patch once.
+		array set allpackages {}
+		rename package package_native
+		proc package {args} {
+				global allpackages
+				if {([lindex $args 0] == "ifneeded") && ([llength $args] == 4)} {
+						set package_name [lindex $args 1]
+						set package_version [lindex $args 2]
+						set package_key ${package_name}::${package_version}
+						if {![info exists allpackages($package_key)]} {
+								set allpackages($package_key) 1
+								set result [eval package_native $args]
+						} else {
+								set result ""
+						}
+				} else {
+						set result [eval package_native $args]
+				}
+				return $result
+		}
+	}
+}
+
+set dir [file join "@TCL_PACKAGE_DIR@" macports1.0]
+catch {source [file join $dir pkgIndex.tcl]}
+
+foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
+	catch {source [file join $dir pkgIndex.tcl]}
+}
+
+if { "@SQLITE3_DIR@" != "" } {
+	set dir "@SQLITE3_DIR@"
+	catch {source [file join $dir pkgIndex.tcl]}
+}

Deleted: trunk/base/src/macports1.0/macports_index.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_index.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports_index.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,379 +0,0 @@
-# macports_index.tcl
-# $Id$
-#
-# Copyright (c) 2004 Apple Computer, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# 31-Mar-2004
-# Kevin Van Vechten <kevin at opedarwin.org>
-#
-
-package provide macports_index 1.0
-
-namespace eval macports::index {
-	variable has_sqlite {}
-}
-
-proc macports::index::init {} {
-	global macports::index::has_sqlite macports::prefix
-	if {$macports::index::has_sqlite == 1 ||
-		[file exists ${macports::prefix}/lib/tclsqlite.dylib]} {
-		load ${macports::prefix}/lib/tclsqlite.dylib Sqlite
-		set macports::index::has_sqlite 1
-	} else {
-		return -code error "Sqlite must be installed to use a remote index.  Use the tclsqlite port."
-	}
-}
-
-proc macports::index::get_path {source} {
-    global macports::portdbpath
-    regsub {://} $source {.} source_dir
-    regsub -all {/} $source_dir {_} source_dir
-    return [file join $portdbpath sources $source_dir]
-}
-
-
-# macports::index::sync
-# Interact with the remote index at the specified URL.
-# Replays the SQL transactions contained in the remote
-# index file into a local database, creating it if it
-# does not yet exist.  If it does already exist, only
-# the transactions newer than the last sync will be
-# downloaded and replayed.
-#
-# portdbpath - the path to which the local database should
-#              be stored.  "portindex/" and a unique hash based
-#              on the url will be appended to this path.
-# url        - the url of the remote index to synchronize with
-
-proc macports::index::sync {portdbpath url} {
-	macports::index::init
-
-	set indexpath [macports::index::get_path $url]
-	if {[catch {file mkdir $indexpath} result]} {
-		return -code error "$indexpath could not be created: $result"
-	}
-
-	set oldpath [pwd]
-	cd $indexpath
-	
-	# We actually use http:// as the transport mechanism
-	set url [regsub -- {^mports} $url {http}]
-
-	# If the database didn't exist, initialize it.
-	# The schema is available on the server in the initialize.sql file.
-	if {![file exists [file join $indexpath database.sqlite]]} {
-		puts "Initializing portindex"
-		exec curl --silent -O "$url/index/initialize.sql"
-		# XXX detect curl failures
-		
-		set fd [open initialize.sql r]
-		set sql {}
-		while {[gets $fd line] >= 0} {
-			append sql " $line\n"
-		}
-		close $fd
-		# Database file has the name database.sqlite
-		sqlite DB database.sqlite
-		DB eval $sql
-		DB eval "CREATE TABLE priv_data (keyword text, value int);"
-		DB eval "INSERT INTO priv_data (keyword, value) VALUES ('last_index', 1);"
-		DB eval "INSERT INTO priv_data (keyword, value) VALUES ('last_trans', 0);"
-		DB close
-	}
-
-	# Database file has the name database.sqlite
-	sqlite DB database.sqlite
-
-	##
-	# Download any new files
-	##
-
-	# Get the last downloaded file index out of the database.
-	set start_index [DB eval "SELECT value FROM priv_data WHERE keyword='last_index';"]
-
-	# Get the current high-water mark from the server.
-	exec curl --silent -O "$url/index/.last_index"
-	# XXX detect curl failures
-	set fd [open ".last_index" r]
-	gets $fd last_index
-	# XXX should validate the contents of $last_index
-	close $fd
-	# Re-fetch the last file we fetched (transactions may have
-	# been appended to it) and any new files.
-	for {set i $start_index} {$i <= $last_index} {incr i} {
-		puts "Fetching portindex-$i"
-		exec curl --silent -O "$url/index/portindex-$i.sql"
-		# XXX detect curl failures
-		DB eval "UPDATE priv_data SET value=$i WHERE keyword='last_index';\n"
-	}
-
-	##
-	# Replay the transactions
-	##
-
-	# Get the last transaction ID out of the database.
-	set last_trans [DB eval "SELECT value FROM priv_data WHERE keyword='last_trans';"]
-
-	# Iterate through the files we just downloaded
-	for {set i $start_index} {$i <= $last_index} {incr i} {
-		puts "Processing portindex-$i"
-		set fd [open "portindex-$i.sql" r]
-		set sql {}
-		while {[gets $fd line] >= 0} {
-			append sql " $line\n"	
-			if {[regexp -- {^-- END TRANSACTION #([0-9]+)} $line unused trans_id] == 1} {
-				# If this is a transaction we have not seen before, commit it.
-				# Also update the last transaction number.
-				if {$trans_id > $last_trans} {
-					set last_trans $trans_id
-					append sql " UPDATE priv_data SET value=$last_trans WHERE keyword='last_trans';\n"
-					DB eval $sql
-				}
-				set sql {}
-			}
-		}
-		close $fd
-	}
-
-	# Clean Up
-	DB close
-	cd $oldpath
-}
-
-# macports::index::search
-#
-# Searches the cached copy of the specified port index for
-# the Portfile satisfying the given query.
-#
-# Todo -- in the future we may want to do an implicit "port sync"
-# when this function is called.
-#
-# portdbpath - the path to which the local database should
-#              be stored.  "portindex/" and a unique hash based
-#              on the url will be appended to this path.
-# url        - the url of the remote index to search
-#
-# attrs      - an array of the attributes to search for
-#			   currently only "name" is supported.
-
-proc macports::index::search {portdbpath url attrslist} {
-	macports::index::init
-	set indexpath [macports::index::get_path $url]
-
-	if {![file exists $indexpath/database.sqlite]} {
-		return -code error "Can't open index file for source $url. Have you synced your source indexes (port sync)?"
-	}
-
-	sqlite DB $indexpath/database.sqlite
-	# Map some functions into the SQL namespace
-	DB function regexp regexp
-	
-	# The guts of the search logic.
-	# Precedence is as follows:
-	# - If a name, version, and revision is specified return that single port.
-	# - If a name and version is specified, return the highest revision
-	# - If only a name is specified, return the highest revision of 
-	#   all distinct name, version combinations.
-	# - NOTE: it is an error to specify a revision without a version.
-
-	set pids [list]
-	array set attrs $attrslist
-	if {[info exists attrs(name)]} {
-		set name $attrs(name)
-
-		# If version was not specified, find all distinct versions;
-		# otherwise use the specified version.
-		if {![info exists attrs(version)]} {
-			set sql "SELECT version FROM ports WHERE regexp('--','$name',name) GROUP BY version ORDER BY version DESC"
-			set versions [DB eval $sql]
-		} else {
-			set versions [list $attrs(version)]
-		}
-	
-		# If revision was not specified, find the highest revision;
-		# otherwise use the specified revision.
-		if {![info exists attrs(revision)]} {
-			foreach version $versions {
-				set sql "SELECT max(revision) FROM ports WHERE regexp('--','$name',name) AND version LIKE '$version'"
-				set revisions($version) [DB eval $sql]
-			}
-		} else {
-			set revisions($version) $attrs(revision)
-		}
-		
-		foreach version $versions {
-			set sql "SELECT pid FROM ports WHERE regexp('--','$name',name) AND version LIKE '$version' AND revision LIKE '$revisions($version)'"
-			lappend pids [DB eval $sql]
-		}
-	}
-	
-	# Historically mportsearch has returned a serialized list of arrays.
-	# This is kinda gross and really needs to change to a more opaque
-	# data type in the future, but to ease the transition we're it the old
-	# way here.  For each port that matched the query, build up an array 
-	# from the keywords table and append it to the list.
-
-	set result [list]
-
-	foreach pid $pids {
-		set portinfo [list]
-		set primary_key [DB eval "SELECT name,version,revision FROM ports WHERE pid=$pid"]
-		set name [lindex $primary_key 0]
-		set version [lindex $primary_key 1]
-		set revision [lindex $primary_key 2]
-		lappend portinfo name $name
-		lappend portinfo version $version
-		lappend portinfo revision $revision
-		
-		set auxiliary_keys [DB eval "SELECT keyword, value FROM keywords WHERE pid=$pid"]
-		foreach {key value} $auxiliary_keys {
-			# XXX - special case list types: categories, maintainers, master_sites
-			lappend portinfo $key $value
-		}
-		
-		# Craft a URL where the port can be found.
-		lappend portinfo porturl $url/files/$name/$version/$revision/Portfile.tar.gz
-		
-		# Make a note of where this port came from.
-		lappend portsource $url
-		
-		lappend result $name
-		lappend result $portinfo
-	}
-
-	DB close
-
-	return $result
-}
-
-
-
-# macports::index::fetch_port
-#
-# Checks for a locally cached copy of the port, or downloads the port
-# from the specified URL.  The port is extracted into the current working
-# directory along with a .mports_source file containing the url of the
-# source the port came from.  (This can be later used as a default for
-# "port submit")
-#
-# The cached portfiles are in the same directory as the cached remote index.
-#
-# TODO - the existing infrastructure only gives us a URL at this point,
-# but we really ought to have an opaque handle to a port.  We want to
-# get the source URL and the Portfile.tar.gz md5 from this opaque handle.
-
-proc macports::index::fetch_port {url destdir} {
-	global macports::sources
-	
-	set portsource ""
-	set portname ""
-	set portversion ""
-	set portrevision ""
-	
-	# Iterate through the sources, to see which one this port is coming from.
-	# If the port is not coming from a known source, return an error (for now).
-	
-	set indexpath ""
-	set fetchpath ""
-	foreach source $sources {
-		if {[regexp -- "^$source" $url] == 1} {
-			set portsource $source
-			set indexpath [macports::index::get_path $source]
-			
-			# Extract the relative portion of the url, 
-			# and append it to the indexpath, this is where
-			# we will store the cached Portfile.
-			set dir [file dirname [regsub -- "$source/?" $url {}]]
-
-			# XXX: crude hack to get port name and version, should realy come from opaque port handle.
-			set portname [lindex [file split $dir] 1]
-			set portversion [lindex [file split $dir] 2]
-			set portrevision [lindex [file split $dir] 3]
-
-			set fetchpath [file join $indexpath $dir]
-			break
-		}
-	}
-	
-	if {$indexpath == "" || $fetchpath == ""} {
-		return -code error "Port URL has unknown source: $url"
-	}
-	
-	if {[catch {file mkdir $fetchpath} result]} {
-		return -code error $result
-	}
-
-	# If the portdir already exists, we don't bother extracting again.
-	
-	# Look to see if the file exists in our cache, if it does, attempt
-	# to extract it into the temporary directory that we will build in.
-	# If it does not exist, or if the tar extraction fails, then attempt
-	# to fetch it again.
-
-
-	set portdir [file join "$destdir" "$portname-$portversion"]
-
-	if {[file exists $portdir]} {
-		return $portdir
-	}
-	
-	if {[catch {file mkdir $portdir} result]} {
-		return -code error $result
-	}
-
-	set fetchfile [file join $fetchpath [file tail $url]]
-	set retries 2
-	while {$retries > 0} {
-		if {[file exists $fetchfile]} {
-			set oldcwd [pwd]
-			cd $portdir
-			
-			if {[catch {exec tar -zxf $fetchfile} result]} {
-				return -code error "Could not unpack port file: $result"
-			}
-			
-			set fd [open ".mports_source" w]
-			puts $fd "source: $portsource"
-			puts $fd "port: $portname"
-			puts $fd "version: $portversion"
-			puts $fd "revision: $portrevision"
-			close $fd
-			
-			cd $oldcwd
-		} else {		
-			# We actually use http:// as the transport mechanism
-			set http_url [regsub -- {^mports} $url {http}]
-			if {[catch {exec curl -L -s -S -o $fetchfile $http_url} result ]} {
-				return -code error "Could not download port from remote index: $result"
-			}
-		}
-		incr retries -1
-	}
-	
-	return $portdir
-}

Copied: trunk/base/src/macports1.0/macports_index.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports_index.tcl)
===================================================================
--- trunk/base/src/macports1.0/macports_index.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/macports_index.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,379 @@
+# macports_index.tcl
+# $Id$
+#
+# Copyright (c) 2004 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# 31-Mar-2004
+# Kevin Van Vechten <kevin at opedarwin.org>
+#
+
+package provide macports_index 1.0
+
+namespace eval macports::index {
+	variable has_sqlite {}
+}
+
+proc macports::index::init {} {
+	global macports::index::has_sqlite macports::prefix
+	if {$macports::index::has_sqlite == 1 ||
+		[file exists ${macports::prefix}/lib/tclsqlite.dylib]} {
+		load ${macports::prefix}/lib/tclsqlite.dylib Sqlite
+		set macports::index::has_sqlite 1
+	} else {
+		return -code error "Sqlite must be installed to use a remote index.  Use the tclsqlite port."
+	}
+}
+
+proc macports::index::get_path {source} {
+    global macports::portdbpath
+    regsub {://} $source {.} source_dir
+    regsub -all {/} $source_dir {_} source_dir
+    return [file join $portdbpath sources $source_dir]
+}
+
+
+# macports::index::sync
+# Interact with the remote index at the specified URL.
+# Replays the SQL transactions contained in the remote
+# index file into a local database, creating it if it
+# does not yet exist.  If it does already exist, only
+# the transactions newer than the last sync will be
+# downloaded and replayed.
+#
+# portdbpath - the path to which the local database should
+#              be stored.  "portindex/" and a unique hash based
+#              on the url will be appended to this path.
+# url        - the url of the remote index to synchronize with
+
+proc macports::index::sync {portdbpath url} {
+	macports::index::init
+
+	set indexpath [macports::index::get_path $url]
+	if {[catch {file mkdir $indexpath} result]} {
+		return -code error "$indexpath could not be created: $result"
+	}
+
+	set oldpath [pwd]
+	cd $indexpath
+	
+	# We actually use http:// as the transport mechanism
+	set url [regsub -- {^mports} $url {http}]
+
+	# If the database didn't exist, initialize it.
+	# The schema is available on the server in the initialize.sql file.
+	if {![file exists [file join $indexpath database.sqlite]]} {
+		puts "Initializing portindex"
+		exec curl --silent -O "$url/index/initialize.sql"
+		# XXX detect curl failures
+		
+		set fd [open initialize.sql r]
+		set sql {}
+		while {[gets $fd line] >= 0} {
+			append sql " $line\n"
+		}
+		close $fd
+		# Database file has the name database.sqlite
+		sqlite DB database.sqlite
+		DB eval $sql
+		DB eval "CREATE TABLE priv_data (keyword text, value int);"
+		DB eval "INSERT INTO priv_data (keyword, value) VALUES ('last_index', 1);"
+		DB eval "INSERT INTO priv_data (keyword, value) VALUES ('last_trans', 0);"
+		DB close
+	}
+
+	# Database file has the name database.sqlite
+	sqlite DB database.sqlite
+
+	##
+	# Download any new files
+	##
+
+	# Get the last downloaded file index out of the database.
+	set start_index [DB eval "SELECT value FROM priv_data WHERE keyword='last_index';"]
+
+	# Get the current high-water mark from the server.
+	exec curl --silent -O "$url/index/.last_index"
+	# XXX detect curl failures
+	set fd [open ".last_index" r]
+	gets $fd last_index
+	# XXX should validate the contents of $last_index
+	close $fd
+	# Re-fetch the last file we fetched (transactions may have
+	# been appended to it) and any new files.
+	for {set i $start_index} {$i <= $last_index} {incr i} {
+		puts "Fetching portindex-$i"
+		exec curl --silent -O "$url/index/portindex-$i.sql"
+		# XXX detect curl failures
+		DB eval "UPDATE priv_data SET value=$i WHERE keyword='last_index';\n"
+	}
+
+	##
+	# Replay the transactions
+	##
+
+	# Get the last transaction ID out of the database.
+	set last_trans [DB eval "SELECT value FROM priv_data WHERE keyword='last_trans';"]
+
+	# Iterate through the files we just downloaded
+	for {set i $start_index} {$i <= $last_index} {incr i} {
+		puts "Processing portindex-$i"
+		set fd [open "portindex-$i.sql" r]
+		set sql {}
+		while {[gets $fd line] >= 0} {
+			append sql " $line\n"	
+			if {[regexp -- {^-- END TRANSACTION #([0-9]+)} $line unused trans_id] == 1} {
+				# If this is a transaction we have not seen before, commit it.
+				# Also update the last transaction number.
+				if {$trans_id > $last_trans} {
+					set last_trans $trans_id
+					append sql " UPDATE priv_data SET value=$last_trans WHERE keyword='last_trans';\n"
+					DB eval $sql
+				}
+				set sql {}
+			}
+		}
+		close $fd
+	}
+
+	# Clean Up
+	DB close
+	cd $oldpath
+}
+
+# macports::index::search
+#
+# Searches the cached copy of the specified port index for
+# the Portfile satisfying the given query.
+#
+# Todo -- in the future we may want to do an implicit "port sync"
+# when this function is called.
+#
+# portdbpath - the path to which the local database should
+#              be stored.  "portindex/" and a unique hash based
+#              on the url will be appended to this path.
+# url        - the url of the remote index to search
+#
+# attrs      - an array of the attributes to search for
+#			   currently only "name" is supported.
+
+proc macports::index::search {portdbpath url attrslist} {
+	macports::index::init
+	set indexpath [macports::index::get_path $url]
+
+	if {![file exists $indexpath/database.sqlite]} {
+		return -code error "Can't open index file for source $url. Have you synced your source indexes (port sync)?"
+	}
+
+	sqlite DB $indexpath/database.sqlite
+	# Map some functions into the SQL namespace
+	DB function regexp regexp
+	
+	# The guts of the search logic.
+	# Precedence is as follows:
+	# - If a name, version, and revision is specified return that single port.
+	# - If a name and version is specified, return the highest revision
+	# - If only a name is specified, return the highest revision of 
+	#   all distinct name, version combinations.
+	# - NOTE: it is an error to specify a revision without a version.
+
+	set pids [list]
+	array set attrs $attrslist
+	if {[info exists attrs(name)]} {
+		set name $attrs(name)
+
+		# If version was not specified, find all distinct versions;
+		# otherwise use the specified version.
+		if {![info exists attrs(version)]} {
+			set sql "SELECT version FROM ports WHERE regexp('--','$name',name) GROUP BY version ORDER BY version DESC"
+			set versions [DB eval $sql]
+		} else {
+			set versions [list $attrs(version)]
+		}
+	
+		# If revision was not specified, find the highest revision;
+		# otherwise use the specified revision.
+		if {![info exists attrs(revision)]} {
+			foreach version $versions {
+				set sql "SELECT max(revision) FROM ports WHERE regexp('--','$name',name) AND version LIKE '$version'"
+				set revisions($version) [DB eval $sql]
+			}
+		} else {
+			set revisions($version) $attrs(revision)
+		}
+		
+		foreach version $versions {
+			set sql "SELECT pid FROM ports WHERE regexp('--','$name',name) AND version LIKE '$version' AND revision LIKE '$revisions($version)'"
+			lappend pids [DB eval $sql]
+		}
+	}
+	
+	# Historically mportsearch has returned a serialized list of arrays.
+	# This is kinda gross and really needs to change to a more opaque
+	# data type in the future, but to ease the transition we're it the old
+	# way here.  For each port that matched the query, build up an array 
+	# from the keywords table and append it to the list.
+
+	set result [list]
+
+	foreach pid $pids {
+		set portinfo [list]
+		set primary_key [DB eval "SELECT name,version,revision FROM ports WHERE pid=$pid"]
+		set name [lindex $primary_key 0]
+		set version [lindex $primary_key 1]
+		set revision [lindex $primary_key 2]
+		lappend portinfo name $name
+		lappend portinfo version $version
+		lappend portinfo revision $revision
+		
+		set auxiliary_keys [DB eval "SELECT keyword, value FROM keywords WHERE pid=$pid"]
+		foreach {key value} $auxiliary_keys {
+			# XXX - special case list types: categories, maintainers, master_sites
+			lappend portinfo $key $value
+		}
+		
+		# Craft a URL where the port can be found.
+		lappend portinfo porturl $url/files/$name/$version/$revision/Portfile.tar.gz
+		
+		# Make a note of where this port came from.
+		lappend portsource $url
+		
+		lappend result $name
+		lappend result $portinfo
+	}
+
+	DB close
+
+	return $result
+}
+
+
+
+# macports::index::fetch_port
+#
+# Checks for a locally cached copy of the port, or downloads the port
+# from the specified URL.  The port is extracted into the current working
+# directory along with a .mports_source file containing the url of the
+# source the port came from.  (This can be later used as a default for
+# "port submit")
+#
+# The cached portfiles are in the same directory as the cached remote index.
+#
+# TODO - the existing infrastructure only gives us a URL at this point,
+# but we really ought to have an opaque handle to a port.  We want to
+# get the source URL and the Portfile.tar.gz md5 from this opaque handle.
+
+proc macports::index::fetch_port {url destdir} {
+	global macports::sources
+	
+	set portsource ""
+	set portname ""
+	set portversion ""
+	set portrevision ""
+	
+	# Iterate through the sources, to see which one this port is coming from.
+	# If the port is not coming from a known source, return an error (for now).
+	
+	set indexpath ""
+	set fetchpath ""
+	foreach source $sources {
+		if {[regexp -- "^$source" $url] == 1} {
+			set portsource $source
+			set indexpath [macports::index::get_path $source]
+			
+			# Extract the relative portion of the url, 
+			# and append it to the indexpath, this is where
+			# we will store the cached Portfile.
+			set dir [file dirname [regsub -- "$source/?" $url {}]]
+
+			# XXX: crude hack to get port name and version, should realy come from opaque port handle.
+			set portname [lindex [file split $dir] 1]
+			set portversion [lindex [file split $dir] 2]
+			set portrevision [lindex [file split $dir] 3]
+
+			set fetchpath [file join $indexpath $dir]
+			break
+		}
+	}
+	
+	if {$indexpath == "" || $fetchpath == ""} {
+		return -code error "Port URL has unknown source: $url"
+	}
+	
+	if {[catch {file mkdir $fetchpath} result]} {
+		return -code error $result
+	}
+
+	# If the portdir already exists, we don't bother extracting again.
+	
+	# Look to see if the file exists in our cache, if it does, attempt
+	# to extract it into the temporary directory that we will build in.
+	# If it does not exist, or if the tar extraction fails, then attempt
+	# to fetch it again.
+
+
+	set portdir [file join "$destdir" "$portname-$portversion"]
+
+	if {[file exists $portdir]} {
+		return $portdir
+	}
+	
+	if {[catch {file mkdir $portdir} result]} {
+		return -code error $result
+	}
+
+	set fetchfile [file join $fetchpath [file tail $url]]
+	set retries 2
+	while {$retries > 0} {
+		if {[file exists $fetchfile]} {
+			set oldcwd [pwd]
+			cd $portdir
+			
+			if {[catch {exec tar -zxf $fetchfile} result]} {
+				return -code error "Could not unpack port file: $result"
+			}
+			
+			set fd [open ".mports_source" w]
+			puts $fd "source: $portsource"
+			puts $fd "port: $portname"
+			puts $fd "version: $portversion"
+			puts $fd "revision: $portrevision"
+			close $fd
+			
+			cd $oldcwd
+		} else {		
+			# We actually use http:// as the transport mechanism
+			set http_url [regsub -- {^mports} $url {http}]
+			if {[catch {exec curl -L -s -S -o $fetchfile $http_url} result ]} {
+				return -code error "Could not download port from remote index: $result"
+			}
+		}
+		incr retries -1
+	}
+	
+	return $portdir
+}

Deleted: trunk/base/src/macports1.0/macports_util.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_util.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/macports_util.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,333 +0,0 @@
-# macports.tcl
-# $Id$
-#
-# Copyright (c) 2007 Kevin Ballard <eridius at macports.org>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-package provide macports_util 1.0
-
-# Provide some global utilities
-
-namespace eval macports_util {
-    ###################
-    # Private methods #
-    ###################
-    proc method_wrap {name} {
-        variable argdefault
-    
-        set name [list $name]
-        # reconstruct the args list
-        set args [uplevel 1 [subst -nocommands {info args $name}]]
-        set arglist {}
-        foreach arg $args {
-            set argname [list $arg]
-            if {[uplevel 1 [subst -nocommands {info default $name $argname argdefault}]]} {
-                lappend arglist [list $arg $argdefault]
-            } else {
-                lappend arglist $arg
-            }
-        }
-        # modify the proc
-        set arglist [list $arglist]
-        set body [uplevel 1 [subst -nocommands {info body $name}]]
-        uplevel 1 [subst -nocommands {
-            proc $name $arglist {
-                if {[set err [catch {$body} result]] && [set err] != 2} {
-                    if {[set err] == 1} {
-                        return -code [set err] -errorcode [set ::errorCode] [set result]
-                    } else {
-                        return -code [set err] [set result]
-                    }
-                } else {
-                    return [set result]
-                }
-            }
-        }]
-    }
-}
-
-###################
-# List management #
-###################
-# It would be nice to have these written in C
-# That way we could avoid duplicating lists if they're not shared
-# but oh well
-
-# ldindex varName ?index...?
-# Removes the index'th list element from varName and returns it
-# If multiple indexes are provided, each one is a subindex into the
-# list element specified by the previous index
-# If no indexes are provided, deletes the entire list and returns it
-# If varName does not exists an exception is raised
-proc ldindex {varName args} {
-    set varName [list $varName]
-    if {[llength $args] > 0} {
-        set idx [lindex $args 0]
-        set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
-        set badrange? 0
-        if {[string is integer -strict $idx]} {
-            if {$idx < 0 || $idx >= $size} {
-                set badrange? 1
-            }
-        } elseif {$idx eq "end"} {
-            if {$size == 0} {
-                set badrange? 1
-            }
-        } elseif {[string match end-* $idx] && [string is integer -strict [string range $idx 4 end]]} {
-            set i [expr $size - 1 - [string range $idx 4 end]]
-            if {$i < 0 || $i >= $size} {
-                set badrange? 1
-            }
-        } else {
-            error "bad index \"$idx\": must be integer or end?-integer?"
-        }
-        if {${badrange?}} {
-            error "list index out of range"
-        }
-    
-        if {[llength $args] > 1} {
-            set list [uplevel 1 [subst -nocommands {lindex [set $varName] $idx}]]
-            set item [eval ldindex list [lrange $args 1 end]]
-            uplevel 1 [subst {lset $varName $idx [list $list]}]
-        } else {
-            set item [uplevel 1 [subst -nocommands {lindex [set $varName] $idx}]]
-            uplevel 1 [subst -nocommands {set $varName [lreplace [set $varName] $idx $idx]}]
-        }
-    } else {
-        set item [uplevel 1 [subst {set $varName}]]
-        uplevel 1 [subst {set $varName {}}]
-    }
-    return $item
-}
-macports_util::method_wrap ldindex
-
-# lpop varName
-# Removes the last list element from a variable
-# If varName is an empty list an empty string is returned
-proc lpop {varName} {
-    set varName [list $varName]
-    set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
-    if {$size != 0} {
-        uplevel 1 [subst -nocommands {ldindex $varName end}]
-    }
-}
-macports_util::method_wrap lpop
-
-# lpush varName ?value ...?
-# Appends list elements onto a variable
-# If varName does not exist then it is created
-# really just an alias for lappend
-proc lpush {varName args} {
-    set varName [list $varName]
-    uplevel 1 [subst -nocommands {lappend $varName $args}]
-}
-macports_util::method_wrap lpush
-
-# lshift varName
-# Removes the first list element from a variable
-# If varName is an empty list an empty string is returned
-proc lshift {varName} {
-    set varName [list $varName]
-    set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
-    if {$size != 0} {
-        uplevel 1 [subst -nocommands {ldindex $varName 0}]
-    }
-}
-macports_util::method_wrap lshift
-
-# lunshift varName ?value ...?
-# Prepends list elements onto a variable
-# If varName does not exist then it is created
-proc lunshift {varName args} {
-    set varName [list $varName]
-    uplevel 1 [subst -nocommands {
-        if {![info exists $varName]} {
-            set $varName {}
-        }
-    }]
-    set value [concat $args [uplevel 1 set $varName]]
-    uplevel 1 set $varName [list $value]
-}
-macports_util::method_wrap lunshift
-
-################################
-# try/catch exception handling #
-################################
-# modelled after TIP #89 <http://www.tcl.tk/cgi-bin/tct/tip/89>
-
-if {![namespace exists ::_trycatch]} {
-    namespace eval ::_trycatch {
-        variable catchStack {}
-    }
-}
-
-# throw ?type? ?message? ?info?
-# Works like error, but arguments are reordered to encourage use of types
-# If called with no arguments in a catch block, re-throws the caught exception
-proc throw {args} {
-    if {[llength $args] == 0} {
-        # re-throw
-        if {[llength $::_trycatch::catchStack] == 0} {
-            return -code error "error: throw with no parameters outside of a catch"
-        } else {
-            set errorNode [lpop ::_trycatch::catchStack]
-            set errCode [lindex $errorNode 0]
-            set errMsg  [lindex $errorNode 1]
-            set errInfo [lindex $errorNode 2]
-            return -code error -errorinfo $errInfo -errorcode $errCode $errMsg
-        }
-    } elseif {[llength $args] > 3} {
-        return -code error "wrong # args: should be \"throw ?type? ?message? ?info?\""
-    } else {
-        set errCode [lindex $args 0]
-        if {[llength $args] > 1} {
-            set errMsg  [lindex $args 1]
-        } else {
-            set errMsg "error: $errCode"
-        }
-        if {[llength $args] > 2} {
-            set errInfo [lindex $args 2]
-        } else {
-            set errInfo $errMsg
-        }
-        return -code error -errorinfo $errInfo -errorcode $errCode $errMsg
-    }
-}
-
-# try body ?catch {type_list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?
-# implementation of try as specified in TIP #89
-proc try {args} {
-    # validate and interpret the arguments
-    set catchList {}
-    if {[llength $args] == 0} {
-        return -code error "wrong # args: \
-            should be \"try body ?catch {type-list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?\""
-    }
-    set body [lshift args]
-    while {[llength $args] > 0} {
-        set arg [lshift args]
-        switch $arg {
-            catch {
-                set elem [lshift args]
-                if {[llength $args] == 0 || [llength $elem] > 4} {
-                    return -code error "invalid syntax in catch clause: \
-                        should be \"catch {type-list ?ecvar? ?msgvar? ?infovar?} body\""
-                } elseif {[llength [lindex $elem 0 0]] == 0} {
-                    return -code error "invalid syntax in catch clause: type-list must contain at least one type"
-                }
-                lpush catchList $elem [lshift args]
-            }
-            finally {
-                if {[llength $args] == 0} {
-                    return -code error "invalid syntax in finally clause: should be \"finally body\""
-                } elseif {[llength $args] > 1} {
-                    return -code error "trailing args after finally clause"
-                }
-                set finallyBody [lshift args]
-            }
-            default {
-                return -code error "invalid syntax: \
-                    should be \"try body ?catch {type-list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?\""
-            }
-        }
-    }
-
-    # at this point, we've processed all args
-    if {[set err [catch {uplevel 1 $body} result]] == 1} {
-        set savedErrorCode $::errorCode
-        set savedErrorInfo $::errorInfo
-        # rip out the last "invoked from within" - we want to hide our internals
-        set savedErrorInfo [regsub -linestop {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$body"\Z} \
-                            $savedErrorInfo ""]
-        # add to the throw stack
-        lpush ::_trycatch::catchStack [list $savedErrorCode $result $savedErrorInfo]
-        # call the first matching catch block
-        foreach {elem catchBody} $catchList {
-            set typeList [lshift elem]
-            set match? 1
-            set typeList [lrange $typeList 0 [expr [llength $savedErrorCode] - 1]]
-            set codeList [lrange $savedErrorCode 0 [expr [llength $typeList] - 1]]
-            foreach type $typeList code $codeList {
-                if {![string match $type $code]} {
-                    set match? 0
-                    break
-                }
-            }
-            if {${match?}} {
-                # found a block
-                if {[set ecvar [lshift elem]] ne ""} {
-                    uplevel 1 set [list $ecvar] [list $savedErrorCode]
-                }
-                if {[set msgvar [lshift elem]] ne ""} {
-                    uplevel 1 set [list $msgvar] [list $result]
-                }
-                if {[set infovar [lshift elem]] ne ""} {
-                    uplevel 1 set [list $infovar] [list $savedErrorInfo]
-                }
-                if {[set err [catch {uplevel 1 $catchBody} result]] == 1} {
-                    # error in the catch block, save it
-                    set savedErrorCode $::errorCode
-                    set savedErrorInfo $::errorInfo
-                    # rip out the last "invoked from within" - we want to hide our internals
-                    set savedErrorInfo [regsub -linestop \
-                                        {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$catchBody"\Z} \
-                                        $savedErrorInfo ""]
-                    # also rip out an "invoked from within" for throw
-                    set savedErrorInfo [regsub -linestop \
-                                        {\n    invoked from within\n"throw"\Z} $savedErrorInfo ""]
-                }
-                break
-            }
-        }
-        # remove from the throw stack
-        lpop ::_trycatch::catchStack
-    }
-    # execute finally block
-    if {[info exists finallyBody]} {
-        # catch errors here so we can strip our uplevel
-        set savedErr $err
-        set savedResult $result
-        if {[set err [catch {uplevel 1 $finallyBody} result]] == 1} {
-            set savedErrorCode $::errorCode
-            set savedErrorInfo $::errorInfo
-            # rip out the last "invoked from within" - we want to hide our internals
-            set savedErrorInfo [regsub -linestop \
-                                {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$finallyBody"\Z} \
-                                $savedErrorInfo ""]
-        } elseif {$err == 0} {
-            set err $savedErr
-            set result $savedResult
-        }
-    }
-    # aaaand return
-    if {$err == 1} {
-        return -code $err -errorinfo $savedErrorInfo -errorcode $savedErrorCode $result
-    } else {
-        return -code $err $result
-    }
-}

Copied: trunk/base/src/macports1.0/macports_util.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/macports_util.tcl)
===================================================================
--- trunk/base/src/macports1.0/macports_util.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/macports_util.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,333 @@
+# macports.tcl
+# $Id$
+#
+# Copyright (c) 2007 Kevin Ballard <eridius at macports.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+package provide macports_util 1.0
+
+# Provide some global utilities
+
+namespace eval macports_util {
+    ###################
+    # Private methods #
+    ###################
+    proc method_wrap {name} {
+        variable argdefault
+    
+        set name [list $name]
+        # reconstruct the args list
+        set args [uplevel 1 [subst -nocommands {info args $name}]]
+        set arglist {}
+        foreach arg $args {
+            set argname [list $arg]
+            if {[uplevel 1 [subst -nocommands {info default $name $argname argdefault}]]} {
+                lappend arglist [list $arg $argdefault]
+            } else {
+                lappend arglist $arg
+            }
+        }
+        # modify the proc
+        set arglist [list $arglist]
+        set body [uplevel 1 [subst -nocommands {info body $name}]]
+        uplevel 1 [subst -nocommands {
+            proc $name $arglist {
+                if {[set err [catch {$body} result]] && [set err] != 2} {
+                    if {[set err] == 1} {
+                        return -code [set err] -errorcode [set ::errorCode] [set result]
+                    } else {
+                        return -code [set err] [set result]
+                    }
+                } else {
+                    return [set result]
+                }
+            }
+        }]
+    }
+}
+
+###################
+# List management #
+###################
+# It would be nice to have these written in C
+# That way we could avoid duplicating lists if they're not shared
+# but oh well
+
+# ldindex varName ?index...?
+# Removes the index'th list element from varName and returns it
+# If multiple indexes are provided, each one is a subindex into the
+# list element specified by the previous index
+# If no indexes are provided, deletes the entire list and returns it
+# If varName does not exists an exception is raised
+proc ldindex {varName args} {
+    set varName [list $varName]
+    if {[llength $args] > 0} {
+        set idx [lindex $args 0]
+        set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
+        set badrange? 0
+        if {[string is integer -strict $idx]} {
+            if {$idx < 0 || $idx >= $size} {
+                set badrange? 1
+            }
+        } elseif {$idx eq "end"} {
+            if {$size == 0} {
+                set badrange? 1
+            }
+        } elseif {[string match end-* $idx] && [string is integer -strict [string range $idx 4 end]]} {
+            set i [expr $size - 1 - [string range $idx 4 end]]
+            if {$i < 0 || $i >= $size} {
+                set badrange? 1
+            }
+        } else {
+            error "bad index \"$idx\": must be integer or end?-integer?"
+        }
+        if {${badrange?}} {
+            error "list index out of range"
+        }
+    
+        if {[llength $args] > 1} {
+            set list [uplevel 1 [subst -nocommands {lindex [set $varName] $idx}]]
+            set item [eval ldindex list [lrange $args 1 end]]
+            uplevel 1 [subst {lset $varName $idx [list $list]}]
+        } else {
+            set item [uplevel 1 [subst -nocommands {lindex [set $varName] $idx}]]
+            uplevel 1 [subst -nocommands {set $varName [lreplace [set $varName] $idx $idx]}]
+        }
+    } else {
+        set item [uplevel 1 [subst {set $varName}]]
+        uplevel 1 [subst {set $varName {}}]
+    }
+    return $item
+}
+macports_util::method_wrap ldindex
+
+# lpop varName
+# Removes the last list element from a variable
+# If varName is an empty list an empty string is returned
+proc lpop {varName} {
+    set varName [list $varName]
+    set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
+    if {$size != 0} {
+        uplevel 1 [subst -nocommands {ldindex $varName end}]
+    }
+}
+macports_util::method_wrap lpop
+
+# lpush varName ?value ...?
+# Appends list elements onto a variable
+# If varName does not exist then it is created
+# really just an alias for lappend
+proc lpush {varName args} {
+    set varName [list $varName]
+    uplevel 1 [subst -nocommands {lappend $varName $args}]
+}
+macports_util::method_wrap lpush
+
+# lshift varName
+# Removes the first list element from a variable
+# If varName is an empty list an empty string is returned
+proc lshift {varName} {
+    set varName [list $varName]
+    set size [uplevel 1 [subst -nocommands {llength [set $varName]}]]
+    if {$size != 0} {
+        uplevel 1 [subst -nocommands {ldindex $varName 0}]
+    }
+}
+macports_util::method_wrap lshift
+
+# lunshift varName ?value ...?
+# Prepends list elements onto a variable
+# If varName does not exist then it is created
+proc lunshift {varName args} {
+    set varName [list $varName]
+    uplevel 1 [subst -nocommands {
+        if {![info exists $varName]} {
+            set $varName {}
+        }
+    }]
+    set value [concat $args [uplevel 1 set $varName]]
+    uplevel 1 set $varName [list $value]
+}
+macports_util::method_wrap lunshift
+
+################################
+# try/catch exception handling #
+################################
+# modelled after TIP #89 <http://www.tcl.tk/cgi-bin/tct/tip/89>
+
+if {![namespace exists ::_trycatch]} {
+    namespace eval ::_trycatch {
+        variable catchStack {}
+    }
+}
+
+# throw ?type? ?message? ?info?
+# Works like error, but arguments are reordered to encourage use of types
+# If called with no arguments in a catch block, re-throws the caught exception
+proc throw {args} {
+    if {[llength $args] == 0} {
+        # re-throw
+        if {[llength $::_trycatch::catchStack] == 0} {
+            return -code error "error: throw with no parameters outside of a catch"
+        } else {
+            set errorNode [lpop ::_trycatch::catchStack]
+            set errCode [lindex $errorNode 0]
+            set errMsg  [lindex $errorNode 1]
+            set errInfo [lindex $errorNode 2]
+            return -code error -errorinfo $errInfo -errorcode $errCode $errMsg
+        }
+    } elseif {[llength $args] > 3} {
+        return -code error "wrong # args: should be \"throw ?type? ?message? ?info?\""
+    } else {
+        set errCode [lindex $args 0]
+        if {[llength $args] > 1} {
+            set errMsg  [lindex $args 1]
+        } else {
+            set errMsg "error: $errCode"
+        }
+        if {[llength $args] > 2} {
+            set errInfo [lindex $args 2]
+        } else {
+            set errInfo $errMsg
+        }
+        return -code error -errorinfo $errInfo -errorcode $errCode $errMsg
+    }
+}
+
+# try body ?catch {type_list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?
+# implementation of try as specified in TIP #89
+proc try {args} {
+    # validate and interpret the arguments
+    set catchList {}
+    if {[llength $args] == 0} {
+        return -code error "wrong # args: \
+            should be \"try body ?catch {type-list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?\""
+    }
+    set body [lshift args]
+    while {[llength $args] > 0} {
+        set arg [lshift args]
+        switch $arg {
+            catch {
+                set elem [lshift args]
+                if {[llength $args] == 0 || [llength $elem] > 4} {
+                    return -code error "invalid syntax in catch clause: \
+                        should be \"catch {type-list ?ecvar? ?msgvar? ?infovar?} body\""
+                } elseif {[llength [lindex $elem 0 0]] == 0} {
+                    return -code error "invalid syntax in catch clause: type-list must contain at least one type"
+                }
+                lpush catchList $elem [lshift args]
+            }
+            finally {
+                if {[llength $args] == 0} {
+                    return -code error "invalid syntax in finally clause: should be \"finally body\""
+                } elseif {[llength $args] > 1} {
+                    return -code error "trailing args after finally clause"
+                }
+                set finallyBody [lshift args]
+            }
+            default {
+                return -code error "invalid syntax: \
+                    should be \"try body ?catch {type-list ?ecvar? ?msgvar? ?infovar?} body ...? ?finally body?\""
+            }
+        }
+    }
+
+    # at this point, we've processed all args
+    if {[set err [catch {uplevel 1 $body} result]] == 1} {
+        set savedErrorCode $::errorCode
+        set savedErrorInfo $::errorInfo
+        # rip out the last "invoked from within" - we want to hide our internals
+        set savedErrorInfo [regsub -linestop {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$body"\Z} \
+                            $savedErrorInfo ""]
+        # add to the throw stack
+        lpush ::_trycatch::catchStack [list $savedErrorCode $result $savedErrorInfo]
+        # call the first matching catch block
+        foreach {elem catchBody} $catchList {
+            set typeList [lshift elem]
+            set match? 1
+            set typeList [lrange $typeList 0 [expr [llength $savedErrorCode] - 1]]
+            set codeList [lrange $savedErrorCode 0 [expr [llength $typeList] - 1]]
+            foreach type $typeList code $codeList {
+                if {![string match $type $code]} {
+                    set match? 0
+                    break
+                }
+            }
+            if {${match?}} {
+                # found a block
+                if {[set ecvar [lshift elem]] ne ""} {
+                    uplevel 1 set [list $ecvar] [list $savedErrorCode]
+                }
+                if {[set msgvar [lshift elem]] ne ""} {
+                    uplevel 1 set [list $msgvar] [list $result]
+                }
+                if {[set infovar [lshift elem]] ne ""} {
+                    uplevel 1 set [list $infovar] [list $savedErrorInfo]
+                }
+                if {[set err [catch {uplevel 1 $catchBody} result]] == 1} {
+                    # error in the catch block, save it
+                    set savedErrorCode $::errorCode
+                    set savedErrorInfo $::errorInfo
+                    # rip out the last "invoked from within" - we want to hide our internals
+                    set savedErrorInfo [regsub -linestop \
+                                        {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$catchBody"\Z} \
+                                        $savedErrorInfo ""]
+                    # also rip out an "invoked from within" for throw
+                    set savedErrorInfo [regsub -linestop \
+                                        {\n    invoked from within\n"throw"\Z} $savedErrorInfo ""]
+                }
+                break
+            }
+        }
+        # remove from the throw stack
+        lpop ::_trycatch::catchStack
+    }
+    # execute finally block
+    if {[info exists finallyBody]} {
+        # catch errors here so we can strip our uplevel
+        set savedErr $err
+        set savedResult $result
+        if {[set err [catch {uplevel 1 $finallyBody} result]] == 1} {
+            set savedErrorCode $::errorCode
+            set savedErrorInfo $::errorInfo
+            # rip out the last "invoked from within" - we want to hide our internals
+            set savedErrorInfo [regsub -linestop \
+                                {(\n    \(.*\))?\n    invoked from within\n"uplevel 1 \$finallyBody"\Z} \
+                                $savedErrorInfo ""]
+        } elseif {$err == 0} {
+            set err $savedErr
+            set result $savedResult
+        }
+    }
+    # aaaand return
+    if {$err == 1} {
+        return -code $err -errorinfo $savedErrorInfo -errorcode $savedErrorCode $result
+    } else {
+        return -code $err $result
+    }
+}

Deleted: trunk/base/src/macports1.0/options.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/options.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/options.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,127 +0,0 @@
-/*
- * options.h
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __OPTION_H__
-#define __OPTION_H__
-
-#include <sys/types.h>
-#include "util.h"
-
-/*
- * mp_options_t
- *
- * The mp_options_t type manages a collection of various options.
- * Each option has a type, either a string scalar, or an array
- * of strings.  Options may also have a default value.
- *
- * Each mp_options_t should be thought of as a single namespace
- * for options.
- *
- * All option names and option values should be UTF-8 strings.
- *
- */
-
-typedef struct {
-    u_int32_t type;
-    u_int32_t size;
-    union { 
-        void*     ptr;
-        char*     string;
-        u_int64_t integer;
-    } data;
-} mp_desc_t;
-
-void mp_desc_free(mp_desc_t d);
-    // uses free(3) on "array", "string", and "any" types
-    // also performs mp_desc_free() on elements of arrays
-void mp_desc_copy(mp_desc_t* dst, mp_desc_t* src);
-    // allocates any needed space with malloc(3)
-
-
-/* types */
-enum {
-    MP_TYPE_NULL = 0x0000,
-    MP_TYPE_DATA = 0x0001,	// binary data
-    MP_TYPE_UTF_8 = 0x0002,	// UTF-8 string
-    MP_TYPE_INT_64 = 0x0003,	// 64-bit integer
-    
-    MP_TYPE_ARRAY = 0x0100	// array of descriptors
-};
-
-/* option flags */
-enum {
-    MP_OPTIONS_FLAG_IMMUTABLE = 0x10000
-};
-
-typedef void* mp_options_t;
-
-
-/* result codes */
-enum {
-    MP_OPTIONS_SUCCESS = 0,
-
-    MP_OPTIONS_ERROR_UNDEFINED = -1,
-        // the specified option has not been declared
-
-    MP_OPTIONS_ERROR_WRONG_TYPE = -10,
-        // array operation requested on a string type
-        // type differs from previous declaration
-    
-    MP_OPTIONS_ERROR_WRONG_DEFAULT = -11,
-        // default differs from previous declaration
-
-    MP_OPTIONS_ERROR_IMMUTABLE = -12,
-        // could not set the value, the option is immutable
-        
-    MP_OPTIONS_ERROR_LAST
-};
-
-mp_options_t mp_options_create();
-mp_options_t mp_options_retain(mp_options_t);
-void mp_options_release(mp_options_t);
-
-int mp_options_declare(mp_options_t o, char* name, int flags, mp_desc_t* default_value);
-    // will copy default_value internally
-
-int mp_options_set_value(mp_options_t o, char* name, mp_desc_t* new_value);
-    // will copy new_value internally
-
-int mp_options_get_value(mp_options_t o, char* name, mp_desc_t* out_value);
-    // free out_value with mp_desc_free();
-
-int mp_options_set_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* new_value);
-    // will copy new_value internally
-
-int mp_options_get_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* out_value);
-    // free out_value with mp_desc_free();
-
-#endif /* __OPTION_H__ */

Copied: trunk/base/src/macports1.0/options.h (from rev 26176, branches/dp2mp-move/base/src/macports1.0/options.h)
===================================================================
--- trunk/base/src/macports1.0/options.h	                        (rev 0)
+++ trunk/base/src/macports1.0/options.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,127 @@
+/*
+ * options.h
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __OPTION_H__
+#define __OPTION_H__
+
+#include <sys/types.h>
+#include "util.h"
+
+/*
+ * mp_options_t
+ *
+ * The mp_options_t type manages a collection of various options.
+ * Each option has a type, either a string scalar, or an array
+ * of strings.  Options may also have a default value.
+ *
+ * Each mp_options_t should be thought of as a single namespace
+ * for options.
+ *
+ * All option names and option values should be UTF-8 strings.
+ *
+ */
+
+typedef struct {
+    u_int32_t type;
+    u_int32_t size;
+    union { 
+        void*     ptr;
+        char*     string;
+        u_int64_t integer;
+    } data;
+} mp_desc_t;
+
+void mp_desc_free(mp_desc_t d);
+    // uses free(3) on "array", "string", and "any" types
+    // also performs mp_desc_free() on elements of arrays
+void mp_desc_copy(mp_desc_t* dst, mp_desc_t* src);
+    // allocates any needed space with malloc(3)
+
+
+/* types */
+enum {
+    MP_TYPE_NULL = 0x0000,
+    MP_TYPE_DATA = 0x0001,	// binary data
+    MP_TYPE_UTF_8 = 0x0002,	// UTF-8 string
+    MP_TYPE_INT_64 = 0x0003,	// 64-bit integer
+    
+    MP_TYPE_ARRAY = 0x0100	// array of descriptors
+};
+
+/* option flags */
+enum {
+    MP_OPTIONS_FLAG_IMMUTABLE = 0x10000
+};
+
+typedef void* mp_options_t;
+
+
+/* result codes */
+enum {
+    MP_OPTIONS_SUCCESS = 0,
+
+    MP_OPTIONS_ERROR_UNDEFINED = -1,
+        // the specified option has not been declared
+
+    MP_OPTIONS_ERROR_WRONG_TYPE = -10,
+        // array operation requested on a string type
+        // type differs from previous declaration
+    
+    MP_OPTIONS_ERROR_WRONG_DEFAULT = -11,
+        // default differs from previous declaration
+
+    MP_OPTIONS_ERROR_IMMUTABLE = -12,
+        // could not set the value, the option is immutable
+        
+    MP_OPTIONS_ERROR_LAST
+};
+
+mp_options_t mp_options_create();
+mp_options_t mp_options_retain(mp_options_t);
+void mp_options_release(mp_options_t);
+
+int mp_options_declare(mp_options_t o, char* name, int flags, mp_desc_t* default_value);
+    // will copy default_value internally
+
+int mp_options_set_value(mp_options_t o, char* name, mp_desc_t* new_value);
+    // will copy new_value internally
+
+int mp_options_get_value(mp_options_t o, char* name, mp_desc_t* out_value);
+    // free out_value with mp_desc_free();
+
+int mp_options_set_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* new_value);
+    // will copy new_value internally
+
+int mp_options_get_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* out_value);
+    // free out_value with mp_desc_free();
+
+#endif /* __OPTION_H__ */

Deleted: trunk/base/src/macports1.0/portconf.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/portconf.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/portconf.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,62 +0,0 @@
-/*
- * portconf.c
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "macports.h"
-
-#include <tcl.h>
-
-static int set_session_option(ClientData clientData UNUSED, Tcl_Interp *interp UNUSED, int objc UNUSED, Tcl_Obj *CONST objv[] UNUSED) {
-    return TCL_OK;
-}
-
-void parse_port_conf(mp_session_t mp UNUSED, char* path) {
-    int fd = open(path, O_RDONLY, 0);
-    if (fd != -1) {
-        Tcl_Interp* interp = Tcl_CreateInterp();
-        char* bootstrap_options[] = {"portdbpath", "libpath", "binpath", "master_site_local",
-				     "auto_path", "sources_conf", "prefix", NULL};
-        char** option = bootstrap_options;
-        while (*option != NULL) {
-            Tcl_CreateObjCommand(interp, *option, &set_session_option, NULL, NULL);
-            ++option;
-        }
-        /* XXX: parse config file */
-    }
-}

Copied: trunk/base/src/macports1.0/portconf.c (from rev 26176, branches/dp2mp-move/base/src/macports1.0/portconf.c)
===================================================================
--- trunk/base/src/macports1.0/portconf.c	                        (rev 0)
+++ trunk/base/src/macports1.0/portconf.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,62 @@
+/*
+ * portconf.c
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "macports.h"
+
+#include <tcl.h>
+
+static int set_session_option(ClientData clientData UNUSED, Tcl_Interp *interp UNUSED, int objc UNUSED, Tcl_Obj *CONST objv[] UNUSED) {
+    return TCL_OK;
+}
+
+void parse_port_conf(mp_session_t mp UNUSED, char* path) {
+    int fd = open(path, O_RDONLY, 0);
+    if (fd != -1) {
+        Tcl_Interp* interp = Tcl_CreateInterp();
+        char* bootstrap_options[] = {"portdbpath", "libpath", "binpath", "master_site_local",
+				     "auto_path", "sources_conf", "prefix", NULL};
+        char** option = bootstrap_options;
+        while (*option != NULL) {
+            Tcl_CreateObjCommand(interp, *option, &set_session_option, NULL, NULL);
+            ++option;
+        }
+        /* XXX: parse config file */
+    }
+}

Deleted: trunk/base/src/macports1.0/session.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/session.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/session.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,113 +0,0 @@
-/*
- * session.c
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/param.h>
-
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-
-#include "macports.h"
-
-#include <tcl.h>
-
-/*
- *
- * mp_session_t
- *
- */
-struct session {
-    char* portdbpath;
-    char* portconf;
-    char* sources_conf;
-    mp_array_t sources;
-    char* portsharepath;
-    char* registry_path;
-};
-
-mp_session_t mp_session_open() {
-    struct session* mp = malloc(sizeof(struct session));
-    char* path;
-    /* mp_array_t conf_files = mp_array_create(); */
-    
-    mp->portconf = NULL;
-    
-    /* first look at PORTSRC for testing/debugging */
-    path = getenv("PORTSRC");
-    if (path != NULL && access(path, R_OK) == 0) {
-        mp->portconf = strdup(path);
-        /* mp_array_append(conf_files, mp->portconf); */
-    }
-
-    /* then look in ~/.macports/macports.conf */
-    if (mp->portconf == NULL) {
-        char* home = getenv("HOME");
-        if (home != NULL) {
-            char path[PATH_MAX];
-            snprintf(path, sizeof(path), "%s/.macports/macports.conf", home);
-            if (access(path, R_OK) == 0) {
-                mp->portconf = strdup(path);
-                /* mp_array_append(conf_files, mp->portconf); */
-            }
-        }
-    }
-
-    /* finally ${prefix}/etc/macports/macports.conf, or whatever path was configured */
-    if (mp->portconf == NULL) {
-      /* XXX: honor autoconf setting ($macports_conf_path) */
-        char* path = "${prefix}/etc/macports/macports.conf";
-        if (access(path, R_OK) == 0) {
-            mp->portconf = strdup(path);
-            /* mp_array_append(conf_files, mp->portconf); */
-        }
-    }
-    
-    /* foreach conf_files */
-    {
-        int fd = open(mp->portconf, O_RDONLY, 0);
-        if (fd != -1) {
-	  /* XXX: parse config file */
-        }
-    }
-    
-    if (mp->sources_conf == NULL) {
-        fprintf(stderr, "sources_conf must be set in ${prefix}/etc/macports/macports.conf or in your ~/.macports/macports.conf file\n");
-    }
-    return (mp_session_t)mp;
-}
-

Copied: trunk/base/src/macports1.0/session.c (from rev 26176, branches/dp2mp-move/base/src/macports1.0/session.c)
===================================================================
--- trunk/base/src/macports1.0/session.c	                        (rev 0)
+++ trunk/base/src/macports1.0/session.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,113 @@
+/*
+ * session.c
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/param.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+
+#include "macports.h"
+
+#include <tcl.h>
+
+/*
+ *
+ * mp_session_t
+ *
+ */
+struct session {
+    char* portdbpath;
+    char* portconf;
+    char* sources_conf;
+    mp_array_t sources;
+    char* portsharepath;
+    char* registry_path;
+};
+
+mp_session_t mp_session_open() {
+    struct session* mp = malloc(sizeof(struct session));
+    char* path;
+    /* mp_array_t conf_files = mp_array_create(); */
+    
+    mp->portconf = NULL;
+    
+    /* first look at PORTSRC for testing/debugging */
+    path = getenv("PORTSRC");
+    if (path != NULL && access(path, R_OK) == 0) {
+        mp->portconf = strdup(path);
+        /* mp_array_append(conf_files, mp->portconf); */
+    }
+
+    /* then look in ~/.macports/macports.conf */
+    if (mp->portconf == NULL) {
+        char* home = getenv("HOME");
+        if (home != NULL) {
+            char path[PATH_MAX];
+            snprintf(path, sizeof(path), "%s/.macports/macports.conf", home);
+            if (access(path, R_OK) == 0) {
+                mp->portconf = strdup(path);
+                /* mp_array_append(conf_files, mp->portconf); */
+            }
+        }
+    }
+
+    /* finally ${prefix}/etc/macports/macports.conf, or whatever path was configured */
+    if (mp->portconf == NULL) {
+      /* XXX: honor autoconf setting ($macports_conf_path) */
+        char* path = "${prefix}/etc/macports/macports.conf";
+        if (access(path, R_OK) == 0) {
+            mp->portconf = strdup(path);
+            /* mp_array_append(conf_files, mp->portconf); */
+        }
+    }
+    
+    /* foreach conf_files */
+    {
+        int fd = open(mp->portconf, O_RDONLY, 0);
+        if (fd != -1) {
+	  /* XXX: parse config file */
+        }
+    }
+    
+    if (mp->sources_conf == NULL) {
+        fprintf(stderr, "sources_conf must be set in ${prefix}/etc/macports/macports.conf or in your ~/.macports/macports.conf file\n");
+    }
+    return (mp_session_t)mp;
+}
+

Deleted: trunk/base/src/macports1.0/session.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/session.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/session.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,38 +0,0 @@
-/*
- * session.h
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __SESSION_H__
-#define __SESSION_H__
-
-
-
-#endif /* __SESSION_H__ */

Copied: trunk/base/src/macports1.0/session.h (from rev 26176, branches/dp2mp-move/base/src/macports1.0/session.h)
===================================================================
--- trunk/base/src/macports1.0/session.h	                        (rev 0)
+++ trunk/base/src/macports1.0/session.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,38 @@
+/*
+ * session.h
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __SESSION_H__
+#define __SESSION_H__
+
+
+
+#endif /* __SESSION_H__ */

Deleted: trunk/base/src/macports1.0/test_util.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/test_util.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/test_util.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,476 +0,0 @@
-# test_util.tcl
-# $Id$
-#
-# Comprehensive test file for macports_util.tcl
-# Written by Kevin Ballard <eridius at macports.org>
-
-source ./macports_util.tcl
-
-array set options {t 0 w 0}
-
-set ::traceNest ""
-set ::traceSquelch 0
-set ::traceSquelchNest ""
-proc dotrace {args} {
-    global traceNest options
-    flush stdout
-    set command [lindex $args 0]
-    if {$options(w) > 0} {
-        # trim command to 1 line
-        if {[llength [set lines [split $command "\n"]]] > 1} {
-            set command "[lindex $lines 0] [ansi fg-blue]...[ansi reset]"
-        }
-    }
-    set op [lindex $args end]
-    switch $op {
-        enter { append traceNest "#" }
-        enterstep { append traceNest "+" }
-    }
-    switch $op {
-        enter {
-            puts stderr "[ansi fg-yellow inverse]$traceNest>[ansi reset] $command"
-            set ::traceSquelch 0
-        }
-        enterstep {
-            if {!$::traceSquelch} {
-                puts stderr "[ansi fg-yellow]$traceNest>[ansi reset] $command"
-                if {[llength [info procs [lindex [split $command] 0]]] > 0} {
-                    # it's a proc, lets start squelching
-                    set ::traceSquelch 1
-                    set ::traceSquelchNest $::traceNest
-                }
-            }
-        }
-        leave -
-        leavestep {
-            if {$op eq "leavestep" && $::traceSquelch && $::traceNest eq $::traceSquelchNest} {
-                set ::traceSquelch 0
-            }
-            if {$op eq "leave" || !$::traceSquelch} {
-                set code [lindex $args 1]
-                set result [lindex $args 2]
-                if {$options(w) > 0} {
-                    # trim result just like command
-                    if {[llength [set lines [split $result "\n"]]] > 1} {
-                        set result "[lindex $lines 0] [ansi fg-blue]...[ansi reset]"
-                    }
-                }
-                if {$op eq "leave"} {
-                    set prefix "[ansi fg-blue inverse]$traceNest"
-                } else {
-                    set prefix "[ansi fg-blue]$traceNest"
-                }
-                if {$code != 0} {
-                    puts stderr "$prefix =\[$code\]>[ansi reset] $result"
-                } else {
-                    puts stderr "$prefix =>[ansi reset] $result"
-                }
-            }
-        }
-    }
-    switch $op {
-        leave -
-        leavestep {
-            set traceNest [string range $traceNest 0 end-1]
-        }
-    }
-}
-while {[llength $argv] > 0} {
-    set arg [lshift argv]
-    if {$arg eq "--"} {
-        break
-    } elseif {[string match -* $arg]} {
-        set arg [string range $arg 1 end]
-        while {[string length $arg] > 0} {
-            set opt [string index $arg 0]
-            set arg [string range $arg 1 end]
-            switch $opt {
-                t { incr options(t) }
-                w { incr options(w) }
-                default {
-                    error "Unknown option: -$opt"
-                }
-            }
-        }
-    } else {
-        lunshift argv $arg
-        break
-    }
-}
-if {$options(t) > 0} {
-    set ops {enter leave}
-    if {$options(t) > 1} {
-        lappend ops enterstep leavestep
-    }
-    set util_list {ldindex lpop lpush lshift lunshift try throw}
-    if {[llength $argv] > 0} {
-        set list $argv
-        if {[set idx [lsearch -exact $list *]] != -1} {
-            set list [eval lreplace [list $list] $idx $idx $util_list]
-        }
-    } else {
-        set list $util_list
-    }
-    foreach arg $list {
-        trace add execution $arg $ops dotrace
-    }
-}
-
-proc init {name value} {
-    set name [list $name]
-    set value [list $value]
-    uplevel 1 [subst -nocommands {
-        set $name $value
-        set $name-bak [set $name]
-    }]
-}
-
-proc restore {name} {
-    set name [list $name]
-    uplevel 1 [subst -nocommands {
-        if {[info exists $name-bak]} {
-            set $name [set $name-bak]
-        } else {
-            unset $name
-        }
-    }]
-}
-
-array set kStateToAnsiTable {
-    error fg-magenta
-    expected fg-cyan
-    correct fg-green
-    wrong fg-red
-}
-
-array set kAnsiTable {
-    reset           0
-    
-    bold            1
-    dim             2
-    underline       4
-    blink           5
-    inverse         7
-    hidden          8
-    
-    fg-black        30
-    fg-red          31
-    fg-green        32
-    fg-yellow       33
-    fg-blue         34
-    fg-magenta      35
-    fg-cyan         36
-    fg-white        37
-    fg-default      39
-    
-    bg-black        40
-    bg-red          41
-    bg-green        42
-    bg-yellow       43
-    bg-blue         44
-    bg-magenta      45
-    bg-cyan         46
-    bg-white        47
-    bg-default      49
-}
-
-proc ansi {args} {
-    global kAnsiTable
-    if {[llength $args] == 0} {
-        error "wrong # args: should be \"ansi code ...\""
-    }
-    set colors {}
-    foreach code $args {
-        lappend colors $kAnsiTable($code)
-    }
-    return "\033\[[join $colors ";"]m"
-}
-
-proc state {code} {
-    global kStateToAnsiTable
-    return [ansi $kStateToAnsiTable($code)]
-}
-
-proc line {cmd expected args} {
-    uplevel 1 [list block $cmd $cmd $expected] $args
-}
-
-proc block {name cmd expected args} {
-    if {[set err [catch {uplevel 1 $cmd} value]]} {
-        set savedErrorInfo $::errorInfo
-        set savedErrorCode $::errorCode
-        if {$expected eq "-error" && $err == 1} {
-            if {[llength $args] > 0} {
-                set errCode [lindex $args 0]
-                if {$errCode == $savedErrorCode} {
-                    if {[llength $args] > 1} {
-                        set errMsg [lindex $args 1]
-                        if {$errMsg == $value} {
-                            set code expected
-                        } else {
-                            set code error
-                        }
-                    } else {
-                        set code expected
-                    }
-                } else {
-                    set code error
-                }
-            } else {
-                set code expected
-            }
-        } elseif {$expected eq "-return" && $err == 2} {
-            if {[llength $args] > 0} {
-                set errMsg [lindex $args 0]
-                if {$errMsg == $value} {
-                    set code expected
-                } else {
-                    set code error
-                }
-            } else {
-                set code expected
-            }
-        } elseif {$expected eq "-break" && $err == 3} {
-            set code expected
-        } else {
-            set code error
-        }
-    } elseif {$value == $expected} {
-        set code correct
-    } else {
-        set code wrong
-    }
-    if {$code eq "error"} {
-        append value "\n$savedErrorInfo"
-    }
-    puts "[state $code]$name =[if {$err != 0} {format \[$err\]}]> $value[ansi reset]"
-}
-
-proc var {name expected} {
-    set exists [uplevel 1 info exists [list $name]]
-    if {!$exists} {
-        set value "does not exist"
-        if {$expected eq "-unset"} {
-            set code expected
-        } else {
-            set code error
-        }
-    } else {
-        set value [uplevel 1 set [list $name]]
-        if {$value == $expected} {
-            set code correct
-        } else {
-            set code wrong
-        }
-    }
-    puts "[state $code]$name: $value[ansi reset]"
-}
-
-if {[set err [catch {
-    namespace eval test {
-        namespace eval vars {}
-        init vars::ary(one) {1 2 {3 4}}
-        init vars::ary(zero) {1 {2 3 {"4 5" 6} 7} 8 9}
-        
-        var vars::ary(zero) {1 {2 3 {"4 5" 6} 7} 8 9}
-        line {ldindex vars::ary(zero) 1 2 0} {4 5}
-        var vars::ary(zero) {1 {2 3 6 7} 8 9}
-        line {ldindex vars::ary(zero) 1 1 0} 3
-        var vars::ary(zero) {1 {2 {} 6 7} 8 9}
-        line {ldindex vars::ary(zero) 1 2} 6
-        var vars::ary(zero) {1 {2 {} 7} 8 9}
-        line {ldindex vars::ary(zero) 1} {2 {} 7}
-        var vars::ary(zero) {1 8 9}
-        line {ldindex vars::ary(zero)} {1 8 9}
-        var vars::ary(zero) {}
-        
-        var vars::ary(one) {1 2 {3 4}}
-        line {lpop vars::ary(one)} {3 4}
-        var vars::ary(one) {1 2}
-        line {lpop vars::ary(one)} 2
-        var vars::ary(one) 1
-        line {lpop vars::ary(one)} 1
-        var vars::ary(one) {}
-        line {lpop vars::ary(one)} {}
-        var vars::ary(one) {}
-        
-        line {lpop vars::foo} -error NONE {can't read "vars::foo": no such variable}
-        
-        restore vars::ary(one)
-        var vars::ary(one) {1 2 {3 4}}
-        line {lshift vars::ary(one)} 1
-        var vars::ary(one) {2 {3 4}}
-        line {lshift vars::ary(one)} 2
-        var vars::ary(one) {{3 4}}
-        line {lshift vars::ary(one)} {3 4}
-        var vars::ary(one) {}
-        line {lshift vars::ary(one)} {}
-        var vars::ary(one) {}
-        
-        line {lshift vars::foo} -error NONE {can't read "vars::foo": no such variable}
-        
-        var vars::ary(two) -unset
-        line {lpush vars::ary(two) 1} 1
-        var vars::ary(two) 1
-        line {lpush vars::ary(two) 2 3 4 5} {1 2 3 4 5}
-        var vars::ary(two) {1 2 3 4 5}
-        line {lpush vars::ary(two) "this is a test"} {1 2 3 4 5 {this is a test}}
-        var vars::ary(two) {1 2 3 4 5 {this is a test}}
-        line {lpop vars::ary(two)} {this is a test}
-        var vars::ary(two) {1 2 3 4 5}
-        
-        line {lpush "foo bar" 3} {3}
-        var {foo bar} 3
-        
-        restore vars::ary(two)
-        var vars::ary(two) -unset
-        line {lunshift vars::ary(two) 5} 5
-        var vars::ary(two) 5
-        line {lunshift vars::ary(two) 4} {4 5}
-        var vars::ary(two) {4 5}
-        line {lunshift vars::ary(two) 1 2 3} {1 2 3 4 5}
-        var vars::ary(two) {1 2 3 4 5}
-        line {lunshift vars::ary(two) "this is a test"} {{this is a test} 1 2 3 4 5}
-        var vars::ary(two) {{this is a test} 1 2 3 4 5}
-        line {lshift vars::ary(two)} {this is a test}
-        var vars::ary(two) {1 2 3 4 5}
-        
-        # now test the try/throw stuff
-        line {throw} -error NONE {error: throw with no parameters outside of a catch}
-        line {throw 1 2 3 4} -error NONE {wrong # args: should be "throw ?type? ?message? ?info?"}
-        line {try {format 3} catch {} {}} -error NONE {invalid syntax in catch clause: type-list must contain at least one type}
-        line {try {format 3} finally {format 4} test} -error NONE {trailing args after finally clause}
-        block {basic try} {
-            try {
-                error "random error"
-            }
-        } -error NONE "random error"
-        block {try-finally} {
-            try {
-                error "try-finally error"
-            } finally {
-                set myVar "finally clause worked"
-            }
-        } -error NONE "try-finally error"
-        var myVar "finally clause worked"
-        block {try-finally-error} {
-            try {
-                error "try-finally error"
-            } finally {
-                error "finally error"
-            }
-        } -error NONE "finally error"
-        block {try-catch} {
-            try {
-                error "try-catch error"
-            } catch NONE {
-                format "catch clause worked"
-            }
-        } "catch clause worked"
-        block {try-catch-throw} {
-            try {
-                error "try-catch error"
-            } catch NONE {
-                set myVar "thrown"
-                throw
-            }
-        } -error NONE "try-catch error" ;# really should test errorInfo but that's messy
-        var myVar "thrown"
-        unset myVar
-        block {try-catch-finally} {
-            try {
-                error "try-catch-finally error"
-            } catch NONE {
-                set myVar "thrown"
-                throw
-            } finally {
-                lappend myVar "finally"
-            }
-        } -error NONE "try-catch-finally error"
-        var myVar "thrown finally"
-        block {try-catch-all} {
-            try {
-                error "this is a test"
-            } catch * {
-                format "catch-all worked"
-            }
-        } "catch-all worked"
-        block {try-catch-return} {
-            try {
-                error "this is a test"
-            } catch * {
-                return "catch-return worked"
-            }
-        } -return "catch-return worked"
-        block {try-catch-break} {
-            try {
-                error "this is a test"
-            } catch * {
-                break
-            }
-        } -break
-        block {try-catch-multiple} {
-            try {
-                error "this is a test"
-            } catch POSIX {
-                error "POSIX catch"
-            } catch * {
-                format "catch-all"
-            }
-        } "catch-all"
-        unset myVar
-        block {try-catch-multiple-finally} {
-            try {
-                error "this is a test"
-            } catch * {
-                lappend myVar "catch-all 1"
-            } catch * {
-                lappend myVar "catch-all 2"
-            } finally {
-                lappend myVar "finally"
-            }
-        } [list {catch-all 1}]
-        var myVar [list "catch-all 1" "finally"]
-        block {try-catch-types} {
-            try {
-                error "try-catch-types error" {} {MYERR arg1 arg2}
-            } catch POSIX {
-                error "POSIX catch"
-            } catch {{MY* arg*} code} {
-                format "caught code $code"
-            }
-        } "caught code MYERR arg1 arg2"
-        block {try-catch-vars} {
-            try {
-                error "random error"
-            } catch {* code msg info} {
-                set list {}
-                if {$code eq "NONE"} {
-                    lappend list "code: correct"
-                }
-                if {$msg eq "random error"} {
-                    lappend list "msg: correct"
-                }
-                if {[string match "random error\n*" $info]} {
-                    lappend list "info: probably correct"
-                }
-                join $list ", "
-            }
-        } "code: correct, msg: correct, info: probably correct"
-        block {try-break-catch} {
-            try {
-                break
-            } catch {*} {
-                error "catch triggered"
-            }
-        } -break
-        
-        # ensure the stack is sound
-        var ::_trycatch::catchStack {}
-    }
-} result]]} {
-    puts ""
-    puts "error: $result"
-    puts "code: $err"
-    puts $::errorInfo
-}

Copied: trunk/base/src/macports1.0/test_util.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/test_util.tcl)
===================================================================
--- trunk/base/src/macports1.0/test_util.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/test_util.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,476 @@
+# test_util.tcl
+# $Id$
+#
+# Comprehensive test file for macports_util.tcl
+# Written by Kevin Ballard <eridius at macports.org>
+
+source ./macports_util.tcl
+
+array set options {t 0 w 0}
+
+set ::traceNest ""
+set ::traceSquelch 0
+set ::traceSquelchNest ""
+proc dotrace {args} {
+    global traceNest options
+    flush stdout
+    set command [lindex $args 0]
+    if {$options(w) > 0} {
+        # trim command to 1 line
+        if {[llength [set lines [split $command "\n"]]] > 1} {
+            set command "[lindex $lines 0] [ansi fg-blue]...[ansi reset]"
+        }
+    }
+    set op [lindex $args end]
+    switch $op {
+        enter { append traceNest "#" }
+        enterstep { append traceNest "+" }
+    }
+    switch $op {
+        enter {
+            puts stderr "[ansi fg-yellow inverse]$traceNest>[ansi reset] $command"
+            set ::traceSquelch 0
+        }
+        enterstep {
+            if {!$::traceSquelch} {
+                puts stderr "[ansi fg-yellow]$traceNest>[ansi reset] $command"
+                if {[llength [info procs [lindex [split $command] 0]]] > 0} {
+                    # it's a proc, lets start squelching
+                    set ::traceSquelch 1
+                    set ::traceSquelchNest $::traceNest
+                }
+            }
+        }
+        leave -
+        leavestep {
+            if {$op eq "leavestep" && $::traceSquelch && $::traceNest eq $::traceSquelchNest} {
+                set ::traceSquelch 0
+            }
+            if {$op eq "leave" || !$::traceSquelch} {
+                set code [lindex $args 1]
+                set result [lindex $args 2]
+                if {$options(w) > 0} {
+                    # trim result just like command
+                    if {[llength [set lines [split $result "\n"]]] > 1} {
+                        set result "[lindex $lines 0] [ansi fg-blue]...[ansi reset]"
+                    }
+                }
+                if {$op eq "leave"} {
+                    set prefix "[ansi fg-blue inverse]$traceNest"
+                } else {
+                    set prefix "[ansi fg-blue]$traceNest"
+                }
+                if {$code != 0} {
+                    puts stderr "$prefix =\[$code\]>[ansi reset] $result"
+                } else {
+                    puts stderr "$prefix =>[ansi reset] $result"
+                }
+            }
+        }
+    }
+    switch $op {
+        leave -
+        leavestep {
+            set traceNest [string range $traceNest 0 end-1]
+        }
+    }
+}
+while {[llength $argv] > 0} {
+    set arg [lshift argv]
+    if {$arg eq "--"} {
+        break
+    } elseif {[string match -* $arg]} {
+        set arg [string range $arg 1 end]
+        while {[string length $arg] > 0} {
+            set opt [string index $arg 0]
+            set arg [string range $arg 1 end]
+            switch $opt {
+                t { incr options(t) }
+                w { incr options(w) }
+                default {
+                    error "Unknown option: -$opt"
+                }
+            }
+        }
+    } else {
+        lunshift argv $arg
+        break
+    }
+}
+if {$options(t) > 0} {
+    set ops {enter leave}
+    if {$options(t) > 1} {
+        lappend ops enterstep leavestep
+    }
+    set util_list {ldindex lpop lpush lshift lunshift try throw}
+    if {[llength $argv] > 0} {
+        set list $argv
+        if {[set idx [lsearch -exact $list *]] != -1} {
+            set list [eval lreplace [list $list] $idx $idx $util_list]
+        }
+    } else {
+        set list $util_list
+    }
+    foreach arg $list {
+        trace add execution $arg $ops dotrace
+    }
+}
+
+proc init {name value} {
+    set name [list $name]
+    set value [list $value]
+    uplevel 1 [subst -nocommands {
+        set $name $value
+        set $name-bak [set $name]
+    }]
+}
+
+proc restore {name} {
+    set name [list $name]
+    uplevel 1 [subst -nocommands {
+        if {[info exists $name-bak]} {
+            set $name [set $name-bak]
+        } else {
+            unset $name
+        }
+    }]
+}
+
+array set kStateToAnsiTable {
+    error fg-magenta
+    expected fg-cyan
+    correct fg-green
+    wrong fg-red
+}
+
+array set kAnsiTable {
+    reset           0
+    
+    bold            1
+    dim             2
+    underline       4
+    blink           5
+    inverse         7
+    hidden          8
+    
+    fg-black        30
+    fg-red          31
+    fg-green        32
+    fg-yellow       33
+    fg-blue         34
+    fg-magenta      35
+    fg-cyan         36
+    fg-white        37
+    fg-default      39
+    
+    bg-black        40
+    bg-red          41
+    bg-green        42
+    bg-yellow       43
+    bg-blue         44
+    bg-magenta      45
+    bg-cyan         46
+    bg-white        47
+    bg-default      49
+}
+
+proc ansi {args} {
+    global kAnsiTable
+    if {[llength $args] == 0} {
+        error "wrong # args: should be \"ansi code ...\""
+    }
+    set colors {}
+    foreach code $args {
+        lappend colors $kAnsiTable($code)
+    }
+    return "\033\[[join $colors ";"]m"
+}
+
+proc state {code} {
+    global kStateToAnsiTable
+    return [ansi $kStateToAnsiTable($code)]
+}
+
+proc line {cmd expected args} {
+    uplevel 1 [list block $cmd $cmd $expected] $args
+}
+
+proc block {name cmd expected args} {
+    if {[set err [catch {uplevel 1 $cmd} value]]} {
+        set savedErrorInfo $::errorInfo
+        set savedErrorCode $::errorCode
+        if {$expected eq "-error" && $err == 1} {
+            if {[llength $args] > 0} {
+                set errCode [lindex $args 0]
+                if {$errCode == $savedErrorCode} {
+                    if {[llength $args] > 1} {
+                        set errMsg [lindex $args 1]
+                        if {$errMsg == $value} {
+                            set code expected
+                        } else {
+                            set code error
+                        }
+                    } else {
+                        set code expected
+                    }
+                } else {
+                    set code error
+                }
+            } else {
+                set code expected
+            }
+        } elseif {$expected eq "-return" && $err == 2} {
+            if {[llength $args] > 0} {
+                set errMsg [lindex $args 0]
+                if {$errMsg == $value} {
+                    set code expected
+                } else {
+                    set code error
+                }
+            } else {
+                set code expected
+            }
+        } elseif {$expected eq "-break" && $err == 3} {
+            set code expected
+        } else {
+            set code error
+        }
+    } elseif {$value == $expected} {
+        set code correct
+    } else {
+        set code wrong
+    }
+    if {$code eq "error"} {
+        append value "\n$savedErrorInfo"
+    }
+    puts "[state $code]$name =[if {$err != 0} {format \[$err\]}]> $value[ansi reset]"
+}
+
+proc var {name expected} {
+    set exists [uplevel 1 info exists [list $name]]
+    if {!$exists} {
+        set value "does not exist"
+        if {$expected eq "-unset"} {
+            set code expected
+        } else {
+            set code error
+        }
+    } else {
+        set value [uplevel 1 set [list $name]]
+        if {$value == $expected} {
+            set code correct
+        } else {
+            set code wrong
+        }
+    }
+    puts "[state $code]$name: $value[ansi reset]"
+}
+
+if {[set err [catch {
+    namespace eval test {
+        namespace eval vars {}
+        init vars::ary(one) {1 2 {3 4}}
+        init vars::ary(zero) {1 {2 3 {"4 5" 6} 7} 8 9}
+        
+        var vars::ary(zero) {1 {2 3 {"4 5" 6} 7} 8 9}
+        line {ldindex vars::ary(zero) 1 2 0} {4 5}
+        var vars::ary(zero) {1 {2 3 6 7} 8 9}
+        line {ldindex vars::ary(zero) 1 1 0} 3
+        var vars::ary(zero) {1 {2 {} 6 7} 8 9}
+        line {ldindex vars::ary(zero) 1 2} 6
+        var vars::ary(zero) {1 {2 {} 7} 8 9}
+        line {ldindex vars::ary(zero) 1} {2 {} 7}
+        var vars::ary(zero) {1 8 9}
+        line {ldindex vars::ary(zero)} {1 8 9}
+        var vars::ary(zero) {}
+        
+        var vars::ary(one) {1 2 {3 4}}
+        line {lpop vars::ary(one)} {3 4}
+        var vars::ary(one) {1 2}
+        line {lpop vars::ary(one)} 2
+        var vars::ary(one) 1
+        line {lpop vars::ary(one)} 1
+        var vars::ary(one) {}
+        line {lpop vars::ary(one)} {}
+        var vars::ary(one) {}
+        
+        line {lpop vars::foo} -error NONE {can't read "vars::foo": no such variable}
+        
+        restore vars::ary(one)
+        var vars::ary(one) {1 2 {3 4}}
+        line {lshift vars::ary(one)} 1
+        var vars::ary(one) {2 {3 4}}
+        line {lshift vars::ary(one)} 2
+        var vars::ary(one) {{3 4}}
+        line {lshift vars::ary(one)} {3 4}
+        var vars::ary(one) {}
+        line {lshift vars::ary(one)} {}
+        var vars::ary(one) {}
+        
+        line {lshift vars::foo} -error NONE {can't read "vars::foo": no such variable}
+        
+        var vars::ary(two) -unset
+        line {lpush vars::ary(two) 1} 1
+        var vars::ary(two) 1
+        line {lpush vars::ary(two) 2 3 4 5} {1 2 3 4 5}
+        var vars::ary(two) {1 2 3 4 5}
+        line {lpush vars::ary(two) "this is a test"} {1 2 3 4 5 {this is a test}}
+        var vars::ary(two) {1 2 3 4 5 {this is a test}}
+        line {lpop vars::ary(two)} {this is a test}
+        var vars::ary(two) {1 2 3 4 5}
+        
+        line {lpush "foo bar" 3} {3}
+        var {foo bar} 3
+        
+        restore vars::ary(two)
+        var vars::ary(two) -unset
+        line {lunshift vars::ary(two) 5} 5
+        var vars::ary(two) 5
+        line {lunshift vars::ary(two) 4} {4 5}
+        var vars::ary(two) {4 5}
+        line {lunshift vars::ary(two) 1 2 3} {1 2 3 4 5}
+        var vars::ary(two) {1 2 3 4 5}
+        line {lunshift vars::ary(two) "this is a test"} {{this is a test} 1 2 3 4 5}
+        var vars::ary(two) {{this is a test} 1 2 3 4 5}
+        line {lshift vars::ary(two)} {this is a test}
+        var vars::ary(two) {1 2 3 4 5}
+        
+        # now test the try/throw stuff
+        line {throw} -error NONE {error: throw with no parameters outside of a catch}
+        line {throw 1 2 3 4} -error NONE {wrong # args: should be "throw ?type? ?message? ?info?"}
+        line {try {format 3} catch {} {}} -error NONE {invalid syntax in catch clause: type-list must contain at least one type}
+        line {try {format 3} finally {format 4} test} -error NONE {trailing args after finally clause}
+        block {basic try} {
+            try {
+                error "random error"
+            }
+        } -error NONE "random error"
+        block {try-finally} {
+            try {
+                error "try-finally error"
+            } finally {
+                set myVar "finally clause worked"
+            }
+        } -error NONE "try-finally error"
+        var myVar "finally clause worked"
+        block {try-finally-error} {
+            try {
+                error "try-finally error"
+            } finally {
+                error "finally error"
+            }
+        } -error NONE "finally error"
+        block {try-catch} {
+            try {
+                error "try-catch error"
+            } catch NONE {
+                format "catch clause worked"
+            }
+        } "catch clause worked"
+        block {try-catch-throw} {
+            try {
+                error "try-catch error"
+            } catch NONE {
+                set myVar "thrown"
+                throw
+            }
+        } -error NONE "try-catch error" ;# really should test errorInfo but that's messy
+        var myVar "thrown"
+        unset myVar
+        block {try-catch-finally} {
+            try {
+                error "try-catch-finally error"
+            } catch NONE {
+                set myVar "thrown"
+                throw
+            } finally {
+                lappend myVar "finally"
+            }
+        } -error NONE "try-catch-finally error"
+        var myVar "thrown finally"
+        block {try-catch-all} {
+            try {
+                error "this is a test"
+            } catch * {
+                format "catch-all worked"
+            }
+        } "catch-all worked"
+        block {try-catch-return} {
+            try {
+                error "this is a test"
+            } catch * {
+                return "catch-return worked"
+            }
+        } -return "catch-return worked"
+        block {try-catch-break} {
+            try {
+                error "this is a test"
+            } catch * {
+                break
+            }
+        } -break
+        block {try-catch-multiple} {
+            try {
+                error "this is a test"
+            } catch POSIX {
+                error "POSIX catch"
+            } catch * {
+                format "catch-all"
+            }
+        } "catch-all"
+        unset myVar
+        block {try-catch-multiple-finally} {
+            try {
+                error "this is a test"
+            } catch * {
+                lappend myVar "catch-all 1"
+            } catch * {
+                lappend myVar "catch-all 2"
+            } finally {
+                lappend myVar "finally"
+            }
+        } [list {catch-all 1}]
+        var myVar [list "catch-all 1" "finally"]
+        block {try-catch-types} {
+            try {
+                error "try-catch-types error" {} {MYERR arg1 arg2}
+            } catch POSIX {
+                error "POSIX catch"
+            } catch {{MY* arg*} code} {
+                format "caught code $code"
+            }
+        } "caught code MYERR arg1 arg2"
+        block {try-catch-vars} {
+            try {
+                error "random error"
+            } catch {* code msg info} {
+                set list {}
+                if {$code eq "NONE"} {
+                    lappend list "code: correct"
+                }
+                if {$msg eq "random error"} {
+                    lappend list "msg: correct"
+                }
+                if {[string match "random error\n*" $info]} {
+                    lappend list "info: probably correct"
+                }
+                join $list ", "
+            }
+        } "code: correct, msg: correct, info: probably correct"
+        block {try-break-catch} {
+            try {
+                break
+            } catch {*} {
+                error "catch triggered"
+            }
+        } -break
+        
+        # ensure the stack is sound
+        var ::_trycatch::catchStack {}
+    }
+} result]]} {
+    puts ""
+    puts "error: $result"
+    puts "code: $err"
+    puts $::errorInfo
+}

Copied: trunk/base/src/macports1.0/tests (from rev 26176, branches/dp2mp-move/base/src/macports1.0/tests)

Deleted: trunk/base/src/macports1.0/tests/macports_dlist.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/tests/macports_dlist.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/tests/macports_dlist.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,113 +0,0 @@
-#!/usr/bin/env tclsh
-# macports1.0/test_dlist.tcl
-# $Id$
-#
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-
-# Test suite for macports_dlist package.
-
-#lappend auto_path .
-#package require macports_dlist 1.0
-source macports_dlist.tcl
-
-puts ""
-puts "Testing ditem"
-
-puts -nonewline "Checking ditem_create... "
-if {[catch {ditem_create} ditem] || $ditem == ""} {
-	puts "failed: $ditem"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking ditem_key... "
-if {[catch {ditem_key $ditem provides "foo"} value] || $value != "foo"} {
-	puts "failed: $value"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking ditem_append... "
-if {[catch {ditem_append $ditem provides "bar"} value] || $value != {foo bar}} {
-	puts "failed: $value"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking ditem_contains... "
-set value2 ""
-if {[catch {ditem_contains $ditem provides "foo"} value] || $value != 1 ||
-	[catch {ditem_contains $ditem provides "zzz"} value2] || $value2 != 0} {
-	puts "failed: ${value}\n${value2}"
-} else {
-	puts "ok"
-}
-
-puts ""
-puts "Testing dlist"
-
-puts -nonewline "Checking dlist_search... "
-if {[catch {dlist_search [list $ditem] provides "bar"} value] || $value != $ditem} {
-	puts "failed: $value"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking dlist_has_pending... "
-if {[catch {dlist_has_pending [list $ditem] "foo"} value] || $value != 1} {
-	puts "failed: $value"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking dlist_count_unmet... "
-array set status [list foo 1 bar 0]
-if {[catch {dlist_count_unmet [list] status "foo"} value] || $value != 0 ||
-	[catch {dlist_count_unmet [list] status "bar"} value2] || $value2 != 1} {
-	puts "failed: ${value}\n${value2}"
-} else {
-	puts "ok"
-}
-
-# Replicate Shantonu's Bug #354 to test dlist functionality.
-# http://trac.macports.org/projects/macports/ticket/354
-# A depends on B, C.
-# B depends on C.
-# C has no dependencies.
-
-set A [ditem_create]
-ditem_key $A provides A
-ditem_append $A requires B
-ditem_append $A requires C
-
-set B [ditem_create]
-ditem_key $B provides B
-ditem_append $B requires C
-
-set C [ditem_create]
-ditem_key $C provides C
-
-array set status [list]
-puts -nonewline "Checking dlist_get_next... "
-if {[catch {dlist_get_next [list $A $B $C] status} value] || $value != $C} {
-	puts "failed: ${value}"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking dlist_eval... "
-proc handler {ditem} { puts -nonewline "[ditem_key $ditem provides] " }
-if {[catch {dlist_eval [list $A $B $C] handler} value] || $value != {}} {
-	puts "failed: ${value}"
-} else {
-	puts "ok"
-}
-
-puts -nonewline "Checking dlist_append_dependents... "
-if {[catch {dlist_append_dependents [list $A $B $C] $B {}} value] || $value != [list $B $C]} {
-	puts "failed: ${value}"
-} else {
-	puts "ok"
-}
-
-

Copied: trunk/base/src/macports1.0/tests/macports_dlist.tcl (from rev 26176, branches/dp2mp-move/base/src/macports1.0/tests/macports_dlist.tcl)
===================================================================
--- trunk/base/src/macports1.0/tests/macports_dlist.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/tests/macports_dlist.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,113 @@
+#!/usr/bin/env tclsh
+# macports1.0/test_dlist.tcl
+# $Id$
+#
+# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+
+# Test suite for macports_dlist package.
+
+#lappend auto_path .
+#package require macports_dlist 1.0
+source macports_dlist.tcl
+
+puts ""
+puts "Testing ditem"
+
+puts -nonewline "Checking ditem_create... "
+if {[catch {ditem_create} ditem] || $ditem == ""} {
+	puts "failed: $ditem"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking ditem_key... "
+if {[catch {ditem_key $ditem provides "foo"} value] || $value != "foo"} {
+	puts "failed: $value"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking ditem_append... "
+if {[catch {ditem_append $ditem provides "bar"} value] || $value != {foo bar}} {
+	puts "failed: $value"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking ditem_contains... "
+set value2 ""
+if {[catch {ditem_contains $ditem provides "foo"} value] || $value != 1 ||
+	[catch {ditem_contains $ditem provides "zzz"} value2] || $value2 != 0} {
+	puts "failed: ${value}\n${value2}"
+} else {
+	puts "ok"
+}
+
+puts ""
+puts "Testing dlist"
+
+puts -nonewline "Checking dlist_search... "
+if {[catch {dlist_search [list $ditem] provides "bar"} value] || $value != $ditem} {
+	puts "failed: $value"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking dlist_has_pending... "
+if {[catch {dlist_has_pending [list $ditem] "foo"} value] || $value != 1} {
+	puts "failed: $value"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking dlist_count_unmet... "
+array set status [list foo 1 bar 0]
+if {[catch {dlist_count_unmet [list] status "foo"} value] || $value != 0 ||
+	[catch {dlist_count_unmet [list] status "bar"} value2] || $value2 != 1} {
+	puts "failed: ${value}\n${value2}"
+} else {
+	puts "ok"
+}
+
+# Replicate Shantonu's Bug #354 to test dlist functionality.
+# http://trac.macports.org/projects/macports/ticket/354
+# A depends on B, C.
+# B depends on C.
+# C has no dependencies.
+
+set A [ditem_create]
+ditem_key $A provides A
+ditem_append $A requires B
+ditem_append $A requires C
+
+set B [ditem_create]
+ditem_key $B provides B
+ditem_append $B requires C
+
+set C [ditem_create]
+ditem_key $C provides C
+
+array set status [list]
+puts -nonewline "Checking dlist_get_next... "
+if {[catch {dlist_get_next [list $A $B $C] status} value] || $value != $C} {
+	puts "failed: ${value}"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking dlist_eval... "
+proc handler {ditem} { puts -nonewline "[ditem_key $ditem provides] " }
+if {[catch {dlist_eval [list $A $B $C] handler} value] || $value != {}} {
+	puts "failed: ${value}"
+} else {
+	puts "ok"
+}
+
+puts -nonewline "Checking dlist_append_dependents... "
+if {[catch {dlist_append_dependents [list $A $B $C] $B {}} value] || $value != [list $B $C]} {
+	puts "failed: ${value}"
+} else {
+	puts "ok"
+}
+
+

Deleted: trunk/base/src/macports1.0/util.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/util.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/util.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,144 +0,0 @@
-/*
- * util.c
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "macports.h"
-#include "util.h"
-
-#include <tcl.h>
-
-static Tcl_Interp* _util_interp = NULL; 
-
-/*
- *
- * mp_array_t
- *
- */
-
-mp_array_t mp_array_create() {
-    Tcl_Obj* res = Tcl_NewListObj(0, NULL);
-    if (_util_interp == NULL) _util_interp = Tcl_CreateInterp();
-    return res;
-}
-
-mp_array_t mp_array_create_copy(mp_array_t a) {
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_Obj* res = Tcl_DuplicateObj(array);
-    return res;
-}
-
-mp_array_t mp_array_retain(mp_array_t a) {
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_IncrRefCount(array);
-    return (mp_array_t)array;
-}
-
-void mp_array_release(mp_array_t a) {
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_DecrRefCount(array);
-}
-
-void mp_array_append(mp_array_t a, const void* data) {
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_Obj* obj = Tcl_NewByteArrayObj((unsigned char*)&data, sizeof(void*));
-    Tcl_ListObjAppendElement(_util_interp, array, obj);
-}
-
-int mp_array_get_count(mp_array_t a) {
-    int result;
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_ListObjLength(_util_interp, array, &result);
-    return result;
-}
-
-const void* mp_array_get_index(mp_array_t a, int index) {
-    void** resultPtr;
-    int size;
-    Tcl_Obj* array = (Tcl_Obj*)a;
-    Tcl_Obj* obj;
-    Tcl_ListObjIndex(_util_interp, array, index, &obj);
-    resultPtr = (void**)Tcl_GetByteArrayFromObj(obj, &size);
-    return *resultPtr;
-}
-
-
-
-/*
- *
- * mp_hash_t
- *
- */
-struct hashtable {
-    Tcl_HashTable table;
-    int refcount;
-};
-
-mp_hash_t mp_hash_create() {
-    struct hashtable* hash = malloc(sizeof(struct hashtable));
-    Tcl_InitHashTable(&hash->table, TCL_STRING_KEYS);
-    hash->refcount = 1;
-    return (mp_hash_t)hash;
-}
-
-mp_hash_t mp_hash_retain(mp_hash_t h) {
-    struct hashtable* hash = (struct hashtable*)h;
-    ++hash->refcount;
-    return h;
-}
-
-void mp_hash_release(mp_hash_t h) {
-    struct hashtable* hash = (struct hashtable*)h;
-    --hash->refcount;
-    if (hash->refcount == 0) {
-        Tcl_DeleteHashTable(&hash->table);
-        free(hash);
-    }
-}
-
-void mp_hash_set_value(mp_hash_t h, const void* key, const void* data) {
-    struct hashtable* hash = (struct hashtable*)h;
-    int created;
-    Tcl_HashEntry* entry = Tcl_CreateHashEntry(&hash->table, key, &created);
-    Tcl_SetHashValue(entry, (ClientData)data);
-}
-
-const void* mp_hash_get_value(mp_hash_t h, const void* key) {
-    struct hashtable* hash = (struct hashtable*)h;
-    Tcl_HashEntry* entry = Tcl_FindHashEntry(&hash->table, key);
-    if (entry != NULL) {
-        return (const void*)Tcl_GetHashValue(entry);
-    } else {
-        return NULL;
-    }
-}

Copied: trunk/base/src/macports1.0/util.c (from rev 26176, branches/dp2mp-move/base/src/macports1.0/util.c)
===================================================================
--- trunk/base/src/macports1.0/util.c	                        (rev 0)
+++ trunk/base/src/macports1.0/util.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,144 @@
+/*
+ * util.c
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "macports.h"
+#include "util.h"
+
+#include <tcl.h>
+
+static Tcl_Interp* _util_interp = NULL; 
+
+/*
+ *
+ * mp_array_t
+ *
+ */
+
+mp_array_t mp_array_create() {
+    Tcl_Obj* res = Tcl_NewListObj(0, NULL);
+    if (_util_interp == NULL) _util_interp = Tcl_CreateInterp();
+    return res;
+}
+
+mp_array_t mp_array_create_copy(mp_array_t a) {
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_Obj* res = Tcl_DuplicateObj(array);
+    return res;
+}
+
+mp_array_t mp_array_retain(mp_array_t a) {
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_IncrRefCount(array);
+    return (mp_array_t)array;
+}
+
+void mp_array_release(mp_array_t a) {
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_DecrRefCount(array);
+}
+
+void mp_array_append(mp_array_t a, const void* data) {
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_Obj* obj = Tcl_NewByteArrayObj((unsigned char*)&data, sizeof(void*));
+    Tcl_ListObjAppendElement(_util_interp, array, obj);
+}
+
+int mp_array_get_count(mp_array_t a) {
+    int result;
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_ListObjLength(_util_interp, array, &result);
+    return result;
+}
+
+const void* mp_array_get_index(mp_array_t a, int index) {
+    void** resultPtr;
+    int size;
+    Tcl_Obj* array = (Tcl_Obj*)a;
+    Tcl_Obj* obj;
+    Tcl_ListObjIndex(_util_interp, array, index, &obj);
+    resultPtr = (void**)Tcl_GetByteArrayFromObj(obj, &size);
+    return *resultPtr;
+}
+
+
+
+/*
+ *
+ * mp_hash_t
+ *
+ */
+struct hashtable {
+    Tcl_HashTable table;
+    int refcount;
+};
+
+mp_hash_t mp_hash_create() {
+    struct hashtable* hash = malloc(sizeof(struct hashtable));
+    Tcl_InitHashTable(&hash->table, TCL_STRING_KEYS);
+    hash->refcount = 1;
+    return (mp_hash_t)hash;
+}
+
+mp_hash_t mp_hash_retain(mp_hash_t h) {
+    struct hashtable* hash = (struct hashtable*)h;
+    ++hash->refcount;
+    return h;
+}
+
+void mp_hash_release(mp_hash_t h) {
+    struct hashtable* hash = (struct hashtable*)h;
+    --hash->refcount;
+    if (hash->refcount == 0) {
+        Tcl_DeleteHashTable(&hash->table);
+        free(hash);
+    }
+}
+
+void mp_hash_set_value(mp_hash_t h, const void* key, const void* data) {
+    struct hashtable* hash = (struct hashtable*)h;
+    int created;
+    Tcl_HashEntry* entry = Tcl_CreateHashEntry(&hash->table, key, &created);
+    Tcl_SetHashValue(entry, (ClientData)data);
+}
+
+const void* mp_hash_get_value(mp_hash_t h, const void* key) {
+    struct hashtable* hash = (struct hashtable*)h;
+    Tcl_HashEntry* entry = Tcl_FindHashEntry(&hash->table, key);
+    if (entry != NULL) {
+        return (const void*)Tcl_GetHashValue(entry);
+    } else {
+        return NULL;
+    }
+}

Deleted: trunk/base/src/macports1.0/util.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/util.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/macports1.0/util.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,46 +0,0 @@
-/*
- * util.h
- * $Id$
- *
- * Copyright (c) 2003 Apple Computer, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __UTIL_H__
-#define __UTIL_H__
-
-typedef void* mp_hash_t;
-mp_hash_t mp_hash_create();
-mp_hash_t mp_hash_create_copy(mp_hash_t h);
-mp_hash_t mp_hash_retain(mp_hash_t h);
-void mp_hash_release(mp_hash_t h);
-void mp_hash_set_value(mp_hash_t h, const void* key, const void* data);
-int mp_hash_get_count(mp_hash_t h);
-const void* mp_hash_get_value(mp_hash_t h, const void* key);
-/* something for delete */
-
-#endif /* __UTIL_H__ */

Copied: trunk/base/src/macports1.0/util.h (from rev 26176, branches/dp2mp-move/base/src/macports1.0/util.h)
===================================================================
--- trunk/base/src/macports1.0/util.h	                        (rev 0)
+++ trunk/base/src/macports1.0/util.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,46 @@
+/*
+ * util.h
+ * $Id$
+ *
+ * Copyright (c) 2003 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+typedef void* mp_hash_t;
+mp_hash_t mp_hash_create();
+mp_hash_t mp_hash_create_copy(mp_hash_t h);
+mp_hash_t mp_hash_retain(mp_hash_t h);
+void mp_hash_release(mp_hash_t h);
+void mp_hash_set_value(mp_hash_t h, const void* key, const void* data);
+int mp_hash_get_count(mp_hash_t h);
+const void* mp_hash_get_value(mp_hash_t h, const void* key);
+/* something for delete */
+
+#endif /* __UTIL_H__ */

Modified: trunk/base/src/package1.0/Makefile
===================================================================
--- trunk/base/src/package1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,9 +1,9 @@
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/Tcl/package1.0
+INSTALLDIR=	${DESTDIR}${datadir}/macports/Tcl/package1.0
 
 SRCS=	package.tcl portdmg.tcl portmpkg.tcl portpkg.tcl portrpmpackage.tcl \
 	portdpkg.tcl portunarchive.tcl portarchive.tcl
 
-include ../../Mk/dports.autoconf.mk
+include ../../Mk/macports.autoconf.mk
 
 all::
 

Modified: trunk/base/src/package1.0/package.tcl
===================================================================
--- trunk/base/src/package1.0/package.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/package.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -30,7 +30,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 # standard package load
-package provide dp_package 1.0
+package provide mp_package 1.0
 
 package require portrpmpackage 1.0
 package require portpkg 1.0

Modified: trunk/base/src/package1.0/portarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portarchive.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portarchive.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,12 +34,12 @@
 package provide portarchive 1.0
 package require portutil 1.0
 
-set com.apple.archive [target_new com.apple.archive archive_main]
-target_init ${com.apple.archive} archive_init
-target_provides ${com.apple.archive} archive
-target_requires ${com.apple.archive} main fetch extract checksum patch configure build destroot
-target_prerun ${com.apple.archive} archive_start
-target_postrun ${com.apple.archive} archive_finish
+set org.macports.archive [target_new org.macports.archive archive_main]
+target_init ${org.macports.archive} archive_init
+target_provides ${org.macports.archive} archive
+target_requires ${org.macports.archive} main fetch extract checksum patch configure build destroot
+target_prerun ${org.macports.archive} archive_start
+target_postrun ${org.macports.archive} archive_finish
 
 # defaults
 default archive.dir {${destpath}}
@@ -87,9 +87,9 @@
 
 	# Determine if archive should be skipped
 	set skipped 0
-	if {[check_statefile target com.apple.archive $target_state_fd]} {
+	if {[check_statefile target org.macports.archive $target_state_fd]} {
 		return 0
-	} elseif {[check_statefile target com.apple.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
+	} elseif {[check_statefile target org.macports.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
 		ui_debug "Skipping archive ($portname) since binary-only is set"
 		set skipped 1
 	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
@@ -113,7 +113,7 @@
 	}
 	# Skip archive target by setting state
 	if {$skipped == 1} {
-		write_statefile target "com.apple.archive" $target_state_fd
+		write_statefile target "org.macports.archive" $target_state_fd
 	}
 
 	return 0
@@ -241,18 +241,18 @@
 	}
 
 	# Copy state file into destroot for archiving
-	# +STATE contains a copy of the DP state information
-    set statefile [file join $workpath .darwinports.${portname}.state]
+	# +STATE contains a copy of the MacPorts state information
+    set statefile [file join $workpath .macports.${portname}.state]
 	file copy -force $statefile [file join $destpath "+STATE"]
 
 	# Copy Portfile into destroot for archiving
-	# +PORTFILE contains a copy of the DP Portfile
+	# +PORTFILE contains a copy of the MacPorts Portfile
     set portfile [file join $portpath Portfile]
 	file copy -force $portfile [file join $destpath "+PORTFILE"]
 
 	# Create some informational files that we don't really use just yet,
 	# but we may in the future in order to allow port installation from
-	# archives without a full "dports" tree of Portfiles.
+	# archives without a full "ports" tree of Portfiles.
 	#
 	# Note: These have been modeled after FreeBSD type package files to
 	# start. We can change them however we want for actual future use if

Modified: trunk/base/src/package1.0/portdmg.tcl
===================================================================
--- trunk/base/src/package1.0/portdmg.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portdmg.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portdmg 1.0
 package require portutil 1.0
 
-set com.apple.dmg [target_new com.apple.dmg dmg_main]
-target_runtype ${com.apple.dmg} always
-target_provides ${com.apple.dmg} dmg 
-target_requires ${com.apple.dmg} pkg
+set org.macports.dmg [target_new org.macports.dmg dmg_main]
+target_runtype ${org.macports.dmg} always
+target_provides ${org.macports.dmg} dmg 
+target_requires ${org.macports.dmg} pkg
 
 set_ui_prefix
 

Modified: trunk/base/src/package1.0/portdpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portdpkg.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portdpkg.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
 # portdpkg.tcl
 # $Id$
 #
-# Copyright (c) 2004 Landon Fuller <landonf at opendarwin.org>
+# Copyright (c) 2004 Landon Fuller <landonf at macports.org>
 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
 # All rights reserved.
 #
@@ -34,13 +34,13 @@
 package provide portdpkg 1.0
 package require portutil 1.0
 
-set com.apple.dpkg [target_new com.apple.dpkg com.apple.dpkg::main]
-target_runtype ${com.apple.dpkg} always
-target_provides ${com.apple.dpkg} dpkg
-target_requires ${com.apple.dpkg} destroot
+set org.macports.dpkg [target_new org.macports.dpkg org.macports.dpkg::main]
+target_runtype ${org.macports.dpkg} always
+target_provides ${org.macports.dpkg} dpkg
+target_requires ${org.macports.dpkg} destroot
 
 # Target Namespace
-namespace eval com.apple.dpkg {
+namespace eval org.macports.dpkg {
 }
 
 # Options
@@ -48,7 +48,7 @@
 
 set_ui_prefix
 
-proc com.apple.dpkg::main {args} {
+proc org.macports.dpkg::main {args} {
 	global UI_PREFIX destpath os.arch os.platform
     
 	ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option portname] [option portversion]]"
@@ -160,9 +160,9 @@
 	system "rm -rf \"${controlpath}\""
 }
 
-proc com.apple.dpkg::make_dependency_list {portname} {
+proc org.macports.dpkg::make_dependency_list {portname} {
 	set result {}
-	if {[catch {set res [dport_search "^$portname\$"]} error]} {
+	if {[catch {set res [mport_search "^$portname\$"]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "port search failed: $error"

Modified: trunk/base/src/package1.0/portmpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portmpkg.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portmpkg.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portmpkg 1.0
 package require portutil 1.0
 
-set com.apple.mpkg [target_new com.apple.mpkg mpkg_main]
-target_runtype ${com.apple.mpkg} always
-target_provides ${com.apple.mpkg} mpkg
-target_requires ${com.apple.mpkg} pkg
+set org.macports.mpkg [target_new org.macports.mpkg mpkg_main]
+target_runtype ${org.macports.mpkg} always
+target_provides ${org.macports.mpkg} mpkg
+target_requires ${org.macports.mpkg} pkg
 
 # define options
 options package.destpath
@@ -54,7 +54,7 @@
 
 proc make_dependency_list {portname} {
 	set result {}
-	if {[catch {set res [dport_search "^$portname\$"]} error]} {
+	if {[catch {set res [mport_search "^$portname\$"]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "port search failed: $error"
@@ -88,7 +88,7 @@
 
 proc make_one_package {portname portversion mpkgpath} {
 	global prefix package.destpath 
-	if {[catch {set res [dport_search "^$portname\$"]} result]} {
+	if {[catch {set res [mport_search "^$portname\$"]} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "port search failed: $result"
@@ -100,9 +100,9 @@
 		if {[info exists portinfo(porturl)] && [info exists portinfo(version)] && $portinfo(version) == $portversion} {
 			# only the prefix gets passed to the worker.
 			ui_debug "building dependency package: $portname"
-			set worker [dport_open $portinfo(porturl) [list prefix $prefix package.destpath ${mpkgpath}/Contents/Resources] {} yes]
-			dport_exec $worker pkg
-			dport_close $worker
+			set worker [mport_open $portinfo(porturl) [list prefix $prefix package.destpath ${mpkgpath}/Contents/Resources] {} yes]
+			mport_exec $worker pkg
+			mport_close $worker
 		}
 		unset portinfo
 	}
@@ -188,7 +188,7 @@
 	<key>CFBundleGetInfoString</key>
 	<string>${portname} ${portversion}</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.opendarwin.darwinports.mpkg.${portname}</string>
+	<string>org.macports.mpkg.${portname}</string>
 	<key>CFBundleName</key>
 	<string>${portname}</string>
 	<key>CFBundleShortVersionString</key>

Modified: trunk/base/src/package1.0/portpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portpkg.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portpkg.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,13 +33,13 @@
 package provide portpkg 1.0
 package require portutil 1.0
 
-set com.apple.pkg [target_new com.apple.pkg pkg_main]
-target_runtype ${com.apple.pkg} always
-target_provides ${com.apple.pkg} pkg
+set org.macports.pkg [target_new org.macports.pkg pkg_main]
+target_runtype ${org.macports.pkg} always
+target_provides ${org.macports.pkg} pkg
 if {[option portarchivemode] == "yes"} {
-	target_requires ${com.apple.pkg} unarchive destroot
+	target_requires ${org.macports.pkg} unarchive destroot
 } else {
-	target_requires ${com.apple.pkg} destroot
+	target_requires ${org.macports.pkg} destroot
 }
 
 # define options
@@ -141,7 +141,7 @@
 	<key>CFBundleGetInfoString</key>
 	<string>${portname} ${portversion}</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.opendarwin.darwinports.${portname}</string>
+	<string>org.macports.${portname}</string>
 	<key>CFBundleName</key>
 	<string>${portname}</string>
 	<key>CFBundleShortVersionString</key>

Modified: trunk/base/src/package1.0/portrpmpackage.tcl
===================================================================
--- trunk/base/src/package1.0/portrpmpackage.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portrpmpackage.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portrpmpackage 1.0
 package require portutil 1.0
 
-set com.apple.rpmpackage [target_new com.apple.rpmpackage rpmpackage_main]
-target_runtype ${com.apple.rpmpackage} always
-target_provides ${com.apple.rpmpackage} rpmpackage
-target_requires ${com.apple.rpmpackage} destroot
+set org.macports.rpmpackage [target_new org.macports.rpmpackage rpmpackage_main]
+target_runtype ${org.macports.rpmpackage} always
+target_provides ${org.macports.rpmpackage} rpmpackage
+target_requires ${org.macports.rpmpackage} destroot
 
 options package.destpath
 
@@ -65,7 +65,7 @@
         set rpmdestpath "--define '_topdir ${pkgpath}'"
     }
     
-    foreach dir { "${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+    foreach dir { "${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/macports/rpms/RPMS"} {
         foreach arch {"ppc" "i386" "fat"} {
             set rpmpath "$dir/${arch}/${portname}-${portversion}-${portrevision}.${arch}.rpm"
 	    if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
@@ -102,22 +102,22 @@
 
 	# depend on system (virtual packages for apple stuff)
 	regexp {[0-9]+} ${os.version} major
-	lappend dependencies "org.darwinports.${os.arch}"
-	lappend dependencies "org.darwinports.${os.platform}${major}"
+	lappend dependencies "org.macports.${os.arch}"
+	lappend dependencies "org.macports.${os.platform}${major}"
     
     system "rm -f '${workpath}/${portname}.filelist' && touch '${workpath}/${portname}.filelist'"
     #system "cd '${destpath}' && find . -type d | grep -v -E '^.$' | sed -e 's/\"/\\\"/g' -e 's/^./%dir \"/' -e 's/$/\"/' > '${workpath}/${portname}.filelist'"
     system "cd '${destpath}' && find . ! -type d | grep -v /etc/ | sed -e 's/\"/\\\"/g' -e 's/^./\"/' -e 's/$/\"/' >> '${workpath}/${portname}.filelist'"
     system "cd '${destpath}' && find . ! -type d | grep /etc/ | sed -e 's/\"/\\\"/g' -e 's/^./%config \"/' -e 's/$/\"/' >> '${workpath}/${portname}.filelist'"
     write_spec ${specpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $category $maintainer $destpath $dependencies $epoch
-    system "DP_USERECEIPTS='${portdbpath}/receipts' rpmbuild -bb -v ${rpmdestpath} ${specpath}"
+    system "MP_USERECEIPTS='${portdbpath}/receipts' rpmbuild -bb -v ${rpmdestpath} ${specpath}"
     
     return 0
 }
 
 proc make_dependency_list {portname} {
     set result {}
-    if {[catch {set res [dport_search "^$portname\$"]} error]} {
+    if {[catch {set res [mport_search "^$portname\$"]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
         ui_error "port search failed: $error"
@@ -154,9 +154,9 @@
     set origportname ${portname}
     regsub -all -- "\-" $portversion "_" portversion
     regsub -all -- "\-" $portname "_" portname
-    puts $specfd "\#Spec file generated by DarwinPorts
-%define distribution DarwinPorts
-%define vendor OpenDarwin
+    puts $specfd "\#Spec file generated by MacPorts
+%define distribution MacPorts
+%define vendor MacPorts
 %define packager ${maintainer}
 
 Summary: ${description}
@@ -178,7 +178,7 @@
 ${long_description}
 %prep
 %build
-echo \"Go DarwinPorts\"
+echo \"Go MacPorts\"
 %install
 %clean
 %files -f ${destroot}/../${origportname}.filelist

Modified: trunk/base/src/package1.0/portunarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portunarchive.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/package1.0/portunarchive.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,13 +34,13 @@
 package provide portunarchive 1.0
 package require portutil 1.0
 
-set com.apple.unarchive [target_new com.apple.unarchive unarchive_main]
-target_runtype ${com.apple.unarchive} always
-target_init ${com.apple.unarchive} unarchive_init
-target_provides ${com.apple.unarchive} unarchive
-target_requires ${com.apple.unarchive} main
-target_prerun ${com.apple.unarchive} unarchive_start
-target_postrun ${com.apple.unarchive} unarchive_finish
+set org.macports.unarchive [target_new org.macports.unarchive unarchive_main]
+target_runtype ${org.macports.unarchive} always
+target_init ${org.macports.unarchive} unarchive_init
+target_provides ${org.macports.unarchive} unarchive
+target_requires ${org.macports.unarchive} main
+target_prerun ${org.macports.unarchive} unarchive_start
+target_postrun ${org.macports.unarchive} unarchive_finish
 
 # defaults
 default unarchive.dir {${destpath}}
@@ -87,12 +87,12 @@
 
 	# Determine if unarchive should be skipped
 	set skipped 0
-	if {[check_statefile target com.apple.unarchive $target_state_fd]} {
+	if {[check_statefile target org.macports.unarchive $target_state_fd]} {
 		return 0
 	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
 		ui_debug "Skipping unarchive ($portname) since source-only is set"
 		set skipped 1
-	} elseif {[check_statefile target com.apple.destroot $target_state_fd]} {
+	} elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
 		ui_debug "Skipping unarchive ($portname) since destroot completed"
 		set skipped 1
 	} elseif {[info exists ports_force] && $ports_force == "yes"} {
@@ -133,7 +133,7 @@
 	}
 	# Skip unarchive target by setting state
 	if {$skipped == 1} {
-		write_statefile target "com.apple.unarchive" $target_state_fd
+		write_statefile target "org.macports.unarchive" $target_state_fd
 	}
 
 	return 0
@@ -283,15 +283,27 @@
 	global UI_PREFIX target_state_fd unarchive.file portname workpath destpath
 
 	# Reset state file with archive version
-	set statefile [file join $workpath .darwinports.${portname}.state]
+    set statefile [file join $workpath .macports.${portname}.state]
 	file copy -force [file join $destpath "+STATE"] $statefile
 	exec touch $statefile
 
-	# Update the state from unpacked archive version
-	set target_state_fd [open_statefile]
+# Hack to temporarily move com.apple.* strings in statefiles extracted from old archives
+# to the org.macports.* namespace. "temporarily" because old archives will still have a
+# +STATE file with the old strings in it, as we only update them on the unpacked statefile.
+    set fd_new_sf [open $statefile r]
+    set fd_tmp [open ${statefile}.tmp w+]
+    while {[gets $fd_new_sf line] >= 0} {
+	puts $fd_tmp "[regsub com.apple $line org.macports]"
+    }
+    close $fd_new_sf
+    close $fd_tmp
+    file rename -force ${statefile}.tmp $statefile
 
+    # Update the state from unpacked archive version
+    set target_state_fd [open_statefile]
+
 	# Archive unpacked, skip archive target
-	write_statefile target "com.apple.archive" $target_state_fd
+	write_statefile target "org.macports.archive" $target_state_fd
     
 	# Cleanup all control files when finished
 	set control_files [glob -nocomplain -types f [file join $destpath +*]]
@@ -303,3 +315,4 @@
 	ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s unpacked"] ${unarchive.file}]"
 	return 0
 }
+

Modified: trunk/base/src/pextlib1.0/Makefile
===================================================================
--- trunk/base/src/pextlib1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,11 +2,11 @@
 		fs-traverse.o strcasecmp.o vercomp.o filemap.o \
 		sha1cmd.o compat.o curl.o rmd160cmd.o readline.o uid.o
 SHLIB_NAME=	Pextlib${SHLIB_SUFFIX}
-INSTALLDIR= ${DESTDIR}${datadir}/darwinports/Tcl/pextlib1.0
+INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/pextlib1.0
 export MACOSX_DEPLOYMENT_TARGET=10.3
 
-include ../../Mk/dports.autoconf.mk
-include ../../Mk/dports.tea.mk
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk
 
 .PHONY: test
 

Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/Pextlib.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -4,7 +4,7 @@
  *
  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
  * Copyright (c) 2004 - 2005 Paul Guyot <pguyot at kallisys.net>
- * Copyright (c) 2004 Landon Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -657,7 +657,7 @@
 int ReaddirCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	DIR *dirp;
-	struct dirent *dp;
+	struct dirent *mp;
 	Tcl_Obj *tcl_result;
 	char *path;
 
@@ -673,13 +673,13 @@
 		return TCL_ERROR;
 	}
 	tcl_result = Tcl_NewListObj(0, NULL);
-	while ((dp = readdir(dirp))) {
+	while ((mp = readdir(dirp))) {
 		/* Skip . and .. */
-		if ((dp->d_name[0] != '.') ||
-			((dp->d_name[1] != 0)	/* "." */
+		if ((mp->d_name[0] != '.') ||
+			((mp->d_name[1] != 0)	/* "." */
 				&&
-			((dp->d_name[1] != '.') || (dp->d_name[2] != 0)))) /* ".." */ {
-			Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(dp->d_name, -1));
+			((mp->d_name[1] != '.') || (mp->d_name[2] != 0)))) /* ".." */ {
+			Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(mp->d_name, -1));
 		}
 	}
 	closedir(dirp);

Modified: trunk/base/src/pextlib1.0/compat.c
===================================================================
--- trunk/base/src/pextlib1.0/compat.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/compat.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * compat.c
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/compat.h
===================================================================
--- trunk/base/src/pextlib1.0/compat.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/compat.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * compat.h
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/curl.c
===================================================================
--- trunk/base/src/pextlib1.0/curl.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/curl.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * curl.c
  * $Id$
  *
- * Copyright (c) 2005 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2005 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/curl.h
===================================================================
--- trunk/base/src/pextlib1.0/curl.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/curl.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * curl.h
  * $Id$
  *
- * Copyright (c) 2005 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2005 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/filemap.c
===================================================================
--- trunk/base/src/pextlib1.0/filemap.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/filemap.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * filemap.c
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/filemap.h
===================================================================
--- trunk/base/src/pextlib1.0/filemap.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/filemap.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * filemap.h
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/readline.c
===================================================================
--- trunk/base/src/pextlib1.0/readline.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/readline.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * readline.c
  *
  * Some basic readline support callable from Tcl
- * By James D. Berry <jberry at opendarwin.org> 10/27/05
+ * By James D. Berry <jberry at macports.org> 10/27/05
  *
  * $Id$
  *

Modified: trunk/base/src/pextlib1.0/rmd160cmd.h
===================================================================
--- trunk/base/src/pextlib1.0/rmd160cmd.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/rmd160cmd.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -41,4 +41,4 @@
 int RMD160Cmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
 
 #endif
-	/* _RMD160CMD_H */
\ No newline at end of file
+	/* _RMD160CMD_H */

Modified: trunk/base/src/pextlib1.0/strcasecmp.c
===================================================================
--- trunk/base/src/pextlib1.0/strcasecmp.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/strcasecmp.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * strcasecmp.c
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/strcasecmp.h
===================================================================
--- trunk/base/src/pextlib1.0/strcasecmp.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/strcasecmp.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * strcasecmp.h
  * $Id$
  *
- * Copyright (c) 2004 Paul Guyot, Darwinports Team.
+ * Copyright (c) 2004 Paul Guyot, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/tests/curl.tcl
===================================================================
--- trunk/base/src/pextlib1.0/tests/curl.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/tests/curl.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -8,7 +8,7 @@
 	set tempfile /tmp/macports-pextlib-testcurl
 
 	# download a dummy file over HTTP.
-	curl fetch http://www.opendarwin.org/~pguyot/kilroy $tempfile
+	curl fetch http://svn.macports.org/repository/macports/users/pguyot/kilroy $tempfile
 	
 	# check the md5 sum of the file.
 	if {[md5 file $tempfile] != "a1b1cca7ffaa377e7dcdaaf2f619d8ae"} {
@@ -17,20 +17,20 @@
 	}
 
 	# check we indeed get a 404 a dummy file over HTTP.
-	if {![catch {curl fetch http://www.opendarwin.org/~pguyot/curl-test-404 $tempfile}]} {
-		puts {![catch {curl fetch http://www.opendarwin.org/~pguyot/curl-test-404 $tempfile}]}
+	if {![catch {curl fetch http://svn.macports.org/repository/macports/users/pguyot/curl-test-404 $tempfile}]} {
+		puts {![catch {curl fetch http://svn.macports.org/repository/macports/users/pguyot/curl-test-404 $tempfile}]}
 		exit 1
 	}
 	
 	# check the modification date of the dummy file.
 	# 20050801->1122822000
-	if {![curl isnewer http://www.opendarwin.org/~pguyot/kilroy 1122822000]} {
-		puts {![curl isnewer http://www.opendarwin.org/~pguyot/kilroy 1122822000]}
+	if {![curl isnewer http://svn.macports.org/repository/macports/users/pguyot/kilroy 1122822000]} {
+		puts {![curl isnewer http://svn.macports.org/repository/macports/users/pguyot/kilroy 1122822000]}
 		exit 1
 	}
 	# 20050811->1123686000
-	if {[curl isnewer http://www.opendarwin.org/~pguyot/kilroy 1123686000]} {
-		puts {[curl isnewer http://www.opendarwin.org/~pguyot/kilroy 1123686000]}
+	if {[curl isnewer http://svn.macports.org/repository/macports/users/pguyot/kilroy 1123686000]} {
+		puts {[curl isnewer http://svn.macports.org/repository/macports/users/pguyot/kilroy 1123686000]}
 		exit 1
 	}
 	

Modified: trunk/base/src/pextlib1.0/uid.c
===================================================================
--- trunk/base/src/pextlib1.0/uid.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/uid.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * uid.c
  *
  * uid handling routines
- * By James D. Berry <jberry at opendarwin.org> 4/6/06
+ * By James D. Berry <jberry at macports.org> 4/6/06
  *
  * $Id$
  *

Modified: trunk/base/src/pextlib1.0/uid.h
===================================================================
--- trunk/base/src/pextlib1.0/uid.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/uid.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
  * uid.h
  * $Id$
  *
- * Copyright (c) 2005, Darwinports Team.
+ * Copyright (c) 2005, MacPorts Team.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Darwinports Team nor the names of its contributors
+ * 3. Neither the name of MacPorts Team nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: trunk/base/src/pextlib1.0/vercomp.c
===================================================================
--- trunk/base/src/pextlib1.0/vercomp.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/vercomp.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,10 +3,10 @@
  * $Id$
  * RPM compatible version comparison
  *
- * Author: Landon Fuller <landonf at opendarwin.org>
+ * Author: Landon Fuller <landonf at macports.org>
  *
  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
- * Copyright (c) 2004 Landon Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/pextlib1.0/vercomp.h
===================================================================
--- trunk/base/src/pextlib1.0/vercomp.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/vercomp.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * vercomp.h
  * $Id$
- * Author: Landon Fuller <landonf at opendarwin.org>
+ * Author: Landon Fuller <landonf at macports.org>
  *
  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
  * Copyright (c) 2004 Landon Fuller

Modified: trunk/base/src/pextlib1.0/xinstall.c
===================================================================
--- trunk/base/src/pextlib1.0/xinstall.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/pextlib1.0/xinstall.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,7 +33,7 @@
  * 2003/12/29:
  *
  * Substantially revamped from original BSD source to become a Tcl builtin
- * procedure for the Opendarwin Project.
+ * procedure for the MacPorts Project.
  * Author: Jordan K. Hubbard
  */
 

Modified: trunk/base/src/port/Makefile
===================================================================
--- trunk/base/src/port/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -7,7 +7,7 @@
 	-e 's, at TCLSH\@,$(TCLSH),g' \
 	-e 's, at TCL_PACKAGE_DIR\@,$(TCL_PACKAGE_DIR),g'
 
-include ../../Mk/dports.autoconf.mk
+include ../../Mk/macports.autoconf.mk
 
 all: ${SCRIPTS}
 

Modified: trunk/base/src/port/port.1
===================================================================
--- trunk/base/src/port/port.1	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port/port.1	2007-06-15 10:11:22 UTC (rev 26177)
@@ -27,8 +27,8 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 13, 2005
-.Dt PORT 1 "Apple Computer, Inc."
+.Dd April 29, 2007
+.Dt PORT 1 "MacPorts"
 .Os
 .Sh NAME
 .Nm port
@@ -81,14 +81,14 @@
 .Nm
 command knows various
 .Ar pseudo-portnames
-that will expand to the specified set of ports from the available dports tree(s). These may be used in place of a
+that will expand to the specified set of ports from the available ports tree(s). These may be used in place of a
 .Ar portname .
 Common options are:
 .Pp
 .Bl -bullet -offset indent -compact
 .It
 .Ar all :
-all the ports in each dports tree listed in
+all the ports in each ports tree listed in
 .Ar sources.conf
 .Pp
 .It
@@ -109,11 +109,11 @@
 .Pp
 .It
 .Ar uninstalled :
-ports in the dports tree(s) that aren't installed.
+ports in the ports tree(s) that aren't installed.
 .Pp
 .It
 .Ar outdated :
-installed ports that are out of date with respect to their current version/revision in the dports tree(s)
+installed ports that are out of date with respect to their current version/revision in the ports tree(s)
 .Pp
 .El
 Other options, also known as
@@ -252,7 +252,7 @@
 .Fl -maintainer
 or
 .Fl -category
-(recognized field names are those from the portindex). If the global option
+(recognized field names are those from the PortIndex). If the global option
 .Fl q
 is in effect, the meta-info fields will not be labeled.
 If the option
@@ -312,14 +312,14 @@
 .Dl "port provides /opt/local/etc/irssi.conf"
 .Dl "port provides include/tiff.h"
 .Ss sync
-Performs a sync operation only on the dports tree of a MacPorts installation, pulling in the latest
+Performs a sync operation only on the ports tree of a MacPorts installation, pulling in the latest
 revision available of the
 .Ar Portfiles
 from the MacPorts rsync server. To update you would normally do:
 .Pp
 .Dl "sudo port -d sync"
 .Pp
-If any of the dports tree(s) uses a file: URL that points to a local subversion working copy,
+If any of the ports tree(s) uses a file: URL that points to a local subversion working copy,
 .Ic sync
 will perform an
 .Ic "svn update"
@@ -405,14 +405,14 @@
 .Ss version
 Display the release number of the installed MacPorts infrastructure.
 .Ss selfupdate
-Updates the MacPorts system, dports tree(s) and base tools if needed, from the MacPorts rsync server,
+Updates the MacPorts system, ports tree(s) and base tools if needed, from the MacPorts rsync server,
 installing the newest infrastructure available. To update you would typically do:
 .Pp
 .Dl "sudo port -d selfupdate"
 .Pp
 See
 .Ic sync
-for more information about updating dports tree(s).
+for more information about updating ports tree(s).
 .Ss help
 Displays a summary of all available actions and port command syntax on stdout.
 .Sh DEVELOPER TARGETS
@@ -503,13 +503,13 @@
 .Pp
 .Sh FILES
 .Bl -tag -width
-.It Va ${prefix}/etc/ports/ports.conf
+.It Va ${prefix}/etc/macports/macports.conf
 Global configuration file for the MacPorts system.
-.It Va ${prefix}/etc/ports/sources.conf
-Global listing of the dports/ trees used by MacPorts. This file also enables rsync synchronization.
-.It Va ${prefix}/etc/ports/variants.conf
+.It Va ${prefix}/etc/macports/sources.conf
+Global listing of the ports trees used by MacPorts. This file also enables rsync synchronization.
+.It Va ${prefix}/etc/macports/variants.conf
 Global variants used when a port is installed.
-.It Va ~/.portsrc
+.It Va ~/.macports/macports.conf
 User configuration file for the MacPorts system. It overrides the global
 .Ar ports.conf
 file.
@@ -517,7 +517,7 @@
 .Sh DIAGNOSTICS
 .Ex -std
 .Sh SEE ALSO
-.Xr ports.conf 5 ,
+.Xr macports.conf 5 ,
 .Xr portfile 7 ,
 .Xr portgroup 7 ,
 .Xr portstyle 7 ,

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port/port.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -4,7 +4,7 @@
 # port.tcl
 # $Id$
 #
-# Copyright (c) 2002-2006 DarwinPorts organization
+# Copyright (c) 2002-2006 MacPorts organization
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
 # Copyright (c) 2002 Apple Computer, Inc.
 # All rights reserved.
@@ -38,8 +38,8 @@
 #
 
 catch {source \
-	[file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
-package require darwinports
+	[file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl]}
+package require macports
 
 # UI Instantiations
 # ui_options(ports_debug) - If set, output debugging messages.
@@ -362,18 +362,18 @@
 
 
 proc url_to_portname { url {quiet 0} } {
-	# Save directory and restore the directory, since dportopen changes it
+	# Save directory and restore the directory, since mportopen changes it
 	set savedir [pwd]
 	set portname ""
-	if {[catch {set ctx [dportopen $url]} result]} {
+	if {[catch {set ctx [mportopen $url]} result]} {
 		if {!$quiet} {
 			ui_msg "Can't map the URL '$url' to a port description file (\"${result}\")."
 			ui_msg "Please verify that the directory and portfile syntax are correct."
 		}
 	} else {
-		array set portinfo [dportinfo $ctx]
+		array set portinfo [mportinfo $ctx]
 		set portname $portinfo(name)
-		dportclose $ctx
+		mportclose $ctx
 	}
 	cd $savedir
 	return $portname
@@ -394,7 +394,7 @@
 # When the block is entered, the variables portname, portversion, options, and variations
 # will have been set
 proc foreachport {portlist block} {
-	# Restore cwd after each port, since dportopen changes it, and relative
+	# Restore cwd after each port, since mportopen changes it, and relative
 	# urls will break on subsequent passes
 	set savedir [pwd]
 	foreach portspec $portlist {
@@ -452,7 +452,7 @@
 # Port selection
 ##########################################
 proc get_matching_ports {pattern {casesensitive no} {matchstyle glob} {field name}} {
-	if {[catch {set res [dportsearch $pattern $casesensitive $matchstyle $field]} result]} {
+	if {[catch {set res [mportsearch $pattern $casesensitive $matchstyle $field]} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		fatal "search for portname $pattern failed: $result"
@@ -559,8 +559,8 @@
 
 
 proc get_outdated_ports {} {
-	global darwinports::registry.installtype
-	set is_image_mode [expr 0 == [string compare "image" ${darwinports::registry.installtype}]]
+	global macports::registry.installtype
+	set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
 	
 	# Get the list of installed ports
 	set ilist {}
@@ -590,7 +590,7 @@
 			set installed_epoch		[lindex $i 5]
 
 			# Get info about the port from the index
-			if {[catch {set res [dportsearch $portname no exact]} result]} {
+			if {[catch {set res [mportsearch $portname no exact]} result]} {
 				global errorInfo
 				ui_debug "$errorInfo"
 				fatal "search for portname $portname failed: $result"
@@ -1151,18 +1151,18 @@
     set status 0
     require_portlist portlist
     foreachport $portlist {
-        # If we have a url, use that, since it's most specific
-        # otherwise try to map the portname to a url
+    # If we have a url, use that, since it's most specific
+    # otherwise try to map the portname to a url
         if {$porturl eq ""} {
-            # Verify the portname, getting portinfo to map to a porturl
-            if {[catch {dportsearch $portname no exact} result]} {
-                ui_debug "$::errorInfo"
-                break_softcontinue "search for portname $portname failed: $result" 1 status
+        # Verify the portname, getting portinfo to map to a porturl
+	    if {[catch {mportsearch $portname no exact} result]} {
+		ui_debug "$::errorInfo"
+		break_softcontinue "search for portname $portname failed: $result" 1 status
+	    }
+	    if {[llength $result] < 2} {
+		break_softcontinue "Port $portname not found" 1 status
             }
-            if {[llength $result] < 2} {
-                break_softcontinue "Port $portname not found" 1 status
-            }
-            set found [expr [llength $result] / 2]
+	    set found [expr [llength $result] / 2]
             if {$found > 1} {
                 ui_warn "Found $found port $portname definitions, displaying first one."
             }
@@ -1171,15 +1171,15 @@
             set porturl $portinfo(porturl)
             set portdir $portinfo(portdir)
         }
-        
+
         if {!([info exists options(ports_info_index)] && $options(ports_info_index) eq "yes")} {
-            if {[catch {set dport [dportopen $porturl [array get options] [array get variations]]} result]} {
+            if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
                 ui_debug "$::errorInfo"
                 break_softcontinue "Unable to open port: $result" 1 status
             }
             array unset portinfo
-            array set portinfo [dportinfo $dport]
-            dportclose $dport
+            array set portinfo [mportinfo $mport]
+            mportclose $mport
             if {[info exists portdir]} {
                 set portinfo(portdir) $portdir
             }
@@ -1220,11 +1220,11 @@
             set field_sep "\t"
             set subfield_sep ","
         }
-
+	
         # Figure out whether to show field name
-        set quiet [ui_isset ports_quiet]
+	set quiet [ui_isset ports_quiet]
         if {$quiet} {
-            set show_label 0
+	    set show_label 0
         }
         
         # Spin through action options, emitting information for any found
@@ -1413,7 +1413,7 @@
 
 proc action_selfupdate { action portlist opts } {
 	global global_options
-	if { [catch {darwinports::selfupdate [array get global_options]} result ] } {
+	if { [catch {macports::selfupdate [array get global_options]} result ] } {
 		global errorInfo
 		ui_debug "$errorInfo"
 		fatal "selfupdate failed: $result"
@@ -1434,7 +1434,7 @@
 			}
 		}
 		
-		darwinports::upgrade $portname "port:$portname" [array get variations] [array get options]
+		macports::upgrade $portname "port:$portname" [array get variations] [array get options]
 	}
 	
 	return 0
@@ -1442,7 +1442,7 @@
 
 
 proc action_version { action portlist opts } {
-	puts "Version: [darwinports::version]"
+	puts "Version: [macports::version]"
 	return 0
 }
 
@@ -1574,8 +1574,8 @@
 
 
 proc action_outdated { action portlist opts } {
-	global darwinports::registry.installtype
-	set is_image_mode [expr 0 == [string compare "image" ${darwinports::registry.installtype}]]
+	global macports::registry.installtype
+	set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
 
 	set status 0
 
@@ -1624,7 +1624,7 @@
 			set installed_epoch		[lindex $i 5]
 
 			# Get info about the port from the index
-			if {[catch {set res [dportsearch $portname no exact]} result]} {
+			if {[catch {set res [mportsearch $portname no exact]} result]} {
 				global errorInfo
 				ui_debug "$errorInfo"
 				break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -1726,7 +1726,7 @@
 	require_portlist portlist
 	foreachport $portlist {
 		# Get info about the port
-		if {[catch {dportsearch $portname no exact} result]} {
+		if {[catch {mportsearch $portname no exact} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -1769,7 +1769,7 @@
 	require_portlist portlist
 	foreachport $portlist {
 		# search for port
-		if {[catch {dportsearch $portname no exact} result]} {
+		if {[catch {mportsearch $portname no exact} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -1818,7 +1818,7 @@
 	
 	foreachport $portlist {
 		set portfound 0
-		if {[catch {set res [dportsearch $portname no]} result]} {
+		if {[catch {set res [mportsearch $portname no]} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -1872,7 +1872,7 @@
 			set search_string [regex_pat_sanitize $portname]
 		}
 		
-		if {[catch {set res [dportsearch ^$search_string\$ no]} result]} {
+		if {[catch {set res [mportsearch ^$search_string\$ no]} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "search for portname $search_string failed: $result" 1 status
@@ -1923,7 +1923,7 @@
 	require_portlist portlist
 	foreachport $portlist {
 		# Verify the portname, getting portinfo to map to a porturl
-		if {[catch {set res [dportsearch $portname no exact]} result]} {
+		if {[catch {set res [mportsearch $portname no exact]} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -1939,7 +1939,7 @@
 			set porturl $portinfo(porturl)
 		}
 		
-		set portdir [file normalize [darwinports::getportdir $porturl]]
+		set portdir [file normalize [macports::getportdir $porturl]]
 		set porturl "file://${portdir}";	# Rebuild url so it's fully qualified
 		set portfile "${portdir}/Portfile"
 		
@@ -1983,7 +1983,7 @@
 						}
 					}
 					
-					# Restore internal dp environment
+					# Restore internal MacPorts environment
 					array unset env *; array set env [array get env_save]
 				}
 				
@@ -1994,7 +1994,7 @@
 				
 				work {
 					# output the path to the port's work directory
-					set workpath [darwinports::getportworkpath_from_portdir $portdir]
+					set workpath [macports::getportworkpath_from_portdir $portdir]
 					if {[file exists $workpath]} {
 						puts $workpath
 					}
@@ -2019,7 +2019,7 @@
 				gohome {
 					set homepage $portinfo(homepage)
 					if { $homepage != "" } {
-						system "${darwinports::autoconf::open_path} $homepage"
+						system "${macports::autoconf::open_path} $homepage"
 					} else {
 						puts "(no homepage)"
 					}
@@ -2036,7 +2036,7 @@
 
 proc action_sync { action portlist opts } {
 	set status 0
-	if {[catch {dportsync} result]} {
+	if {[catch {mportsync} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_msg "port sync failed: $result"
@@ -2058,7 +2058,7 @@
 		# otherwise try to map the portname to a url
 		if {$porturl == ""} {
 			# Verify the portname, getting portinfo to map to a porturl
-			if {[catch {set res [dportsearch $portname no exact]} result]} {
+			if {[catch {set res [mportsearch $portname no exact]} result]} {
 				global errorInfo
 				ui_debug "$errorInfo"
 				break_softcontinue "search for portname $portname failed: $result" 1 status
@@ -2086,19 +2086,19 @@
 		if {[string length $portversion]} {
 			set options(ports_version_glob) $portversion
 		}
-		if {[catch {set workername [dportopen $porturl [array get options] [array get variations]]} result]} {
+		if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			break_softcontinue "Unable to open port: $result" 1 status
 		}
-		if {[catch {set result [dportexec $workername $target]} result]} {
+		if {[catch {set result [mportexec $workername $target]} result]} {
 			global errorInfo
-			dportclose $workername
+			mportclose $workername
 			ui_debug "$errorInfo"
 			break_softcontinue "Unable to execute port: $result" 1 status
 		}
 
-		dportclose $workername
+		mportclose $workername
 		
 		# Process any error that wasn't thrown and handled already
 		if {$result} {
@@ -2406,7 +2406,7 @@
 		set complete_choices {}
 
 		# Build a list of ports with text as their prefix
-		if {[catch {set res [dportsearch "${text}*" false glob]} result]} {
+		if {[catch {set res [mportsearch "${text}*" false glob]} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			fatal "search for portname $pattern failed: $result"
@@ -2496,10 +2496,10 @@
 	set isstdin [string match $in "stdin"]
 	set name "port"
 	set use_readline [expr $isstdin && [readline init $name]]
-	set history_file [file normalize "${darwinports::macports_user_dir}/history"]
+	set history_file [file normalize "${macports::macports_user_dir}/history"]
 
 	# Read readline history
-	if {$use_readline && [file isdirectory $darwinports::macports_user_dir]} {
+	if {$use_readline && [file isdirectory $macports::macports_user_dir]} {
 		rl_history read $history_file
 		rl_history stifle 100
 	}
@@ -2507,7 +2507,7 @@
 	# Be noisy, if appropriate
 	set noisy [expr $isstdin && ![ui_isset ports_quiet]]
 	if { $noisy } {
-		puts "MacPorts [darwinports::version]"
+		puts "MacPorts [macports::version]"
 		puts "Entering interactive mode... (\"help\" for help, \"quit\" to quit)"
 	}
 	
@@ -2542,7 +2542,7 @@
 	}
 	
 	# Save readine history
-	if {$use_readline && [file isdirectory $darwinports::macports_user_dir]} {
+	if {$use_readline && [file isdirectory $macports::macports_user_dir]} {
 		rl_history write $history_file
 	}
 	
@@ -2602,7 +2602,7 @@
 array set global_options	{}
 array set global_variations	{}
 
-# Save off a copy of the environment before dportinit monkeys with it
+# Save off a copy of the environment before mportinit monkeys with it
 global env boot_env
 array set boot_env [array get env]
 
@@ -2631,10 +2631,10 @@
 # Get arguments remaining after option processing
 set remaining_args [lrange $cmd_argv $cmd_argn end]
 
-# Initialize dport
+# Initialize mport
 # This must be done following parse of global options, as some options are
-# evaluated by dportinit.
-if {[catch {dportinit ui_options global_options global_variations} result]} {
+# evaluated by mportinit.
+if {[catch {mportinit ui_options global_options global_variations} result]} {
 	global errorInfo
 	puts "$errorInfo"
 	fatal "Failed to initialize ports system, $result"

Modified: trunk/base/src/port/portindex.tcl
===================================================================
--- trunk/base/src/port/portindex.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port/portindex.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -7,8 +7,8 @@
 # $Id$
 
 catch {source \
-	[file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
-package require darwinports
+	[file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl]}
+package require macports
 package require Pextlib
 
 # Globals
@@ -19,8 +19,8 @@
 array set global_options 	[list]
 array set global_variations [list]
 
-# Pass global options into dportinit
-dportinit ui_options global_options global_variations
+# Pass global options into mportinit
+mportinit ui_options global_options global_variations
 
 
 
@@ -102,10 +102,10 @@
 proc pindex {portdir} {	
     global target fd directory archive outdir stats 
     incr stats(total)
-	global darwinports::prefix
+	global macports::prefix
 	set save_prefix $prefix
 	set prefix {\${prefix}}
-    if {[catch {set interp [dportopen file://[file join $directory $portdir]]} result]} {
+    if {[catch {set interp [mportopen file://[file join $directory $portdir]]} result]} {
 		puts stderr "Failed to parse file $portdir/Portfile: $result"
 		# revert the prefix.
 		set prefix $save_prefix
@@ -113,8 +113,8 @@
     } else {
 		# revert the prefix.
         set prefix $save_prefix
-        array set portinfo [dportinfo $interp]
-        dportclose $interp
+        array set portinfo [mportinfo $interp]
+        mportclose $interp
         set portinfo(portdir) $portdir
         puts "Adding port $portdir"
         if {$archive == "1"} {
@@ -202,7 +202,7 @@
 
 puts "Creating software index in $outdir"
 set fd [open [file join $outdir PortIndex] w]
-dporttraverse pindex $directory
+mporttraverse pindex $directory
 close $fd
 puts "\nTotal number of ports parsed:\t$stats(total)\
       \nPorts successfully parsed:\t[expr $stats(total) - $stats(failed)]\t\

Modified: trunk/base/src/port/portmirror.tcl
===================================================================
--- trunk/base/src/port/portmirror.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port/portmirror.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -7,8 +7,8 @@
 # $Id$
 
 catch {source \
-	[file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
-package require darwinports
+	[file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl]}
+package require macports
 package require Pextlib
 
 # Globals
@@ -17,8 +17,8 @@
 array set global_options 	[list]
 array set global_variations [list]
 
-# Pass global options into dportinit
-dportinit ui_options global_options global_variations
+# Pass global options into mportinit
+mportinit ui_options global_options global_variations
 
 # UI Instantiations
 # ui_options(ports_debug) - If set, output debugging messages.
@@ -107,8 +107,8 @@
 # func:		function to call on every dist file (it is passed
 #			the path as its parameter)
 proc iterate_distfiles {func} {
-	global darwinports::portdbpath
-	iterate_distfiles_r $func [file join ${darwinports::portdbpath} distfiles]
+	global macports::portdbpath
+	iterate_distfiles_r $func [file join ${macports::portdbpath} distfiles]
 }
 
 # Check if the file is in the map and delete it otherwise.
@@ -122,8 +122,8 @@
 
 # Open the database
 proc open_database args {
-	global darwinports::portdbpath distfiles_filemap
-	set path [file join ${darwinports::portdbpath} distfiles_mirror.db]
+	global macports::portdbpath distfiles_filemap
+	set path [file join ${macports::portdbpath} distfiles_mirror.db]
 	if {[file exists $path]} {
 		filemap open distfiles_filemap $path readonly
 	} else {
@@ -155,4 +155,4 @@
 iterate_distfiles iterate_walker
 
 # Close the database
-close_database
\ No newline at end of file
+close_database

Modified: trunk/base/src/port1.0/Makefile
===================================================================
--- trunk/base/src/port1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,4 +1,4 @@
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/Tcl/port1.0
+INSTALLDIR=	${DESTDIR}${datadir}/macports/Tcl/port1.0
 
 SRCS=	port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl	    \
 	portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl \
@@ -9,8 +9,8 @@
 
 SUBDIR=		resources
 
-include ../../Mk/dports.subdir.mk
-include ../../Mk/dports.autoconf.mk
+include ../../Mk/macports.subdir.mk
+include ../../Mk/macports.autoconf.mk
 
 .PHONY: test
 

Modified: trunk/base/src/port1.0/port.tcl
===================================================================
--- trunk/base/src/port1.0/port.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/port.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -32,7 +32,7 @@
 # standard package load
 package provide port 1.0
 
-package require dp_package 1.0
+package require mp_package 1.0
 package require portmain 1.0
 package require portdepends 1.0
 package require portfetch 1.0

Modified: trunk/base/src/port1.0/portactivate.tcl
===================================================================
--- trunk/base/src/port1.0/portactivate.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portactivate.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -36,14 +36,14 @@
 package provide portactivate 1.0
 package require portutil 1.0
 
-set com.apple.activate [target_new com.apple.activate activate_main]
-target_runtype ${com.apple.activate} always
-target_state ${com.apple.activate} no
-target_provides ${com.apple.activate} activate
+set org.macports.activate [target_new org.macports.activate activate_main]
+target_runtype ${org.macports.activate} always
+target_state ${org.macports.activate} no
+target_provides ${org.macports.activate} activate
 if {[option portarchivemode] == "yes"} {
-	target_requires ${com.apple.activate} main unarchive fetch extract checksum patch configure build destroot archive install
+	target_requires ${org.macports.activate} main unarchive fetch extract checksum patch configure build destroot archive install
 } else {
-	target_requires ${com.apple.activate} main fetch extract checksum patch configure build destroot install
+	target_requires ${org.macports.activate} main fetch extract checksum patch configure build destroot install
 }
 
 set_ui_prefix

Modified: trunk/base/src/port1.0/portbuild.tcl
===================================================================
--- trunk/base/src/port1.0/portbuild.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portbuild.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portbuild 1.0
 package require portutil 1.0
 
-set com.apple.build [target_new com.apple.build build_main]
-target_provides ${com.apple.build} build
-target_requires ${com.apple.build} main fetch extract checksum patch configure
-target_prerun ${com.apple.build} build_start
+set org.macports.build [target_new org.macports.build build_main]
+target_provides ${org.macports.build} build
+target_requires ${org.macports.build} main fetch extract checksum patch configure
+target_prerun ${org.macports.build} build_start
 
 # define options
 options build.target

Modified: trunk/base/src/port1.0/portchecksum.tcl
===================================================================
--- trunk/base/src/port1.0/portchecksum.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portchecksum.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,10 +34,10 @@
 package provide portchecksum 1.0
 package require portutil 1.0
 
-set com.apple.checksum [target_new com.apple.checksum checksum_main]
-target_provides ${com.apple.checksum} checksum
-target_requires ${com.apple.checksum} main fetch
-target_prerun ${com.apple.checksum} checksum_start
+set org.macports.checksum [target_new org.macports.checksum checksum_main]
+target_provides ${org.macports.checksum} checksum
+target_requires ${org.macports.checksum} main fetch
+target_prerun ${org.macports.checksum} checksum_start
 
 # Options
 options checksums checksum.skip

Modified: trunk/base/src/port1.0/portclean.tcl
===================================================================
--- trunk/base/src/port1.0/portclean.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portclean.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -37,11 +37,11 @@
 package require portutil 1.0
 package require Pextlib 1.0
 
-set com.apple.clean [target_new com.apple.clean clean_main]
-target_runtype ${com.apple.clean} always
-target_provides ${com.apple.clean} clean
-target_requires ${com.apple.clean} main
-target_prerun ${com.apple.clean} clean_start
+set org.macports.clean [target_new org.macports.clean clean_main]
+target_runtype ${org.macports.clean} always
+target_provides ${org.macports.clean} clean
+target_requires ${org.macports.clean} main
+target_prerun ${org.macports.clean} clean_start
 
 set_ui_prefix
 

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portconfigure.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portconfigure 1.0
 package require portutil 1.0
 
-set com.apple.configure [target_new com.apple.configure configure_main]
-target_provides ${com.apple.configure} configure
-target_requires ${com.apple.configure} main fetch extract checksum patch
-target_prerun ${com.apple.configure} configure_start
+set org.macports.configure [target_new org.macports.configure configure_main]
+target_provides ${org.macports.configure} configure
+target_requires ${org.macports.configure} main fetch extract checksum patch
+target_prerun ${org.macports.configure} configure_start
 
 # define options
 commands configure automake autoconf xmkmf libtool

Modified: trunk/base/src/port1.0/portdestroot.tcl
===================================================================
--- trunk/base/src/port1.0/portdestroot.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portdestroot.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,11 +34,11 @@
 package provide portdestroot 1.0
 package require portutil 1.0
 
-set com.apple.destroot [target_new com.apple.destroot destroot_main]
-target_provides ${com.apple.destroot} destroot
-target_requires ${com.apple.destroot} main fetch extract checksum patch configure build
-target_prerun ${com.apple.destroot} destroot_start
-target_postrun ${com.apple.destroot} destroot_finish
+set org.macports.destroot [target_new org.macports.destroot destroot_main]
+target_provides ${org.macports.destroot} destroot
+target_requires ${org.macports.destroot} main fetch extract checksum patch configure build
+target_prerun ${org.macports.destroot} destroot_start
+target_postrun ${org.macports.destroot} destroot_finish
 
 # define options
 options destroot.target destroot.destdir destroot.clean destroot.keepdirs destroot.umask

Modified: trunk/base/src/port1.0/portdistcheck.tcl
===================================================================
--- trunk/base/src/port1.0/portdistcheck.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portdistcheck.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -36,11 +36,11 @@
 package require portutil 1.0
 package require portfetch 1.0
 
-set com.apple.distcheck [target_new com.apple.distcheck distcheck_main]
-target_runtype ${com.apple.distcheck} always
-target_state ${com.apple.distcheck} no
-target_provides ${com.apple.distcheck} distcheck
-target_requires ${com.apple.distcheck} main
+set org.macports.distcheck [target_new org.macports.distcheck distcheck_main]
+target_runtype ${org.macports.distcheck} always
+target_state ${org.macports.distcheck} no
+target_provides ${org.macports.distcheck} distcheck
+target_requires ${org.macports.distcheck} main
 
 # define options
 options distcheck.check

Modified: trunk/base/src/port1.0/portextract.tcl
===================================================================
--- trunk/base/src/port1.0/portextract.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portextract.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,11 +33,11 @@
 package provide portextract 1.0
 package require portutil 1.0
 
-set com.apple.extract [target_new com.apple.extract extract_main]
-target_init ${com.apple.extract} extract_init
-target_provides ${com.apple.extract} extract
-target_requires ${com.apple.extract} fetch checksum
-target_prerun ${com.apple.extract} extract_start
+set org.macports.extract [target_new org.macports.extract extract_main]
+target_init ${org.macports.extract} extract_init
+target_provides ${org.macports.extract} extract
+target_requires ${org.macports.extract} fetch checksum
+target_prerun ${org.macports.extract} extract_start
 
 # define options
 options extract.only

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portfetch.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,11 +34,11 @@
 package require portutil 1.0
 package require Pextlib 1.0
 
-set com.apple.fetch [target_new com.apple.fetch fetch_main]
-target_init ${com.apple.fetch} fetch_init
-target_provides ${com.apple.fetch} fetch
-target_requires ${com.apple.fetch} main
-target_prerun ${com.apple.fetch} fetch_start
+set org.macports.fetch [target_new org.macports.fetch fetch_main]
+target_init ${org.macports.fetch} fetch_init
+target_provides ${org.macports.fetch} fetch
+target_requires ${org.macports.fetch} main
+target_prerun ${org.macports.fetch} fetch_start
 
 # define options: distname master_sites
 options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 dist_subdir \
@@ -87,7 +87,7 @@
 # Ignore SSL certificate
 default fetch.ignore_sslcert "no"
 
-default fallback_mirror_site "opendarwin"
+default fallback_mirror_site "macports"
 default mirror_sites.listfile {"mirror_sites.tcl"}
 default mirror_sites.listpath {"${portresourcepath}/fetch/"}
 

Modified: trunk/base/src/port1.0/portinstall.tcl
===================================================================
--- trunk/base/src/port1.0/portinstall.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portinstall.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -34,15 +34,15 @@
 package provide portinstall 1.0
 package require portutil 1.0
 
-set com.apple.install [target_new com.apple.install install_main]
-target_state ${com.apple.install} no
-target_provides ${com.apple.install} install
+set org.macports.install [target_new org.macports.install install_main]
+target_state ${org.macports.install} no
+target_provides ${org.macports.install} install
 if {[option portarchivemode] == "yes"} {
-	target_requires ${com.apple.install} main unarchive fetch extract checksum patch configure build destroot archive
+	target_requires ${org.macports.install} main unarchive fetch extract checksum patch configure build destroot archive
 } else {
-	target_requires ${com.apple.install} main fetch extract checksum patch configure build destroot
+	target_requires ${org.macports.install} main fetch extract checksum patch configure build destroot
 }
-target_prerun ${com.apple.install} install_start
+target_prerun ${org.macports.install} install_start
 
 set_ui_prefix
 

Modified: trunk/base/src/port1.0/portlivecheck.tcl
===================================================================
--- trunk/base/src/port1.0/portlivecheck.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portlivecheck.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -36,11 +36,11 @@
 package require portutil 1.0
 package require portfetch 1.0
 
-set com.apple.livecheck [target_new com.apple.livecheck livecheck_main]
-target_runtype ${com.apple.livecheck} always
-target_state ${com.apple.livecheck} no
-target_provides ${com.apple.livecheck} livecheck
-target_requires ${com.apple.livecheck} main
+set org.macports.livecheck [target_new org.macports.livecheck livecheck_main]
+target_runtype ${org.macports.livecheck} always
+target_state ${org.macports.livecheck} no
+target_provides ${org.macports.livecheck} livecheck
+target_requires ${org.macports.livecheck} main
 
 # define options
 options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portmain.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -36,8 +36,8 @@
 package provide portmain 1.0
 package require portutil 1.0
 
-set com.apple.main [target_new com.apple.main main]
-target_provides ${com.apple.main} main
+set org.macports.main [target_new org.macports.main main]
+target_provides ${org.macports.main} main
 
 # define options
 options prefix name version revision epoch categories maintainers

Modified: trunk/base/src/port1.0/portmirror.tcl
===================================================================
--- trunk/base/src/port1.0/portmirror.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portmirror.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -38,12 +38,12 @@
 package require portfetch 1.0
 package require portchecksum 1.0
 
-set com.apple.mirror [target_new com.apple.mirror mirror_main]
-target_runtype ${com.apple.mirror} always
-target_state ${com.apple.mirror} no
-target_provides ${com.apple.mirror} mirror
-target_requires ${com.apple.mirror} main
-#target_parallel ${com.apple.mirror} yes
+set org.macports.mirror [target_new org.macports.mirror mirror_main]
+target_runtype ${org.macports.mirror} always
+target_state ${org.macports.mirror} no
+target_provides ${org.macports.mirror} mirror
+target_requires ${org.macports.mirror} main
+#target_parallel ${org.macports.mirror} yes
 
 # Mirror is a target that fetches & checksums files and delete them
 # if the checksum isn't correct.

Modified: trunk/base/src/port1.0/portpatch.tcl
===================================================================
--- trunk/base/src/port1.0/portpatch.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portpatch.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,9 +33,9 @@
 package provide portpatch 1.0
 package require portutil 1.0
 
-set com.apple.patch [target_new com.apple.patch patch_main]
-target_provides ${com.apple.patch} patch
-target_requires ${com.apple.patch} main fetch checksum extract 
+set org.macports.patch [target_new org.macports.patch patch_main]
+target_provides ${org.macports.patch} patch
+target_requires ${org.macports.patch} main fetch checksum extract 
 
 set_ui_prefix
 

Modified: trunk/base/src/port1.0/portstartupitem.tcl
===================================================================
--- trunk/base/src/port1.0/portstartupitem.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portstartupitem.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2004, 2005 Markus W. Weissman <mww at opendarwin.org>,
+# Copyright (c) 2004, 2005 Markus W. Weissman <mww at macports.org>,
 # Copyright (c) 2005 Robert Shaw <rshaw at opendarwin.org>,
 # All rights reserved.
 #
@@ -204,7 +204,7 @@
 
 }
 	puts ${item} "prefix=$prefix"
-	# Source the utilities package and the darwinports config file
+	# Source the utilities package and the MacPorts config file
 	puts ${item} {[ -r "/etc/rc.common" ] && . "/etc/rc.common"}
 	puts ${item} {[ -r "${prefix}/etc/rc.conf" ] && . "${prefix}/etc/rc.conf"}
 

Modified: trunk/base/src/port1.0/portsubmit.tcl
===================================================================
--- trunk/base/src/port1.0/portsubmit.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portsubmit.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,10 +33,10 @@
 package provide portsubmit 1.0
 package require portutil 1.0
 
-set com.apple.submit [target_new com.apple.submit submit_main]
-target_runtype ${com.apple.submit} always
-target_provides ${com.apple.submit} submit 
-target_requires ${com.apple.submit} main
+set org.macports.submit [target_new org.macports.submit submit_main]
+target_runtype ${org.macports.submit} always
+target_provides ${org.macports.submit} submit 
+target_requires ${org.macports.submit} main
 
 set_ui_prefix
 
@@ -278,7 +278,7 @@
 
 	set portsource ""
 	set base_rev ""
-	if {![catch {set fd [open ".dports_source" r]}]} {
+	if {![catch {set fd [open ".mports_source" r]}]} {
 		while {[gets $fd line] != -1} {
 			regexp -- {^(.*): (.*)$} $line unused key value
 			switch -- $key {
@@ -316,7 +316,7 @@
 
     set cmd "curl "
     append cmd "--silent "
-    append cmd "--url [regsub -- {^dports} $portsource {http}]/cgi-bin/portsubmit.cgi "
+    append cmd "--url [regsub -- {^mports} $portsource {http}]/cgi-bin/portsubmit.cgi "
     append cmd "--output ${workpath}/.portsubmit.out "
     append cmd "-F name=${portname} "
     append cmd "-F version=${portversion} "
@@ -352,7 +352,7 @@
 	close $fd
 
 	if {[info exists result(OK)]} {
-		set fd [open ".dports_source" w]
+		set fd [open ".mports_source" w]
 		puts $fd "source: $portsource"
 		puts $fd "port: $portname"
 		puts $fd "version: $portversion"
@@ -366,24 +366,24 @@
 	} elseif {[info exists result(CONFLICT)]} {
 		# Fetch the newer revision from the index.
 		# XXX: many gross hacks here regarding paths, urls, etc.
-		set tmpdir [mktemp "/tmp/dports.XXXXXXXX"]
+		set tmpdir [mktemp "/tmp/mports.XXXXXXXX"]
 		file mkdir $tmpdir/new
 		file mkdir $tmpdir/old
-		set worker [dport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
+		set worker [mport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
 		if {$base_rev != ""} {
-			set worker2 [dport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
+			set worker2 [mport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
 			catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$portname-$portversion/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
 			system "mv $tmpdir/Portfile $portpath/Portfile"
-			dport_close $worker2
+			mport_close $worker2
 		} else {
 			catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
 			system "mv $tmpdir/Portfile $portpath/Portfile"
 		}
-		dport_close $worker
+		mport_close $worker
 		catch {system "rm -Rf $tmpdir"}
 		catch {system "rm -Rf $tmpdir"}
 
-		set fd [open [file join "$portpath" ".dports_source"] w]
+		set fd [open [file join "$portpath" ".mports_source"] w]
 		puts $fd "source: $portsource"
 		puts $fd "port: $portname"
 		puts $fd "version: $portversion"

Modified: trunk/base/src/port1.0/porttest.tcl
===================================================================
--- trunk/base/src/port1.0/porttest.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/porttest.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -5,10 +5,10 @@
 package provide porttest 1.0
 package require portutil 1.0
 
-set com.apple.test [target_new com.apple.test test_main]
-target_provides ${com.apple.test} test
-target_requires ${com.apple.test} main fetch extract checksum patch configure build
-target_prerun ${com.apple.test} test_start
+set org.macports.test [target_new org.macports.test test_main]
+target_provides ${org.macports.test} test
+target_requires ${org.macports.test} main fetch extract checksum patch configure build
+target_prerun ${org.macports.test} test_start
 
 # define options
 options test.run test.target 

Modified: trunk/base/src/port1.0/porttrace.tcl
===================================================================
--- trunk/base/src/port1.0/porttrace.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/porttrace.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -52,7 +52,7 @@
 					
 			# Launch darwintrace.dylib.
 			
-			set tracelib_path [file join ${portutil::autoconf::prefix} share darwinports Tcl darwintrace1.0 darwintrace.dylib]
+			set tracelib_path [file join ${portutil::autoconf::prefix} share macports Tcl darwintrace1.0 darwintrace.dylib]
 
 			if {[info exists env(DYLD_INSERT_LIBRARIES)]} {
 				set env(DYLD_INSERT_LIBRARIES) "${env(DYLD_INSERT_LIBRARIES)}:${tracelib_path}"
@@ -157,7 +157,7 @@
 proc create_slave {workpath trace_fifo} {
 	global trace_thread
 	# Create the thread.
-	set trace_thread [darwinports_create_thread]
+	set trace_thread [macports_create_thread]
 	
 	# The slave thread requires the registry package.
 	thread::send -async $trace_thread "package require registry 1.0"

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/portutil.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
 # Copyright (c) 2002 Apple Computer, Inc.
-# Copyright (c) 2006 Markus W. Weissmann <mww at opendarwin.org>
+# Copyright (c) 2006 Markus W. Weissmann <mww at macports.org>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -34,8 +34,8 @@
 
 package provide portutil 1.0
 package require Pextlib 1.0
-package require darwinports_dlist 1.0
-package require darwinports_util 1.0
+package require macports_dlist 1.0
+package require macports_util 1.0
 package require msgcat
 package require porttrace 1.0
 
@@ -1077,7 +1077,7 @@
 			# Something to close the registry entry may be called here, if it existed.
 		# 3rd case: the same port/version/revision/Variants is already active
 		# and user didn't mention -f
-		} elseif {$name == "com.apple.activate"
+		} elseif {$name == "org.macports.activate"
 			&& [registry_exists $portname $portversion $portrevision $portvariants]
 			&& !([info exists ports_force] && $ports_force == "yes")} {
 			
@@ -1267,7 +1267,7 @@
 	file mkdir $workpath
     }
     # flock Portfile
-    set statefile [file join $workpath .darwinports.${portname}.state]
+    set statefile [file join $workpath .macports.${portname}.state]
     if {[file exists $statefile]} {
 	if {![file writable $statefile]} {
 	    return -code error "$statefile is not writable - check permission on port directory"
@@ -1685,7 +1685,7 @@
     # Escape regex special characters
     regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string 
     
-    set res [dport_search ^$search_string\$]
+    set res [mport_search ^$search_string\$]
     if {[llength $res] < 2} {
         ui_error "Dependency $portname not found"
         return -1
@@ -1693,20 +1693,20 @@
     
     array set portinfo [lindex $res 1]
     set porturl $portinfo(porturl)
-    if {[catch {set worker [dport_open $porturl [array get options] $variations]} result]} {
+    if {[catch {set worker [mport_open $porturl [array get options] $variations]} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
         ui_error "Opening $portname $target failed: $result"
         return -1
     }
-    if {[catch {dport_exec $worker $target} result] || $result != 0} {
+    if {[catch {mport_exec $worker $target} result] || $result != 0} {
 		global errorInfo
 		ui_debug "$errorInfo"
         ui_error "Execution $portname $target failed: $result"
-        dport_close $worker
+        mport_close $worker
         return -1
     }
-    dport_close $worker
+    mport_close $worker
     
     return 0
 }

Modified: trunk/base/src/port1.0/resources/Makefile
===================================================================
--- trunk/base/src/port1.0/resources/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,12 +1,9 @@
 SUBDIR=		package fetch group
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/resources/port1.0/
-RSRCS=
+INSTALLDIR=	${DESTDIR}${datadir}/macports/resources/port1.0/
 
-include ../../../Mk/dports.subdir.mk
-include ../../../Mk/dports.autoconf.mk
+include ../../../Mk/macports.subdir.mk
+include ../../../Mk/macports.autoconf.mk
 
 install::
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
-#	$(SILENT)set -x; for file in ${RSRCS}; do \
-#		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \
-#	done
+

Modified: trunk/base/src/port1.0/resources/fetch/Makefile
===================================================================
--- trunk/base/src/port1.0/resources/fetch/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/fetch/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,8 +1,8 @@
-INSTALLDIR=	${DESTDIR}${prefix}/share/darwinports/resources/port1.0/fetch
+INSTALLDIR=	${DESTDIR}${prefix}/share/macports/resources/port1.0/fetch
 
 RSRCS=		mirror_sites.tcl
 
-include ../../../../Mk/dports.autoconf.mk
+include ../../../../Mk/macports.autoconf.mk
 
 all:
 

Modified: trunk/base/src/port1.0/resources/group/Makefile
===================================================================
--- trunk/base/src/port1.0/resources/group/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/group/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,9 +1,9 @@
-INSTALLDIR=	${DESTDIR}${prefix}/share/darwinports/resources/port1.0/group
+INSTALLDIR=	${DESTDIR}${prefix}/share/macports/resources/port1.0/group
 
 RSRCS=		gnustep-1.0.tcl perl5-1.0.tcl python-1.0.tcl python24-1.0.tcl python25-1.0.tcl ruby-1.0.tcl \
 		xcode-1.0.tcl zope-1.0.tcl
 
-include ../../../../Mk/dports.autoconf.mk
+include ../../../../Mk/macports.autoconf.mk
 
 all:
 

Modified: trunk/base/src/port1.0/resources/group/gnustep-1.0.tcl
===================================================================
--- trunk/base/src/port1.0/resources/group/gnustep-1.0.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/group/gnustep-1.0.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2006 Yves de Champlain <yves at opendarwin.org>,
+# Copyright (c) 2006 Yves de Champlain <yves at macports.org>,
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -54,7 +54,7 @@
 #                               }
 #                                
 # default use_configure         no
-# default configure.args        CC=gcc-dp-4.1
+# default configure.args        CC=gcc-mp-4.1
 #
 # default build.type            gnu
 # default build.args            messages=yes
@@ -82,7 +82,7 @@
 default depends_lib         port:gnustep-back
 
 default use_configure		no
-default configure.args      CC=gcc-dp-4.1
+default configure.args      CC=gcc-mp-4.1
 
 default build.type          gnu
 default build.args          messages=yes

Modified: trunk/base/src/port1.0/resources/group/python-1.0.tcl
===================================================================
--- trunk/base/src/port1.0/resources/group/python-1.0.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/group/python-1.0.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2004 Markus W. Weissman <mww at opendarwin.org>,
+# Copyright (c) 2004 Markus W. Weissman <mww at macports.org>,
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/port1.0/resources/group/python24-1.0.tcl
===================================================================
--- trunk/base/src/port1.0/resources/group/python24-1.0.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/group/python24-1.0.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2004 Markus W. Weissman <mww at opendarwin.org>,
+# Copyright (c) 2004 Markus W. Weissman <mww at macports.org>,
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/port1.0/resources/package/Makefile
===================================================================
--- trunk/base/src/port1.0/resources/package/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/resources/package/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/resources/port1.0/package
+INSTALLDIR=	${DESTDIR}${datadir}/macports/resources/port1.0/package
 RSRCS=		background.tiff
 
-include ../../../../Mk/dports.autoconf.mk
+include ../../../../Mk/macports.autoconf.mk
 
 all:
 

Modified: trunk/base/src/port1.0/tests/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/tests/portutil.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/port1.0/tests/portutil.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,8 +2,8 @@
 # Requires r/w access to /tmp
 # MacPorts must be installed for this to work
 
-package require darwinports
-dportinit
+package require macports
+mportinit
 
 # load the current copy of portutil instead of the installed one
 source [file dirname [info script]]/../portutil.tcl
@@ -67,7 +67,7 @@
     # depends_lib is intended to work from within a worker thread
     # so we shall oblige
     set workername [interp create]
-    darwinports::worker_init $workername {} [darwinports::getportbuildpath {}] {} {}
+    macports::worker_init $workername {} [macports::getportbuildpath {}] {} {}
     set body {
         # load the current copy of portutil instead of the installed one
         source [file dirname [info script]]/../portutil.tcl

Modified: trunk/base/src/portindex/initialize.sql
===================================================================
--- trunk/base/src/portindex/initialize.sql	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/portindex/initialize.sql	2007-06-15 10:11:22 UTC (rev 26177)
@@ -3,7 +3,7 @@
 -- 29-Jan-2004
 -- kevin at opendarwin.org
 --
--- This file creates the tables for the DarwinPorts port index and should
+-- This file creates the tables for the MacPorts port index and should
 -- be executed before any subsequent portindex sql update files.
 
 CREATE TABLE ports (

Modified: trunk/base/src/programs/Makefile.in
===================================================================
--- trunk/base/src/programs/Makefile.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/programs/Makefile.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
 
 SUBDIR=	@REPLACEMENT_PROGS@ @EXTRA_PROGS@
 
-include ../../Mk/dports.subdir.mk
+include ../../Mk/macports.subdir.mk
 
 distclean::
 	rm -f Makefile

Modified: trunk/base/src/programs/daemondo/Makefile.in
===================================================================
--- trunk/base/src/programs/daemondo/Makefile.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/programs/daemondo/Makefile.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
 
 top_srcdir = @top_srcdir@
 
-include ${top_srcdir}/Mk/dports.autoconf.mk
+include ${top_srcdir}/Mk/macports.autoconf.mk
 
 mandir=		@mandir@
 mandircat8=	${mandir}/cat8

Modified: trunk/base/src/programs/daemondo/main.c
===================================================================
--- trunk/base/src/programs/daemondo/main.c	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/programs/daemondo/main.c	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
 	daemondo - main.c
 	
-	Copyright (c) 2005 James Berry <jberry at opendarwin.org>
+	Copyright (c) 2005 James Berry <jberry at macports.org>
 	All rights reserved.
 
 	Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/registry1.0/Makefile
===================================================================
--- trunk/base/src/registry1.0/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/registry1.0/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,8 +1,8 @@
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/Tcl/registry1.0
+INSTALLDIR=	${DESTDIR}${datadir}/macports/Tcl/registry1.0
 
 SRCS= registry.tcl registry_autoconf.tcl receipt_flat.tcl receipt_sqlite.tcl portimage.tcl portuninstall.tcl
 
-include ../../Mk/dports.autoconf.mk
+include ../../Mk/macports.autoconf.mk
 
 all::
 

Modified: trunk/base/src/registry1.0/portimage.tcl
===================================================================
--- trunk/base/src/registry1.0/portimage.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/registry1.0/portimage.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -33,14 +33,14 @@
 package provide portimage 1.0
 
 package require registry 1.0
-package require darwinports 1.0
+package require macports 1.0
 package require Pextlib 1.0
 
 set UI_PREFIX "--> "
 
 #
 # Port Images are basically just installations of the destroot of a port into
-# ${darwinports::registry.path}/software/${name}/${version}_${revision}${variants}
+# ${macports::registry.path}/software/${name}/${version}_${revision}${variants}
 # They allow the user to instal multiple versions of the same port, treating
 # each revision and each different combination of variants as a "version".
 #  
@@ -69,7 +69,7 @@
 	
 # Activate a "Port Image"	
 proc activate {name v optionslist} {
-	global darwinports::prefix darwinports::registry.path UI_PREFIX
+	global macports::prefix macports::registry.path UI_PREFIX
 	array set options $optionslist
 	variable force
 
@@ -303,7 +303,7 @@
 
 proc _activate_contents {name imagefiles imagedir} {
 	variable force
-	global darwinports::prefix
+	global macports::prefix
 
 	set files [list]
 	
@@ -332,7 +332,7 @@
 		} elseif { [file exists $file] && $force != 1 } {
 			return -code error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port $name."
 		} elseif { $force == 1 && [file exists $file] || $port != 0 } {
-			set bakfile ${file}.dp_[clock seconds]
+			set bakfile ${file}.mp_[clock seconds]
 
 			if {[file exists $file]} {
 				ui_warn "File $file already exists.  Moving to: $bakfile."

Modified: trunk/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_flat.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/registry1.0/receipt_flat.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,7 +2,7 @@
 # $Id$
 #
 # Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
-# Copyright (c) 2004 Paul Guyot, DarwinPorts Team.
+# Copyright (c) 2004 Paul Guyot, MacPorts Team.
 # Copyright (c) 2002 Apple Computer, Inc.
 # All rights reserved.
 #
@@ -33,7 +33,7 @@
 
 package provide receipt_flat 1.0
 
-package require darwinports 1.0
+package require macports 1.0
 package require Pextlib 1.0
 
 ##
@@ -68,41 +68,41 @@
 # portversion		the version for this port, 0 if unknown.
 # return the path to the file or "" if the file couldn't be found.
 proc get_head_entry_receipt_path {portname portversion} {
-	global darwinports::registry.path
+    global macports::registry.path
 
-	# regex match case
-	if {$portversion == 0} {
-	set x [glob -nocomplain [file join ${darwinports::registry.path} receipts ${portname}-*]]
+    # regex match case
+    if {$portversion == 0} {
+	set x [glob -nocomplain [file join ${macports::registry.path} receipts ${portname}-*]]
 	if {[string length $x]} {
-		set matchfile [lindex $x 0]
+	    set matchfile [lindex $x 0]
 		# Remove trailing .bz2, if any.
 		regexp {(.*)\.bz2$} $matchfile match matchfile
 	} else {
-		set matchfile ""
+	    set matchfile ""
 	}
-	} else {
-	set matchfile [file join ${darwinports::registry.path} receipts ${portname}-${portversion}]
-	}
+    } else {
+	set matchfile [file join ${macports::registry.path} receipts ${portname}-${portversion}]
+    }
 
-	# Might as well bail out early if no file to match
-	if {![string length $matchfile]} {
+    # Might as well bail out early if no file to match
+    if {![string length $matchfile]} {
 		return ""
-	}
+    }
 
-	if {[file exists $matchfile] || [file exists ${matchfile}.bz2]} {
+    if {[file exists $matchfile] || [file exists ${matchfile}.bz2]} {
 		return $matchfile
-	}
-	return ""
+    }
+    return ""
 }
 
 ##
 #
 # Open an existing entry and return its reference number.
 proc open_entry {name {version 0} {revision 0} {variants ""}} {
-	global darwinports::registry.installtype
-	global darwinports::registry.path
+	global macports::registry.installtype
+	global macports::registry.path
 
-	set receipt_path [file join ${darwinports::registry.path} receipts ${name}]
+	set receipt_path [file join ${macports::registry.path} receipts ${name}]
 
 	# If the receipt path ${name} doesn't exist, then the receipt probably is
 	# in the old HEAD format.
@@ -141,7 +141,7 @@
 			return -code error "Registry error: ${name} @${version}_${revision}${variants} not registered as installed."
 		}
 	
-		set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+		set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	
 		set receipt_file [file join ${receipt_path} receipt]
 	}
@@ -170,7 +170,7 @@
 		convert_entry_from_HEAD $name $version $revision $variants $receipt_contents $ref
 		
 		# move the old receipt
-		set convertedDirPath [file join ${darwinports::registry.path} receipts_converted]
+		set convertedDirPath [file join ${macports::registry.path} receipts_converted]
 		file mkdir $convertedDirPath
 		file rename $receipt_file $convertedDirPath
 	} elseif {[string match "# Version: *" $receipt_contents]} {
@@ -296,12 +296,12 @@
 # version			the version of the port.
 # variants			the variants of the port.
 proc write_entry {ref name version {revision 0} {variants ""}} {
-	global darwinports::registry.installtype
+	global macports::registry.installtype
 	variable receipt_$ref
 
 	set receipt_contents [array get receipt_$ref]
 
-	set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+	set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	set receipt_file [file join ${receipt_path} receipt]
 
 	if { ![file isdirectory ${receipt_path}] } {
@@ -330,12 +330,12 @@
 
 # Check to see if an entry exists
 proc entry_exists {name version {revision 0} {variants ""}} {
-	global darwinports::registry.path
+	global macports::registry.path
 	variable receipt_handle 
 	variable receipt_file 
 	variable receipt_path
 
-	set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+	set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	set receipt_file [file join ${receipt_path} receipt]
 
 	if { [file exists $receipt_file] } {
@@ -383,15 +383,15 @@
 
 # Delete an entry
 proc delete_entry {name version {revision 0} {variants ""}} {
-	global darwinports::registry.path
+	global macports::registry.path
 
-	set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+	set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	if { [file exists ${receipt_path}] } {
 		# remove port receipt directory
 		ui_debug "deleting directory: ${receipt_path}"
 		file delete -force ${receipt_path}
 		# remove port receipt parent directory (if empty)
-		set receipt_dir [file join ${darwinports::registry.path} receipts ${name}]
+		set receipt_dir [file join ${macports::registry.path} receipts ${name}]
 		if { [file isdirectory ${receipt_dir}] } {
 			# 0 item means empty.
 			if { [llength [readdir ${receipt_dir}]] == 0 } {
@@ -415,9 +415,9 @@
 # Note: at some point we need to change these APIs and support something
 # like selecting on the version or selecting variants in any order.
 proc installed {{name ""} {version ""}} {
-	global darwinports::registry.path
+	global macports::registry.path
 
-	set query_path [file join ${darwinports::registry.path} receipts]
+	set query_path [file join ${macports::registry.path} receipts]
 	
 	if { $name == "" } {
 		set query_path [file join ${query_path} *]
@@ -448,19 +448,19 @@
 
 	# append the ports in old HEAD format.
 	if { $name == "" } {
-		set query_path [file join ${darwinports::registry.path} receipts *]
+		set query_path [file join ${macports::registry.path} receipts *]
 	} else {
-		set query_path [file join ${darwinports::registry.path} receipts ${name}-*]
+		set query_path [file join ${macports::registry.path} receipts ${name}-*]
 	}
-	set receiptglob [glob -nocomplain -types f ${query_path}]
-	foreach receipt_file $receiptglob {
+    set receiptglob [glob -nocomplain -types f ${query_path}]
+    foreach receipt_file $receiptglob {
 		set theFileName [file tail $receipt_file]
 
-		# Remark: these regexes do not always work.
-		set theName ""
-		if { $name == "" } {
+    	# Remark: these regexes do not always work.
+   		set theName ""
+    	if { $name == "" } {
 			regexp {^(.*)-(.*)$} $theFileName match theName version
-		} else {
+    	} else {
 			regexp "^($name)-(.*)\$" $theFileName match theName version
 		}
 		
@@ -488,10 +488,10 @@
 # convert from the old format if required.
 #
 proc open_file_map {{readonly 0}} {
-	global darwinports::registry.path
+	global macports::registry.path
 	variable file_map
 
-	set receipt_path [file join ${darwinports::registry.path} receipts]
+	set receipt_path [file join ${macports::registry.path} receipts]
 	set map_file [file join ${receipt_path} file_map]
 
 	# Don't reopen it (it actually would deadlock us), unless it was open r/o.
@@ -679,10 +679,10 @@
 
 # Dependency Map Code
 proc open_dep_map {args} {
-	global darwinports::registry.path
+	global macports::registry.path
 	variable dep_map
 
-	set receipt_path [file join ${darwinports::registry.path} receipts]
+	set receipt_path [file join ${macports::registry.path} receipts]
 
 	set map_file [file join ${receipt_path} dep_map]
 
@@ -693,7 +693,7 @@
 		set dep_map [read $map_handle]
 		close $map_handle
 	} else {
-		set dep_map [list]
+	    set dep_map [list]
 	}
 	if { ![llength $dep_map] > 0 } {
 		set dep_map [list]
@@ -747,10 +747,10 @@
 }
 
 proc write_dep_map {args} {
-	global darwinports::registry.path
+	global macports::registry.path
 	variable dep_map
 
-	set receipt_path [file join ${darwinports::registry.path} receipts]
+	set receipt_path [file join ${macports::registry.path} receipts]
 
 	set map_file [file join ${receipt_path} dep_map]
 
@@ -758,10 +758,10 @@
 	puts $map_handle $dep_map
 	close $map_handle
 
-	# don't both checking for presence, file delete doesn't error if file doesn't exist
-	file delete ${map_file} ${map_file}.bz2
+    # don't both checking for presence, file delete doesn't error if file doesn't exist
+    file delete ${map_file} ${map_file}.bz2
 
-	file rename ${map_file}.tmp ${map_file}
+    file rename ${map_file}.tmp ${map_file}
 
 	if { [file exists ${map_file}] && [file exists ${registry::autoconf::bzip2_path}] && ![info exists registry.nobzip] } {
 		system "${registry::autoconf::bzip2_path} -f ${map_file}"

Modified: trunk/base/src/registry1.0/receipt_sqlite.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_sqlite.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/registry1.0/receipt_sqlite.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -32,7 +32,7 @@
 
 package provide receipt_sqlite 1.0
 
-package require darwinports 1.0
+package require macports 1.0
 
 ##
 # Receipts Code supporting flat-files

Modified: trunk/base/src/registry1.0/registry.tcl
===================================================================
--- trunk/base/src/registry1.0/registry.tcl	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/registry1.0/registry.tcl	2007-06-15 10:11:22 UTC (rev 26177)
@@ -31,7 +31,7 @@
 
 package provide registry 1.0
 
-package require darwinports 1.0
+package require macports 1.0
 package require receipt_flat 1.0
 package require receipt_sqlite 1.0
 package require portimage 1.0
@@ -43,14 +43,14 @@
 # Begin creating a new registry entry for the port version_revision+variant
 # This process assembles the directory name and creates a receipt dlist
 proc new_entry {name version {revision 0} {variants ""} {epoch 0} } {
-	global darwinports::registry.path darwinports::registry.format darwinports::registry.installtype darwinports::prefix
+	global macports::registry.path macports::registry.format macports::registry.installtype macports::prefix
 
 	
 	# Make sure we don't already have an entry in the Registry for this
 	# port version_revision+variants
 	if {![entry_exists $name $version $revision $variants] } {
 
-		set ref [${darwinports::registry.format}::new_entry]
+		set ref [${macports::registry.format}::new_entry]
 
 		property_store $ref name $name
 		property_store $ref version $version
@@ -60,10 +60,10 @@
 		# Trick to have a portable GMT-POSIX epoch-based time.
 		# (because we'll compare this with a file mtime).
 		property_store $ref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
-		property_store $ref installtype ${darwinports::registry.installtype}
-		property_store $ref receipt_f ${darwinports::registry.format}
-		if { ${darwinports::registry.installtype} == "image" } {
-			set imagedir [file join ${darwinports::registry.path} software ${name} ${version}_${revision}${variants}]
+		property_store $ref installtype ${macports::registry.installtype}
+		property_store $ref receipt_f ${macports::registry.format}
+		if { ${macports::registry.installtype} == "image" } {
+			set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
 			property_store $ref imagedir $imagedir
 			property_store $ref active 0
 			property_store $ref compact 0
@@ -78,13 +78,13 @@
 # Check to see if an entry exists in the registry.  This is passed straight 
 # through to the receipts system
 proc entry_exists {name version {revision 0} {variants ""}} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::entry_exists $name $version $revision $variants] 
+	global macports::registry.format
+	return [${macports::registry.format}::entry_exists $name $version $revision $variants] 
 }
 
 # Close the registry... basically wrap the receipts systems's write process
 proc write_entry {ref} {
-	global darwinports::registry.format
+	global macports::registry.format
 	
 	set name [property_retrieve $ref name]
 	set version [property_retrieve $ref version]
@@ -93,49 +93,49 @@
 	set epoch [property_retrieve $ref epoch]
 	set contents [property_retrieve $ref contents]
 
-	${darwinports::registry.format}::write_entry $ref $name $version $revision $variants
+	${macports::registry.format}::write_entry $ref $name $version $revision $variants
 
 }
 
 # Delete an entry from the registry.
 proc delete_entry {ref} {
-	global darwinports::registry.format
+	global macports::registry.format
 	
 	set name [property_retrieve $ref name]
 	set version [property_retrieve $ref version]
 	set revision [property_retrieve $ref revision]
 	set variants [property_retrieve $ref variants]
 	
-	${darwinports::registry.format}::delete_entry $name $version $revision $variants
+	${macports::registry.format}::delete_entry $name $version $revision $variants
 	
 }
 
 # Open a registry entry.
 proc open_entry {name {version 0} {revision 0} {variants ""}} {
-	global darwinports::registry.format
+	global macports::registry.format
 
-	return [${darwinports::registry.format}::open_entry $name $version $revision $variants]
+	return [${macports::registry.format}::open_entry $name $version $revision $variants]
 
 }
 
 # Store a property with the open registry entry.
 proc property_store {ref property value} {
-	global darwinports::registry.format
-	${darwinports::registry.format}::property_store $ref $property $value
+	global macports::registry.format
+	${macports::registry.format}::property_store $ref $property $value
 }
 
 # Retrieve a property from the open registry entry.
 proc property_retrieve {ref property} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::property_retrieve $ref $property]
+	global macports::registry.format
+	return [${macports::registry.format}::property_retrieve $ref $property]
 }
 
 # If only one version of the port is installed, this process returns that
 # version's parts.  Otherwise, it lists the versions installed and exists.
 proc installed {{name ""} {version ""}} {
-	global darwinports::registry.format
+	global macports::registry.format
 
-	set ilist [${darwinports::registry.format}::installed $name $version]
+	set ilist [${macports::registry.format}::installed $name $version]
 	set rlist [list]
 
 	if { [llength $ilist] > 1 } {
@@ -175,9 +175,9 @@
 # Return a list with the active version of a port (or the active versions of
 # all ports if name is "").
 proc active {{name ""}} {
-	global darwinports::registry.format
+	global macports::registry.format
 
-	set ilist [${darwinports::registry.format}::installed $name]
+	set ilist [${macports::registry.format}::installed $name]
 	set rlist [list]
 
 	if { [llength $ilist] > 0 } {
@@ -231,41 +231,41 @@
 
 # File Map Code
 proc open_file_map {args} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::open_file_map $args]
+	global macports::registry.format
+	return [${macports::registry.format}::open_file_map $args]
 }
 
 proc file_registered {file} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::file_registered $file]
+	global macports::registry.format
+	return [${macports::registry.format}::file_registered $file]
 }
 
 proc port_registered {name} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::port_registered $name]
+	global macports::registry.format
+	return [${macports::registry.format}::port_registered $name]
 }
 
 proc register_file {file port} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::register_file $file $port]
+	global macports::registry.format
+	return [${macports::registry.format}::register_file $file $port]
 }
 
 proc register_bulk_files {files port} {
-	global darwinports::registry.format
+	global macports::registry.format
 	open_file_map
-	set r [${darwinports::registry.format}::register_bulk_files $files $port]
+        set r [${macports::registry.format}::register_bulk_files $files $port]
 	write_file_map
 	return $r
 }
 
 proc unregister_file {file} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::unregister_file $file]
+	global macports::registry.format
+	return [${macports::registry.format}::unregister_file $file]
 }
 
 proc write_file_map {args} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::write_file_map $args]
+	global macports::registry.format
+	return [${macports::registry.format}::write_file_map $args]
 }
 
 # Dependency Map Code
@@ -292,8 +292,8 @@
 }
 
 proc open_dep_map {args} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::open_dep_map $args]
+	global macports::registry.format
+	return [${macports::registry.format}::open_dep_map $args]
 }
 
 ##
@@ -350,29 +350,29 @@
 
 # List all ports this one depends on
 proc list_depends {name} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::list_depends $name]
+	global macports::registry.format
+	return [${macports::registry.format}::list_depends $name]
 }
 
 # List all the ports that depend on this port
 proc list_dependents {name} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::list_dependents $name]
+	global macports::registry.format
+	return [${macports::registry.format}::list_dependents $name]
 }
 
 proc register_dep {dep type port} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::register_dep $dep $type $port]
+	global macports::registry.format
+	return [${macports::registry.format}::register_dep $dep $type $port]
 }
 
 proc unregister_dep {dep type port} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::unregister_dep $dep $type $port]
+	global macports::registry.format
+	return [${macports::registry.format}::unregister_dep $dep $type $port]
 }
 
 proc write_dep_map {args} {
-	global darwinports::registry.format
-	return [${darwinports::registry.format}::write_dep_map $args]
+	global macports::registry.format
+	return [${macports::registry.format}::write_dep_map $args]
 }
 
 

Deleted: trunk/base/src/sqlite-3.1.3.diff
===================================================================
--- trunk/base/src/sqlite-3.1.3.diff	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/sqlite-3.1.3.diff	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,45 +0,0 @@
-diff -ru src/sqlite-3.1.3/Makefile.in src/sqlite-3.1.3.mine/Makefile.in
---- src/sqlite-3.1.3/Makefile.in	2005-02-19 19:11:19.000000000 -0500
-+++ src/sqlite-3.1.3.mine/Makefile.in	2007-05-31 17:34:02.000000000 -0400
-@@ -605,7 +605,7 @@
- 	mkdir -p doc
- 	mv $(DOC) doc
- 
--install:	sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
-+dont_install:	sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
- 	$(INSTALL) -d $(DESTDIR)$(libdir)
- 	$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
- 	$(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
-@@ -615,7 +615,7 @@
- 	$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig; 
- 	$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig; 
- 
--tcl_install:	libtclsqlite3.la
-+install:	libtclsqlite3.la
- 	tclsh $(TOP)/tclinstaller.tcl $(VERSION)
- 
- clean:	
-diff -ru src/sqlite-3.1.3/configure src/sqlite-3.1.3.mine/configure
---- src/sqlite-3.1.3/configure	2005-02-19 09:30:48.000000000 -0500
-+++ src/sqlite-3.1.3.mine/configure	2007-05-31 17:39:49.000000000 -0400
-@@ -20343,7 +20343,7 @@
- #########
- # Generate the output files.
- #
--                    ac_config_files="$ac_config_files Makefile sqlite3.pc"
-+                    ac_config_files="$ac_config_files Makefile sqlite3.pc tclinstaller.tcl"
- cat >confcache <<\_ACEOF
- # This file is a shell script that caches the results of configure
- # tests run on this system so they can be shared between configure
-diff -ru src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3.mine/tclinstaller.tcl
---- src/sqlite-3.1.3/tclinstaller.tcl	2005-01-30 17:10:01.000000000 -0500
-+++ src/sqlite-3.1.3.mine/tclinstaller.tcl	2007-05-31 17:33:32.000000000 -0400
-@@ -7,7 +7,7 @@
- set VERSION [lindex $argv 0]
- set LIBFILE .libs/libtclsqlite3[info sharedlibextension]
- if { ![info exists env(DESTDIR)] } { set env(DESTDIR) "" }
--set LIBDIR $env(DESTDIR)[lindex $auto_path 0]
-+set LIBDIR @prefix@/share/darwinports/Tcl
- set LIBNAME [file tail $LIBFILE]
- set LIB $LIBDIR/sqlite3/$LIBNAME
- 

Copied: trunk/base/src/sqlite-3.1.3.diff (from rev 26176, branches/dp2mp-move/base/src/sqlite-3.1.3.diff)
===================================================================
--- trunk/base/src/sqlite-3.1.3.diff	                        (rev 0)
+++ trunk/base/src/sqlite-3.1.3.diff	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,45 @@
+diff -ru src/sqlite-3.1.3/Makefile.in src/sqlite-3.1.3.mine/Makefile.in
+--- src/sqlite-3.1.3/Makefile.in	2005-02-19 19:11:19.000000000 -0500
++++ src/sqlite-3.1.3.mine/Makefile.in	2007-05-31 17:34:02.000000000 -0400
+@@ -605,7 +605,7 @@
+ 	mkdir -p doc
+ 	mv $(DOC) doc
+ 
+-install:	sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
++dont_install:	sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
+ 	$(INSTALL) -d $(DESTDIR)$(libdir)
+ 	$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
+ 	$(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
+@@ -615,7 +615,7 @@
+ 	$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig; 
+ 	$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig; 
+ 
+-tcl_install:	libtclsqlite3.la
++install:	libtclsqlite3.la
+ 	tclsh $(TOP)/tclinstaller.tcl $(VERSION)
+ 
+ clean:	
+diff -ru src/sqlite-3.1.3/configure src/sqlite-3.1.3.mine/configure
+--- src/sqlite-3.1.3/configure	2005-02-19 09:30:48.000000000 -0500
++++ src/sqlite-3.1.3.mine/configure	2007-05-31 17:39:49.000000000 -0400
+@@ -20343,7 +20343,7 @@
+ #########
+ # Generate the output files.
+ #
+-                    ac_config_files="$ac_config_files Makefile sqlite3.pc"
++                    ac_config_files="$ac_config_files Makefile sqlite3.pc tclinstaller.tcl"
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+diff -ru src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3.mine/tclinstaller.tcl
+--- src/sqlite-3.1.3/tclinstaller.tcl	2005-01-30 17:10:01.000000000 -0500
++++ src/sqlite-3.1.3.mine/tclinstaller.tcl	2007-05-31 17:33:32.000000000 -0400
+@@ -7,7 +7,7 @@
+ set VERSION [lindex $argv 0]
+ set LIBFILE .libs/libtclsqlite3[info sharedlibextension]
+ if { ![info exists env(DESTDIR)] } { set env(DESTDIR) "" }
+-set LIBDIR $env(DESTDIR)[lindex $auto_path 0]
++set LIBDIR @prefix@/share/macports/Tcl
+ set LIBNAME [file tail $LIBFILE]
+ set LIB $LIBDIR/sqlite3/$LIBNAME
+ 

Deleted: trunk/base/src/sqlite-3.1.3.tar.gz
===================================================================
(Binary files differ)

Copied: trunk/base/src/sqlite-3.1.3.tar.gz (from rev 26176, branches/dp2mp-move/base/src/sqlite-3.1.3.tar.gz)
===================================================================
(Binary files differ)

Modified: trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.h
===================================================================
--- trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * MPMethodSignatureExtensions.h
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,4 +37,4 @@
 
 unsigned int tclobjc_getarg_typespecifier (NSMethodSignature* signature, unsigned int index);
 const char *tclobjc_getarg_typestring (NSMethodSignature* signature, unsigned int index);
-const char *tclobjc_getreturn_typestring (NSMethodSignature* signature);
\ No newline at end of file
+const char *tclobjc_getreturn_typestring (NSMethodSignature* signature);

Modified: trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.m
===================================================================
--- trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.m	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/MPMethodSignatureExtensions.m	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * MPMethodSignatureExtension.m
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -141,4 +141,4 @@
 	return (type);
 }
 
-#endif
\ No newline at end of file
+#endif

Modified: trunk/base/src/tclobjc1.0/Makefile.in
===================================================================
--- trunk/base/src/tclobjc1.0/Makefile.in	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/Makefile.in	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 OBJS=		tclobjc.o tclobjc_types.o MPMethodSignatureExtensions.o objc_encoding.o
 SHLIB_NAME=	tclobjc${SHLIB_SUFFIX}
-INSTALLDIR=	${DESTDIR}${datadir}/darwinports/Tcl/tclobjc1.0
+INSTALLDIR=	${DESTDIR}${datadir}/macports/Tcl/tclobjc1.0
 export MACOSX_DEPLOYMENT_TARGET=10.3
 
-include ../../Mk/dports.autoconf.mk
-include ../../Mk/dports.tea.mk
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk

Modified: trunk/base/src/tclobjc1.0/objc_encoding.h
===================================================================
--- trunk/base/src/tclobjc1.0/objc_encoding.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/objc_encoding.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * objc_encoding.h
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/tclobjc1.0/objc_encoding.m
===================================================================
--- trunk/base/src/tclobjc1.0/objc_encoding.m	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/objc_encoding.m	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * objc_encoding.m
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/tclobjc1.0/tclobjc.h
===================================================================
--- trunk/base/src/tclobjc1.0/tclobjc.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/tclobjc.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -2,11 +2,11 @@
  * TclObjC.m
  *
  * Authors:
- * 	Keven Van Vechten <kevin at opendarwin.org>
- * 	Landon J. Fuller  <landonf at opendarwin.org>
+ * 	Keven Van Vechten <kvv at apple.com>
+ * 	Landon J. Fuller  <landonf at macports.org>
  *
- * Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2003 Kevin Van Vechten <kvv at apple.com>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * Copyright (c) 2003 Apple Computer, Inc.
  * All rights reserved.
  *

Modified: trunk/base/src/tclobjc1.0/tclobjc.m
===================================================================
--- trunk/base/src/tclobjc1.0/tclobjc.m	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/tclobjc.m	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,8 +1,8 @@
 /*
  * tclobjc.m
  *
- * Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2003 Kevin Van Vechten <kvv at apple.com>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * Copyright (c) 2003 Apple Computer, Inc.
  * All rights reserved.
  *

Modified: trunk/base/src/tclobjc1.0/tclobjc_types.h
===================================================================
--- trunk/base/src/tclobjc1.0/tclobjc_types.h	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/tclobjc_types.h	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * TclObjTypes.h
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/tclobjc1.0/tclobjc_types.m
===================================================================
--- trunk/base/src/tclobjc1.0/tclobjc_types.m	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/src/tclobjc1.0/tclobjc_types.m	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,7 +1,7 @@
 /*
  * TclObjTypes.c
  *
- * Copyright (c) 2004 Landon J. Fuller <landonf at opendarwin.org>
+ * Copyright (c) 2004 Landon J. Fuller <landonf at macports.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: trunk/base/src/thread2.6.diff
===================================================================
(Binary files differ)


Property changes on: trunk/base/src/thread2.6.diff
___________________________________________________________________
Name: svn:mime-type
   - application/octet-stream

Modified: trunk/base/tests/Makefile
===================================================================
--- trunk/base/tests/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,4 +1,4 @@
-include ../Mk/dports.autoconf.mk
+include ../Mk/macports.autoconf.mk
 
 TESTS?=checksums-1 cvs-and-patchsites envvariables site-tags trace universal universal-2 xcodeversion dependencies-c
 
@@ -6,20 +6,20 @@
 
 all:
 
-/tmp/macports-tests/opt/local/etc/ports/sources.conf: sources.conf
+/tmp/macports-tests/opt/local/etc/macports/sources.conf: sources.conf
 	@echo setting up test installation
 	rm -rf /tmp/macports-tests/
-	mkdir -p /tmp/macports-tests/dports
-	mkdir -p /tmp/macports-tests/opt/local/etc/ports/
+	mkdir -p /tmp/macports-tests/ports
+	mkdir -p /tmp/macports-tests/opt/local/etc/macports/
 	mkdir -p /tmp/macports-tests/opt/local/share/
-	mkdir -p /tmp/macports-tests/opt/local/var/db/dports/receipts/
-	mkdir -p /tmp/macports-tests/opt/local/var/db/dports/build/
-	ln -s $(datadir)/darwinports /tmp/macports-tests/opt/local/share/
-	ln -s $(PWD)/test /tmp/macports-tests/dports/
-	cp sources.conf /tmp/macports-tests/opt/local/etc/ports/
+	mkdir -p /tmp/macports-tests/opt/local/var/macports/receipts/
+	mkdir -p /tmp/macports-tests/opt/local/var/macports/build/
+	ln -s $(datadir)/macports /tmp/macports-tests/opt/local/share/
+	ln -s $(PWD)/test /tmp/macports-tests/ports/
+	cp sources.conf /tmp/macports-tests/opt/local/etc/macports/
 
-/tmp/macports-tests/dports/PortIndex: /tmp/macports-tests/opt/local/etc/ports/sources.conf PortIndex
-	cp PortIndex /tmp/macports-tests/dports/PortIndex
+/tmp/macports-tests/ports/PortIndex: /tmp/macports-tests/opt/local/etc/macports/sources.conf PortIndex
+	cp PortIndex /tmp/macports-tests/ports/PortIndex
 
 PortIndex:
 	portindex
@@ -29,10 +29,10 @@
 	rm -f PortIndex
 
 $(bindir)/port:
-	@echo "Please install macports before running these tests"
+	@echo "Please install MacPorts before running these tests"
 	@exit 1
-	
-test: clean /tmp/macports-tests/dports/PortIndex /tmp/macports-tests/opt/local/etc/ports/sources.conf
+
+test: clean /tmp/macports-tests/ports/PortIndex /tmp/macports-tests/opt/local/etc/macports/sources.conf
 	@for testname in $(TESTS); do\
 	    subdir=test/$$testname; \
 		echo ===\> test ${DIRPRFX}$$subdir; \

Modified: trunk/base/tests/sources.conf
===================================================================
--- trunk/base/tests/sources.conf	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/sources.conf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,3 +1,3 @@
 # To enable your local ports repository, uncomment and customize the
-# following line to point at your local dports directory
-file:///tmp/macports-tests/dports
+# following line to point at your local ports directory
+file:///tmp/macports-tests/ports

Modified: trunk/base/tests/test/envvariables/Makefile
===================================================================
--- trunk/base/tests/test/envvariables/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/test/envvariables/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,11 +1,11 @@
-include ../../../Mk/dports.autoconf.mk
+include ../../../Mk/macports.autoconf.mk
 
 .PHONY: test
 
 $(bindir)/port:
 	@echo "Please install MacPorts before running this test"
 	@exit 1
-	
+
 test:
 	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
 	@sh -c "export ENVA=A ; export ENVB=B; \

Modified: trunk/base/tests/test/trace/Makefile
===================================================================
--- trunk/base/tests/test/trace/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/test/trace/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,11 +1,11 @@
-include ../../../Mk/dports.autoconf.mk
+include ../../../Mk/macports.autoconf.mk
 
 .PHONY: test
 
 $(bindir)/port:
 	@echo "Please install MacPorts before running this test"
 	@exit 1
-	
+
 test:
 	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
 	@touch delete-trace

Modified: trunk/base/tests/test/universal/Makefile
===================================================================
--- trunk/base/tests/test/universal/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/test/universal/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,11 +1,11 @@
-include ../../../Mk/dports.autoconf.mk
+include ../../../Mk/macports.autoconf.mk
 
 .PHONY: test
 
 $(bindir)/port:
 	@echo "Please install MacPorts before running this test"
 	@exit 1
-	
+
 test:
 	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
 	@sh -c "export PORTSRC=$(PORTSRC); $(bindir)/port info" > output 2>&1 || (cat output; exit 1)

Modified: trunk/base/tests/test/universal-2/Makefile
===================================================================
--- trunk/base/tests/test/universal-2/Makefile	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/test/universal-2/Makefile	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,11 +1,11 @@
-include ../../../Mk/dports.autoconf.mk
+include ../../../Mk/macports.autoconf.mk
 
 .PHONY: test
 
 $(bindir)/port:
 	@echo "Please install MacPorts before running this test"
 	@exit 1
-	
+
 test:
 	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
 	@sh -c "export PORTSRC=$(PORTSRC); $(bindir)/port info" > output 2>&1 || (cat output; exit 1)

Copied: trunk/base/tests/test-macports.conf (from rev 26176, branches/dp2mp-move/base/tests/test-macports.conf)
===================================================================
--- trunk/base/tests/test-macports.conf	                        (rev 0)
+++ trunk/base/tests/test-macports.conf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -0,0 +1,66 @@
+# MacPorts system wide configuration file, tests module
+# $Id$
+
+# Set the directory in which to install ports
+prefix			/tmp/macports-tests/opt/local
+
+# Where to store MacPorts working data
+portdbpath		/tmp/macports-tests/opt/local/var/macports
+
+# Type of storage to use for the port registry information, "flat" or "sqlite"
+# NOTE: sqlite not yet supported.
+portdbformat		flat
+
+# Type of installation to do for ports, "direct" or "image".  See macports.conf(5) and online documentation.
+portinstalltype		image
+
+# Directory containing the X11 installation.
+x11prefix		/tmp/macports-tests/usr/X11R6
+
+# Where to find the sources list.
+sources_conf		/tmp/macports-tests/opt/local/etc/macports/sources.conf
+
+# Where to find global variants definition file (optional)
+#variants_conf		/opt/local/etc/macports/variants.conf
+
+# Create and use binary archive packages for installation/reinstallation ease
+portarchivemode		no
+
+# Where to store/retrieve ports binary archive files
+portarchivepath		/tmp/macports-tests/opt/local/var/macports/packages
+
+# Type of binary archive packages to create when using archive mode
+#
+# Note: Multiple types ARE allowed and must be a colon or comma
+# separated list of choices (NO spaces). Use of multiple types will
+# cause archive creation to build all the specified types in one step.
+# Unarchive uses multiple types as a search list to locate the archive,
+# first archive to match one of the specified types in order is used.
+#
+# Supported types: tgz (default), tar, tbz, tbz2, xar, zip, cpgz, cpio
+portarchivetype		tbz
+
+# Set whether to automatically execute "clean" after "install" of ports
+portautoclean		yes
+
+# Rsync server to fetch MacPorts sources from
+rsync_server		rsync.macports.org
+
+# Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
+rsync_dir			release/base/
+
+# Rsync options
+rsync_options		-rtzv --delete-after
+
+# Options for generated startup items
+# startupitem_type may be "default", "systemstarter", or "launchd";
+# if the option is empty or "default" then a startupitem type appropriate
+# to the platform will be chosen. Tiger will default to launchd, while
+# older Mac OS X systems will default to systemstarter.
+startupitem_type 	 default
+
+# Extra environment variables to keep. Any variables listed here are added
+# to the list of variables that are not removed from the environment used
+# while processing ports
+# extra_env                     KEEP_THIS THIS_TOO
+extra_env			ENVA ENVB

Deleted: trunk/base/tests/test-ports.conf
===================================================================
--- trunk/base/tests/test-ports.conf	2007-06-15 09:27:18 UTC (rev 26176)
+++ trunk/base/tests/test-ports.conf	2007-06-15 10:11:22 UTC (rev 26177)
@@ -1,56 +0,0 @@
-# Set the directory in which to install ports
-prefix			/tmp/macports-tests/opt/local
-
-# Where to store ports specific database files
-portdbpath		/tmp/macports-tests/opt/local/var/db/dports
-
-# Type of storage to use for the port registry information, "flat" or "sqlite"
-# NOTE: sqlite not yet supported.
-portdbformat		flat
-
-# Type of installation to do for ports, "direct" or "image".  See documentation.
-portinstalltype		image
-
-# Directory containing the X11 installation.
-x11prefix		/tmp/macports-tests/usr/X11R6
-
-# Where to find the sources list.
-sources_conf		/tmp/macports-tests/opt/local/etc/ports/sources.conf
-
-# Where to find global variants definition file (optional)
-#variants_conf		/opt/local/etc/ports/variants.conf
-
-# Create and use binary archive packages for installation/reinstallation ease
-portarchivemode		no
-
-# Where to store/retrieve ports binary archive files
-portarchivepath		/tmp/macports-tests/opt/local/var/db/dports/packages
-
-# Type of binary archive packages to create when using archive mode
-#
-# Note: Multiple types ARE allowed and must be a colon or comma
-# separated list of choices (NO spaces). Use of multiple types will
-# cause archive creation to build all the specified types in one step.
-# Unarchive uses multiple types as a search list to locate the archive,
-# first archive to match one of the specified types in order is used.
-#
-# Supported types: tgz (default), tar, tbz, xar, zip, cpgz, cpio
-portarchivetype		tbz
-
-# Set whether to automatically execute "clean" after "install" of ports
-portautoclean		yes
-
-# Rsync server to use
-rsync_server		rsync.opendarwin.org
-
-# Rsync directory from which to pull the base/ component (infrastructure) of DP
-rsync_dir			dpupdate1/base/
-
-# Rsync options
-rsync_options		"-rtzv --delete --delete-after"
-
-# Extra environment variables to keep. Any variables listed here are added
-# to the list of variables that are not removed from the environment used
-# while processing ports
-# extra_env                     KEEP_THIS THIS_TOO
-extra_env			ENVA ENVB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070615/147a3c3f/attachment.html


More information about the macports-changes mailing list