[Pkg-samba-maint] r3491 - in branches/talloc/experimental: . ABI buildtools buildtools/bin buildtools/mktowscript buildtools/scripts buildtools/wafsamba compat doc lib lib/replace lib/replace/system lib/replace/test script web

jelmer at alioth.debian.org jelmer at alioth.debian.org
Sun May 23 01:43:32 UTC 2010


Author: jelmer
Date: 2010-05-23 01:43:30 +0000 (Sun, 23 May 2010)
New Revision: 3491

Added:
   branches/talloc/experimental/buildtools/
   branches/talloc/experimental/buildtools/bin/
   branches/talloc/experimental/buildtools/bin/README
   branches/talloc/experimental/buildtools/bin/waf
   branches/talloc/experimental/buildtools/bin/waf-svn
   branches/talloc/experimental/buildtools/compare_config_h3.sh
   branches/talloc/experimental/buildtools/compare_config_h4.sh
   branches/talloc/experimental/buildtools/compare_generated.sh
   branches/talloc/experimental/buildtools/compare_install.sh
   branches/talloc/experimental/buildtools/mktowscript/
   branches/talloc/experimental/buildtools/mktowscript/mklist.txt
   branches/talloc/experimental/buildtools/mktowscript/mktowscript.pl
   branches/talloc/experimental/buildtools/mktowscript/rebuild_all.sh
   branches/talloc/experimental/buildtools/scripts/
   branches/talloc/experimental/buildtools/scripts/Makefile.waf
   branches/talloc/experimental/buildtools/scripts/abi_gen.sh
   branches/talloc/experimental/buildtools/scripts/autogen-waf.sh
   branches/talloc/experimental/buildtools/scripts/configure.waf
   branches/talloc/experimental/buildtools/testwaf.sh
   branches/talloc/experimental/buildtools/wafsamba/
   branches/talloc/experimental/buildtools/wafsamba/README
   branches/talloc/experimental/buildtools/wafsamba/gccdeps.py
   branches/talloc/experimental/buildtools/wafsamba/generic_cc.py
   branches/talloc/experimental/buildtools/wafsamba/irixcc.py
   branches/talloc/experimental/buildtools/wafsamba/nothreads.py
   branches/talloc/experimental/buildtools/wafsamba/samba3.py
   branches/talloc/experimental/buildtools/wafsamba/samba_abi.py
   branches/talloc/experimental/buildtools/wafsamba/samba_asn1.py
   branches/talloc/experimental/buildtools/wafsamba/samba_autoconf.py
   branches/talloc/experimental/buildtools/wafsamba/samba_autoproto.py
   branches/talloc/experimental/buildtools/wafsamba/samba_bundled.py
   branches/talloc/experimental/buildtools/wafsamba/samba_conftests.py
   branches/talloc/experimental/buildtools/wafsamba/samba_cross.py
   branches/talloc/experimental/buildtools/wafsamba/samba_deps.py
   branches/talloc/experimental/buildtools/wafsamba/samba_dist.py
   branches/talloc/experimental/buildtools/wafsamba/samba_errtable.py
   branches/talloc/experimental/buildtools/wafsamba/samba_install.py
   branches/talloc/experimental/buildtools/wafsamba/samba_optimisation.py
   branches/talloc/experimental/buildtools/wafsamba/samba_patterns.py
   branches/talloc/experimental/buildtools/wafsamba/samba_pidl.py
   branches/talloc/experimental/buildtools/wafsamba/samba_python.py
   branches/talloc/experimental/buildtools/wafsamba/samba_utils.py
   branches/talloc/experimental/buildtools/wafsamba/samba_wildcard.py
   branches/talloc/experimental/buildtools/wafsamba/tru64cc.py
   branches/talloc/experimental/buildtools/wafsamba/wafsamba.py
   branches/talloc/experimental/buildtools/wafsamba/wscript
   branches/talloc/experimental/lib/
   branches/talloc/experimental/lib/replace/
   branches/talloc/experimental/lib/replace/.checker_innocent
   branches/talloc/experimental/lib/replace/Makefile.in
   branches/talloc/experimental/lib/replace/README
   branches/talloc/experimental/lib/replace/aclocal.m4
   branches/talloc/experimental/lib/replace/autoconf-2.60.m4
   branches/talloc/experimental/lib/replace/autogen-waf.sh
   branches/talloc/experimental/lib/replace/autogen.sh
   branches/talloc/experimental/lib/replace/build_macros.m4
   branches/talloc/experimental/lib/replace/config.guess
   branches/talloc/experimental/lib/replace/config.sub
   branches/talloc/experimental/lib/replace/configure.ac
   branches/talloc/experimental/lib/replace/crypt.c
   branches/talloc/experimental/lib/replace/crypt.m4
   branches/talloc/experimental/lib/replace/dlfcn.c
   branches/talloc/experimental/lib/replace/dlfcn.m4
   branches/talloc/experimental/lib/replace/getaddrinfo.c
   branches/talloc/experimental/lib/replace/getaddrinfo.h
   branches/talloc/experimental/lib/replace/getifaddrs.c
   branches/talloc/experimental/lib/replace/getpass.c
   branches/talloc/experimental/lib/replace/getpass.m4
   branches/talloc/experimental/lib/replace/hdr_replace.h
   branches/talloc/experimental/lib/replace/inet_aton.c
   branches/talloc/experimental/lib/replace/inet_ntoa.c
   branches/talloc/experimental/lib/replace/inet_ntop.c
   branches/talloc/experimental/lib/replace/inet_pton.c
   branches/talloc/experimental/lib/replace/install-sh
   branches/talloc/experimental/lib/replace/libreplace.m4
   branches/talloc/experimental/lib/replace/libreplace_cc.m4
   branches/talloc/experimental/lib/replace/libreplace_ld.m4
   branches/talloc/experimental/lib/replace/libreplace_macros.m4
   branches/talloc/experimental/lib/replace/libreplace_network.m4
   branches/talloc/experimental/lib/replace/repdir.m4
   branches/talloc/experimental/lib/replace/repdir_getdents.c
   branches/talloc/experimental/lib/replace/repdir_getdirentries.c
   branches/talloc/experimental/lib/replace/replace.c
   branches/talloc/experimental/lib/replace/replace.h
   branches/talloc/experimental/lib/replace/samba.m4
   branches/talloc/experimental/lib/replace/snprintf.c
   branches/talloc/experimental/lib/replace/socket.c
   branches/talloc/experimental/lib/replace/socketpair.c
   branches/talloc/experimental/lib/replace/strptime.c
   branches/talloc/experimental/lib/replace/strptime.m4
   branches/talloc/experimental/lib/replace/system/
   branches/talloc/experimental/lib/replace/system/README
   branches/talloc/experimental/lib/replace/system/aio.h
   branches/talloc/experimental/lib/replace/system/capability.h
   branches/talloc/experimental/lib/replace/system/config.m4
   branches/talloc/experimental/lib/replace/system/dir.h
   branches/talloc/experimental/lib/replace/system/filesys.h
   branches/talloc/experimental/lib/replace/system/glob.h
   branches/talloc/experimental/lib/replace/system/iconv.h
   branches/talloc/experimental/lib/replace/system/kerberos.h
   branches/talloc/experimental/lib/replace/system/locale.h
   branches/talloc/experimental/lib/replace/system/network.h
   branches/talloc/experimental/lib/replace/system/passwd.h
   branches/talloc/experimental/lib/replace/system/readline.h
   branches/talloc/experimental/lib/replace/system/select.h
   branches/talloc/experimental/lib/replace/system/shmem.h
   branches/talloc/experimental/lib/replace/system/syslog.h
   branches/talloc/experimental/lib/replace/system/terminal.h
   branches/talloc/experimental/lib/replace/system/time.h
   branches/talloc/experimental/lib/replace/system/wait.h
   branches/talloc/experimental/lib/replace/system/wscript_configure
   branches/talloc/experimental/lib/replace/test/
   branches/talloc/experimental/lib/replace/test/getifaddrs.c
   branches/talloc/experimental/lib/replace/test/main.c
   branches/talloc/experimental/lib/replace/test/os2_delete.c
   branches/talloc/experimental/lib/replace/test/shared_mmap.c
   branches/talloc/experimental/lib/replace/test/snprintf.c
   branches/talloc/experimental/lib/replace/test/strptime.c
   branches/talloc/experimental/lib/replace/test/testsuite.c
   branches/talloc/experimental/lib/replace/timegm.c
   branches/talloc/experimental/lib/replace/timegm.m4
   branches/talloc/experimental/lib/replace/win32.m4
   branches/talloc/experimental/lib/replace/win32_replace.h
   branches/talloc/experimental/lib/replace/wscript
Modified:
   branches/talloc/experimental/ABI/talloc-2.0.2.sigs
   branches/talloc/experimental/ABI/talloc-2.0.3.sigs
   branches/talloc/experimental/Makefile.in
   branches/talloc/experimental/NEWS
   branches/talloc/experimental/aclocal.m4
   branches/talloc/experimental/autogen-waf.sh
   branches/talloc/experimental/autogen.sh
   branches/talloc/experimental/build_macros.m4
   branches/talloc/experimental/compat/talloc_compat1.c
   branches/talloc/experimental/compat/talloc_compat1.m4
   branches/talloc/experimental/compat/talloc_compat1.mk
   branches/talloc/experimental/config.guess
   branches/talloc/experimental/config.mk
   branches/talloc/experimental/config.sub
   branches/talloc/experimental/configure.ac
   branches/talloc/experimental/doc/mainpage.dox
   branches/talloc/experimental/doxy.config
   branches/talloc/experimental/install-sh
   branches/talloc/experimental/libtalloc.m4
   branches/talloc/experimental/pytalloc.c
   branches/talloc/experimental/pytalloc.h
   branches/talloc/experimental/rules.mk
   branches/talloc/experimental/script/abi_checks.sh
   branches/talloc/experimental/script/abi_checks_gcc.sh
   branches/talloc/experimental/script/mksigs.pl
   branches/talloc/experimental/script/mksyms.awk
   branches/talloc/experimental/script/mksyms.sh
   branches/talloc/experimental/script/release-script.sh
   branches/talloc/experimental/talloc.3.xml
   branches/talloc/experimental/talloc.c
   branches/talloc/experimental/talloc.exports
   branches/talloc/experimental/talloc.h
   branches/talloc/experimental/talloc.i
   branches/talloc/experimental/talloc.mk
   branches/talloc/experimental/talloc.pc.in
   branches/talloc/experimental/talloc.signatures
   branches/talloc/experimental/talloc_guide.txt
   branches/talloc/experimental/testsuite.c
   branches/talloc/experimental/testsuite_main.c
   branches/talloc/experimental/web/index.html
   branches/talloc/experimental/wscript
Log:
Import upstream version.

Modified: branches/talloc/experimental/autogen-waf.sh
===================================================================
--- branches/talloc/experimental/autogen-waf.sh	2010-05-23 01:43:21 UTC (rev 3490)
+++ branches/talloc/experimental/autogen-waf.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -1 +1 @@
-link ../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
+link buildtools/scripts/autogen-waf.sh
\ No newline at end of file

Added: branches/talloc/experimental/buildtools/bin/README
===================================================================
--- branches/talloc/experimental/buildtools/bin/README	                        (rev 0)
+++ branches/talloc/experimental/buildtools/bin/README	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,16 @@
+This copy of waf-svn is taken from the git mirror of waf
+at:
+
+  git://git.samba.org/tridge/waf-svn.git
+
+using the waf-samba branch
+
+It was built using the command:
+
+  ./waf-light --zip-type=gz --make-waf
+
+See http://code.google.com/p/waf/ for more information on waf
+
+You can get a svn copy of the upstream source with:
+
+  svn checkout http://waf.googlecode.com/svn/trunk/ waf-read-only

Added: branches/talloc/experimental/buildtools/bin/waf
===================================================================
--- branches/talloc/experimental/buildtools/bin/waf	                        (rev 0)
+++ branches/talloc/experimental/buildtools/bin/waf	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1 @@
+link waf-svn
\ No newline at end of file


Property changes on: branches/talloc/experimental/buildtools/bin/waf
___________________________________________________________________
Added: svn:special
   + *

Added: branches/talloc/experimental/buildtools/bin/waf-svn
===================================================================
--- branches/talloc/experimental/buildtools/bin/waf-svn	                        (rev 0)
+++ branches/talloc/experimental/buildtools/bin/waf-svn	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,162 @@
+#!/usr/bin/env python
+# encoding: ISO8859-1
+# Thomas Nagy, 2005-2010
+
+"""
+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. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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.
+"""
+
+import os, sys
+if sys.hexversion<0x203000f: raise ImportError("Waf requires Python >= 2.3")
+
+if 'PSYCOWAF' in os.environ:
+	try:import psyco;psyco.full()
+	except:pass
+
+VERSION="1.5.17"
+REVISION="164170d221747ffbb50f4a8b9ccc2b2a"
+INSTALL=''
+C1='#*'
+C2='#&'
+cwd = os.getcwd()
+join = os.path.join
+
+WAF='waf'
+def b(x):
+	return x
+
+if sys.hexversion>0x300000f:
+	WAF='waf3'
+	def b(x):
+		return x.encode()
+
+def err(m):
+	print(('\033[91mError: %s\033[0m' % m))
+	sys.exit(1)
+
+def unpack_wafdir(dir):
+	f = open(sys.argv[0],'rb')
+	c = "corrupted waf (%d)"
+	while 1:
+		line = f.readline()
+		if not line: err("run waf-light from a folder containing wafadmin")
+		if line == b('#==>\n'):
+			txt = f.readline()
+			if not txt: err(c % 1)
+			if f.readline()!=b('#<==\n'): err(c % 2)
+			break
+	if not txt: err(c % 3)
+	txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r'))
+
+	import shutil, tarfile
+	try: shutil.rmtree(dir)
+	except OSError: pass
+	try:
+		for x in ['Tools', '3rdparty']:
+			os.makedirs(join(dir, 'wafadmin', x))
+	except OSError:
+		err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
+
+	os.chdir(dir)
+	tmp = 't.gz'
+	t = open(tmp,'wb')
+	t.write(txt)
+	t.close()
+
+	t = None
+	try:
+		t = tarfile.open(tmp)
+	except:
+		try:
+			os.system('gzip -d t.gz')
+			t = tarfile.open('t')
+		except:
+			os.chdir(cwd)
+			try: shutil.rmtree(dir)
+			except OSError: pass
+			err("Waf cannot be unpacked, check that bzip2 support is present")
+
+	for x in t: t.extract(x)
+	t.close()
+
+	for x in ['Tools', '3rdparty']:
+		os.chmod(join('wafadmin',x), 493)
+
+	if sys.hexversion>0x300000f:
+		sys.path = [join(dir, 'wafadmin')] + sys.path
+		import py3kfixes
+		py3kfixes.fixdir(dir)
+
+	os.chdir(cwd)
+
+def test(dir):
+	try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
+	except OSError: pass
+
+def find_lib():
+	name = sys.argv[0]
+	base = os.path.dirname(os.path.abspath(name))
+
+	#devs use $WAFDIR
+	w=test(os.environ.get('WAFDIR', ''))
+	if w: return w
+
+	#waf-light
+	if name.endswith('waf-light'):
+		w = test(base)
+		if w: return w
+		err("waf-light requires wafadmin -> export WAFDIR=/folder")
+
+	dir = "/lib/%s-%s-%s/" % (WAF, VERSION, REVISION)
+	for i in [INSTALL,'/usr','/usr/local','/opt']:
+		w = test(i+dir)
+		if w: return w
+
+	#waf-local
+	s = '.%s-%s-%s'
+	if sys.platform == 'win32': s = s[1:]
+	dir = join(base, s % (WAF, VERSION, REVISION))
+	w = test(dir)
+	if w: return w
+
+	#unpack
+	unpack_wafdir(dir)
+	return dir
+
+wafdir = find_lib()
+w = join(wafdir, 'wafadmin')
+t = join(w, 'Tools')
+f = join(w, '3rdparty')
+sys.path = [w, t, f] + sys.path
+
+if __name__ == '__main__':
+	import Scripting
+	Scripting.prepare(t, cwd, VERSION, wafdir)
+
+#==>
+#‹ùºçKÿtmp-waf-1.5.17.tar ì½k{ÛÖµ ܯâ¯@Øê °`Z’íäNàŽã8©§Ží×rÚ>C³|(”‘ €ÕËüöY×}@JN›öLßäœZľ_Ö^{­µ×åf<O—óüчqyÕ[ßþâ'øïþûüÉúÿÕþ>==9yüøß'_<~üäH?yrüùç¿ŽñOøoSVã"~Q¬VÕ¾rwå×'÷ÿÈ¿ü,x´)‹Gç Y~¬o«ËUÞùeå“Õtž_ôƒM5{øŸùr½*ª ¼-;óþé]fÛë¬(ç«<ø28ÞŸ?9>ž÷ƒY±ZeV•T:˪`\b’6³*“òrSÍ	´”YRŒóéj™LÇUVÍ—YReËõl¾È Ø"Ûv¨Éis9}ª}µ™/¦ÉûMžgEB…’7«i–¼^]”ÉÛu#,¹LѦÙùæ"¹y’Ūà/ l5ÎÍØtÆ‹‹Uu»ÎÒ7oß÷üuçÅÛïÞ½zýrôáåwï^?ÿðrtö›—¯_§av¦Ù,˜Eœ¤¸ß9ÀåLüêÁÏÎÁÍ>/²j\UJ‚pr3#&“àÍ*ÏâÎÁò¡dÊŒf‹qÕ9˜,±ÎÇÿ/8,ͯ ìYµ)ri›MF“Õr	«A¥$€†Ó›iÜÁa5Füæí?lÌX½Z󲊶[lâ Àc^Îi'$&AYq?¶Û!”’¯í¶s°(+èe ©‡¥ùÚ³Ulƒy`#*4ŠÕvNÊø“FàM³u™DôòñtÜ™,Æe ªûnœ/²"ZÿM*7Îd4šçój4ŠÊl1£ÉàÞE±Ú@C8BNÀþËÑ–ÀIœlŠ"Ë«•NýÊ£|¼ÌÊô/ãŽp‹ól[àLØÎ`v)®+ü¼¹„ñùªÂe`†A³/Y9}PÔˆ“8hÖö¼îc¬ëû²¾ð³E™Q›w5¸.V“¬,G´í‹·Ù²,Gé‰Ùû§š8p4žN¹M*Á£åH`”é‡b“Ñ/RÜ¿o©\Ìà†%iè@LcáitÌ£ÐtÓçòp®Æ‹"Ooƒu‘•0Öð3â¶à¿ÃôÂÏë×ë ðB¦[ࢾgOxòPŝü|Úv˜ 5¡Ã„_¤ÍÑA„Çsv¶€X/²¨Þ+·@­ã¨Óþ¸{¼J‰¶)À‘µ Ñ’ƒ°ŠGet!Ý'üÒy!p;}öé·…Úò·‚ŸChS7€Ú÷;—ŽÁý#;6bÛŠ#*ü큦OB-ÝÊYÃ\Ü.J­/­05rD€C©Üylq(°“ž+/³©L\æ]Ã[fì4ôƒóÅ4…Ÿ€àW«¢)<løÑ››“M#š)–‚üP2ào€-ŒFÓùP(ƒÏ,uÓ¦ðPÁoÖŸétƒ•,*±X›Oý½p6Mµ²a~.Ɔ³4äηÄ×Ùl¼YT_Ãp#¼Ób¯èª˜fEKI8»¦ .£zç„]ì•°^•pÃor.‚“@¼ã\æøÖ‡iuq”Ö¶þŒÓÚ ŽlÖÞÿKcVg\¿1ܹG³ä*¹º‰uÌz1ôE®’ _[ÊÖã"«í?w†·¡";w3¦åø*9“µ§®ÇbP;AŠ°ρ&Œâ}·÷Åbu>^J/òé1Ô£|¢!°œç#˜,C&Wçr¼ý!ýîùþ×Û¯ÎÛzMAê‹·o>¼ËÍEX:áy¹­žßŽ gôÃꜧUkš÷üýóׯ_îÕͼº„¡F¨/BË åèB™2cJ½÷ûñì%]¹ÝM~•¯nrê¼€V—nÞîa¤Šc‹&©A‘ÅtîDy'ÛçÁý Ø?mÜ7Îå2Ýö.ÇåesöSw9T„ºí}N‡‚Ñð89¯#&‹2ã!Þ<ѹÔrayÀU#*þ>IªSªºM»só¼·ü±ÚTøð“V'=¢Ò·IDK	Yxʉ·’ˆS½Â©B¾Ð}ô¥÷òR#YÂÍž¶5{ò#›#&,ùûS†ª¹\žÎ¬—iw<«²§™§ÝóúÊèÉCÝhD÷Ãh¿0m4rˆBï»ò(:ò%Ž<î;“¥Ó±¿RîV¢©ð N>u§-ƒîÄiË 6׳#&o™Sq•Ý–;£‡©Øp¾ˆÎÀÝ×¹CFB>Ó…ÕIóæÁJƒùp886$èNÝùÑIbêT§;øÁ4pp#&´ãlïX0l@ë^–‚çÆJ_@ÏŽ]RÖžKo"ÝrÚ ¨ôå¾J?H¥ùPɾ7+î~t'1¹©—V|÷¦lrØÊ(žlÊt‘-a[ñ¾¥O\è#&.4ÖèëÒ_ù䍾ÛdЪ¡þ¹žLÕ´«¸lÃkrp¿ò)4gP^i 	íÐn±§¸Ð´\oY¬Û€…Ûa¼·~!ëèL¨LØ= f€¼e‚r;ÉÖUðÛì–î¡þŽhúnVÕ{H†IÌ¥Yž=Ýd^L6‹qА{ƒiVÑðƒÃ¢{hšò¨xþáB”{ƒ#*D¹E,yׯ“{{(-´pîD#*À j E¤Îó•½hm³DQ¤FΔt¥Ín¢iTÃ`Y§€ô«cùL²ôÚ‘†GX#&,úe{Ñ£Tä<‘Š±‘Nsé(â5]_cÓªOÅ@KIA´±ÝíôÖ'n¼»bIy½.o•Þ3»áf¬[„Á ×-™ƒõP;(°lãPL	*’·¹Ö"9¡Öb“è’–ŸÎU|§B;çÆ´ð?è…Í,ñ²Ô©ÒˆHÓ:«9Y”$žJÎÇeV&ÈÝ2u·Y#Áç7‘@é¸gêÖë)¥Zˆ‡ V‰€…Ôbȸ›jP>lþb<É4;	CG(öY"ÛüôR=ýêÑd8úv¸l,à0Ù£Ñ@JN^Z›\ç`²Z¬Š´ûíû—/ß ]ÖÀÒ‰>ÕS	gƒuO”«3d2ÐÞ À8}½ÿþM‡±¾ÁßFT‘^ÝBóE¢…:âo©„Ÿ&ÅôŠ`ÅW7(%Â|U,Ç‹09‰[ZÁâ@€¦IžÜó¤N±N6©p%áÇücõ,ÝG!äaù·ð°†èD Ø/ò60ÄݤۍcÓ#&ž„‘‡/`	mj„FHŒ@ú¦¢WžÃòcRïPÌ…D÷°4v³•òtò-%±(òÕùõ „BF¸yô•Örk=ûkîuå‹ dòñ9°ül›²¾è€Òè»—Â{ŒsØ›ª˜g×ÀFŽ'—Y£ø7c@õZz±@\å­0ã f;î:“ŒÏ6b‡û	;è)|Õˆ’”xM2̓yÓy	¨âÖfÁÉ=IñI¬Gg¸TZ~Çœ}êf÷䌆)Ïj½•ü]«‹å9çã"MOCö·Ï”^Ìs^r”ṉ̃) þ?ád˜àHñŸÓø>½Ÿ²´1–û Å5ðµ.38›ó¥tèQ¬„%Çy™6íý°šçÑ ïSæ_ió|½©Ê¡Kj>‡­›ŸoªÌân)ô¶øÎ֡̽šç¶BçTÿõ#*„áDÿõK­ñç+,þzË#&ãÏszÿø+ý¨±ê}™$Ø]«ñv½1êôà€´aŒrpxx8>¢‡ÁáaÉÿçIî@ó¬<¼/T”rVb…ƒ›¿’)Ó)SABŸz¸Kéâ—°`^Ò6(Ñ´ƒušw†Oä#Ž£!=2gömÝ°L±l´ý£ÅtËÇšF”“ŸÄr¢flž&úýÈ­;“€1ñ$fxÂ	"ÇEUþuù£ey¡ÄfH¶Ê8Ü>}ñþùÙo^~Ý÷ÎWîŸyÌÆó°O4üòp÷‰“ŠLã|ò×MÜw`Úææ„*hñ»Wgg¯Þ|ëL‹XÎË®Ï eÌe­	•ˆò¡”;²!îFÒ£‰ cj!$2ï&±séx9À½U—rU,JàZÆ@.0‘ßÅ•Å$‡5ŠÍŒh+ñºt{\.WÓ0yûù“'Ê^9¹Ðžtˆ=Ý¿KÁ›ÍqÞµÙéœé´ž;É^ =_G«x‡u|ďZ›¡V½sã2‚F¯Á(@l$8ñÚ”[‹v7jŒ›©·a©èHIiœÌõ¸°=>Ù‹u#&‘dèóiÌä́v–’rƁ³šÎӍ쨓‚#ÜïMJ™.g\5{Ò.±Z1ÁièÅ5îåóIF‹A™ö}¦›â¢ú¤ªîå§0"iÀô®¡8|¡3J	-]}ˆG±Äÿ³[§¶±N‰Ì¶uÈ ï â»]™‘K·É.DÞ#&€hO´ÎÖÞüÛƺ%„bî,nÖ*	ÿªDr“Ïÿ´ÉFò¬ÏÑ‚Y]¬¼™O;ûå2]NŸò›Çf.{›5jhñç®uÝlÔgàŸóŠŸ#*Öæñ¸mÖGÞV«˜rýYºí¡#¯zó©Ön'A¯&m|^p‰,˜²T­ã@'SšÎ/²R´`K£/9<8QÍÈ×mªù:!aCߝM#*-”št•aSÎsÏš{–^ ÕíEj¥ðÃëF2´lÌöcÅ-¾jòéEåvG_50G‹+ ðƒ+deù„ŽD‘2õ„¸(mã¿ÏæùÎZ¹Ú0S¯‰Ì´{ºbdzó‹¸>÷5ÁÞÝWbÏFPŸÚa_$ÅüDlÎ@¶]cE9üAÂb><MÏËX`Ý/‚˜ŸEsK®|öêÛÑ›W¯ÄVûèÓ>ZÖ´	µŽtà¿C‘~ƒº	´¦¬†ÐuÜ óþš¤”Jdž‰#‘IµQ¸;¹m<#*Ð##¼èŒõ©3vØáŸ6óˆVKT Êfԝç×ãÅ|Ê$4HGoߦù`u#&”á|J¯icº•¬=ç;šª ºÌˆ] Í¤;CÈÅ#&©µ~wð•Ð‰Þ<?ûíÕ-ß7oҝD_žÝxïlßUvËɵÇV_Ù5U5")ø 7µ¡èžLŒt`£.ßY´’‡E°Ü”î+ªìΫàþä,$¥1‚‹‡GUð&—øÈ7íZ#*¼&naqðjšÕï-ˆ\)0÷’þ±`m$,ij“’ÃÕ›O‡Ÿ¥²‚æIËDë*ܽ8W.M¡¦+Ú÷l¸Ø™s£?1IP`ùÎWŠœ©»ÑÍåmÔÜ+Þò,>Ku[ûmK*ßg¿}õΈ´š ÀV'ïÚᮤôùE4ZºÌ¶¡ :Ú3k£­Èv8ñ„¼Í];î"··gÎ.¹ü˜°c6]ØË4¬1eÈ“…‡Nx³Zžð:Búï1\^Vgïê'SÄ™±Úç•]q–(#&Á’ÕeZùŠJ´šUs%ýל:;RåiØäƥ”ž`èÎ%ò²mdI)ˆ¿Z®‘S½üÞòjŠ¿# ÐÙ|›¶ÕuÑkû÷ŠeUdY4՝÷™_¹Za/íÇp€ö¦Æ£O¨¸!uP“Õúö´	ˆ	6c	0&¯ÞÒß؇g‚ÜŸÊ\Hæh¸L÷4DæèHÍ#*µSow·^¿Ú±«biš€¾‰Ñç]IÞ~ñôéÎîšÿ¤0þwâ«O†xY¡ê$UdÅ»¿GK$wZw§ùÌú㮽Uñ†Ëäq ˜±nÒŽZq¿7$§BúŠ¿Êå†ù†IœÀ€bÚлeöf#&Oÿž5¨ªN>K«ÓO]ßãnÄ~××'®MDí]cžW0€(„HkƒfEæ‡Ê#¨;(ím‹½-¦dêÐq5æèõÆ#&Ì.¦4f§˜Z(›wÖ¼Ž¶Þ°mž¦>0åcé¸PËt at OȆ#*“ðApF¼m;žÝå8ßÀ·,z%<K=ýe~=/Vù&h€} ç>À^©€Üâ,āÿ;íö8ºXyˆH×`°"PWÇÚ1𡇫Azr¹¥àÓi!¶ìdÇ»›ªÚ¬•Ë2Â’VA‡]CãÌÔ†É`è1FŽ›@0“DœgÀnÃ<²¢´bK€=È2’ØÅ4[ƒf“úXd³Žvœ’-‘x'#&ݪ~'¤Pƒ§I€$60›Ào€KÎoá;£-_lmˆß_#*‡<žNéùg¼`Û.·À'ˆ”ìå7MkMò<û¯6σÉ*¯æ9PGOF…R¾¸æš{øÚÓ¸;tíI×í›ä#&J§;vêÚÌ`×þaÛum·Kµªôû:	GYù(4“¿N¯Å6!íº©}m¥;|AÖæؾC»cÚ¤+q…z¤I&óÉü*Õ*ƒM{ÌM¡¿&Åtkd ¨ ’&箩rÚĘš‹yŽ¸ŸífZlŒVˆ÷­‚ £ŒÓ3ݽB;dÊ´–¾0‚j Š(ÏÉtƒöë|¾ÉœÓÔhún*„º<Ìçöݺe£g B#öhrXƒEÐäÇ­ª§´Ñí‹Gw'ñ#&¬#&¦Öt¶ãîߊ\pŸá~c^ð+ÅBuDéÞsÞ¶ñu$?©71ÜâãA¸GLÄd)YÅøÆÍÁj.S¦ôž¥Ý!92{å<+9ŠÇÞ°hßë`b®9Ö¶‚#üUuÃ^~Wέg±À±Ñ<ðÁW)—sGCÍ'Š½-»Ï;üuØù±Ø””ë4Ò<+·2`üªÇé:µ›hß3snG4h‘g¹‚;0ošHðÇì°Ù‚IÈ\¹×dX`j cpeÉ«¬nKø›mKï@’¤ÿ°É³m4!%Ð	©1¢öY4I¦“ØX¤O'ƒpTl‘]Œ ˧EF‡#*ä¨èF¿~÷åùxrUÂåpùìãÇø¯˜2]-ãâÙÇ_}ü'”›ó²Âï¿à×5æÝÅøÉõg½¿Ž?þ-î&Ðöw<4émãFåe¶X°v)jU‘5ÿ¶*Ãõ"ZŽ«É¥˜QÓo64 %S¨ºÂÝ_uU2ÍL~øþ"4ÈÆžõìD~&ðgÆqü?¤ƒÃ²Û©±t8úTÖ±#&F8ržS°u±ä)™'uè&Ådé¯C„›,³êmq0"œ¸Fý°ðìý‹P!õ¡&3·B2¢JÕ6pD%ºA×¼^—ÅÄ0py¼vÚÆ¡1ºãn?|ûaW·BÞ£_—q¬õk‚¥c9~0"T‰ uƒà7uˆ}u¡;EÜ=äT¼Šamû´îÝÃà :,ã {…	>w¬ä=óMQ¯Tä'i»·ŒÃ·3¡J½a»ïÓÍgOV¤Ç/™2MU‡û|õÓCþ'ƒõ—_þõþõÙ³VØ>ÝÜãe™R¡^	(½ŠBi	·ô|3k}Hu!¿Á&ã˜cQÅ恽MͯëÒ(9¦É}‹²R¸•º‡NM]Mö´¥ØÛ ßqÚ°açùؼ¸í¸Ã¸ßÙëÞëìÕaŽá}FqŸ“ØõN¢éSQÓ>Tz>,†1ôªgñž‡ÖnÚÃÚµÖM#:²a¶8n t—{˜Ã.žpÁ< eí'Z¨ŸULÚqZí)MèԝL˜¦Òã? }?;FÉ’“ö¬%í?þÉ`€ZcÉ>=ã'êpbûú}[öÖ‹q…úŒ 7óüñi(XY4½×-m:šáû.ߎi¥¥pcu˜*Î5=±kÅ6!ÙX„‰ÿ„µ<õÀþäZü¥Ê]µ•Æí‘ÝI÷ìG!$Ï÷o„’M¬:áºØ.6‹{Díó°e˜:F Ž'¾¯Å‰™­¿÷œ;NX°ê_B”^ö©ÍXì>#&2¤†Ã>6$ÅÁ>u¯j´}ß—SãÄhÔ¶ä£ÂM¢Úºµ|N…lVÜ­åòº$CÙ2%8@ùkÌ+B¿“8á9Áí1è1 ¿I5gq3¾-ém-’`e€Þ&³£š‡hòPqËL@áºÑ>D·´‘ruê˜y£Þd;éc5B?v½c»ÌH;#­àHa˜³AÜ,¯÷mw²„.MO¼Y—¤ãIº>±‘TÌKbfgg†s¨¯ÔÎØ©[#[‹-vNù,å]òTÿ¤ÃÅßg÷é¦ìÒ>i¼Š‹i·#àI}VÕF+'`ø'²ò#&%†âD«ˆCk9ëpçÛFæ=B}k]}=ìÒõ„‰¿4‹`¬cu£"5ÁˆÓëÁ¶6ßó@ûlULEøg³vjÛ–3CôŒŠ'·IÈ´•} ÀAA …àd¸þ/šã0ÅR&Ûš—ÅðÛÇñܧ[Ž{@ÐÌú¹ölßáB#óç#*Ëôæ€qÙÚ>ú>ÊŒ<ß^®+ÿ &Œ¦Â˜_”ƒ+Ç>ö\<`ØÔƒqÍÞõ<öàÄ7Ú¡¤C.8àºÀÏàrÖv×!´ØêÉÚ«ü[×VpŸZ¡c~¤ƒD׉¼¥8‘°õÕAmk¥©Ò6%?ok²g³AÛ¶‡_#¬Ú¶Jªp8ΠqBW4›ýÀ×Z…á^©Ðœ2½V`ÃBÎbj¡˜—m>¥…#±±;K·ktþÆ6•5(s÷Åû¶bš-ôDš—ä0¾P:¿øù¿ÿ÷þ»qýÿ~›å?…àýþOŸ|~rZ÷ÿûôôñÏþÿ½ýÿâÝ–¡H9A•%ß—/q9ìÉ÷>N|É4‘\ùîrâ|Ô#*Y at 6* ÖO~…IÛ&ñ¯	Éb3ÆMQÂ=#&l0¤ñLâÖÉò®ï|P–؉¡„°ïéÙÌrs>ïÈß]sÔZg–Ñí	òFñ71G+²`-³b´:ÿáÇ8´pëÿ8oåf†Z¢li÷rØæá‚ÅÆ9ötùZc±Å%Ñ`Ëõ]a\îò]áÎ=U¬× àLãG6¥ŸÀ™Lv{AKÞªÜé“ÄõvÑæââ†lù ÐJëçb‡âŠÀ•­ÜÄm	«“€òJ׾ϛ')d¤$ipL#*ëÞŤyDz¡)ÚÖs\èSƒ.6Á\,ê–†È]òœÙ¥|‡‰q·áÙ5jy"õ/XêÉäã—æÀÙ… #*Ç–ƒ©ÎJ~N–}·”ìä8>:Qú*»M€i Y<zdÐK”j”®ê†Y·»1Þp½¢¸˜è…Úô|ˆÔl3EâÚýR+øn¬fêZ1`<E¬òaùLM¥É€P§1%ûŒÎÍê¸~FxÞ#*Õ„0A6^¤„oiuYeU´Uɶ~¼øŒ4h	ɘ'Äâ8dRûço¬„%['WBº™„õ.‘Áž\À0è5FŠMòH}Ïå”Ib‹Í¥³Ûea÷)E@”CróD‚¶^/n¾÷àè¸Æ“é½¼¦²”æ#&ÂâN˜;EŒª˜á6Σ*LjJ¯#*TG˜®²ÒÚ´ ¦Á¸#*Ù¾á„Ó»Éj#*‹Ì«ðY!œ”ê"1º"lF8ªsõ_d7¤ÃÃwJZ\Ÿi¶žO;jÞ®¤ÏuFžDÁó‚gnº¾£ÂÛ~‹o;hSOàX\^r씲ÙÁHŠ׫µñ ž™þWó°TSÓΑÿ¦¹dÝʔMu}ÔNrjÙÉ冷Þò° £ÿbapkÕ[̼}ugî[«¤5é·»»»(ÆëKÔøƒÕœÜNìÒÑVR¡pm#¡˜Y\Îw­:ªå}’ü¢Ú*AMِ:Q;fï@}_éÚW¦ÛÞé	¢uR¨ÕNP®F8ØúÉ%>(ál{È¢+G¡1ÂfAt8ÃdëMáàZÕq²íÞŠô±‘‹·ÙØ*£óE¨&öNɸś?vÊ´áèÚŒˆÌeO.výZ[ýõ֍%å6±Ž—[A=*_®Vâ¬=ÛV­¦»JÒ ÀpbšûR…˜¦^¯QÑ{£§'K8Uæø§©,& º`o2è¼Áº•Çæve)’~Qtö·šÈ’:‰ïžLåøÅĐÄ=×½˜H	Ž_ÂH/*ŸÆ«Yl»oz<qºùáúANÁLÜõ‡e·$¯ŽÕU&µ)4ã~ÝK×"¦íð‹4aŸ™»’g¼RìÔ˜¯K$µÎ%„óÎB~×ç|h›ÎáðŽy9)æ늏ºôsj¥0ÞÑfõ©íUܹbAÓ9ˉ“û]SY¼V°8Öågn% |U$xÄþ€ëÐÝó¥ÔêEXû`#&kyomí¡Ddì‰döTPí²Æ,Õ- ¢}´šE#*ÔÃKBuW¦û=½ VÝ@	ÚׇA\_VÀŽNƘ#*T…â×…s@½8Ên7Á‘˜lRºØL¯{耟;¤Øu狀„cq௑)ÅOXôÚTe9>*¨y¡ˆE±Q%ž{FÁÝ3ˆ/&df̸ˆf„»ÞD7léeR €#™À<utmi#*±Ò¯£ÈÂSô\ñX~Uà`Ìp²õ‘Ž›(W…ã@xNbŒº›XNí»U¡MÏ-'q:áÙÅJÀ!*Uc&@)†ŠÌÛ¤ðŠ>	ì…›Z‡&ÄgÊ®¹ûBZAT®KЕt•Žîõ~äK‡ww¬h\§µâˆÍ¥×+Æf‚–ßJ}ö«Áu}‘ʯŒ¬#$”¨Ü:´\³ SÇc«£s¶½‡IÆd´]Üï#_U·chÊ	Øõ˜ëTÅ툘g#ñ×ßÄKY«uVT´Â¶¡ÄkÖ¡-ØÀõŽùˆ»«ö‰¸¾°œ9؆kãgÑ	#&œz#¦¤Ä4À¯€Ó@€½œg9ÊUI¯V°]¡r#&øûœ"ªƒù‚3Cô Ï„mtœGµx:lŒhƒ+àUóͯ…ªƒH¦ªµæuMØ«&È Üy²Gõä|†}ϐÂâUüìZc‚W ©î‡žcÍNÒ«Áœ˜¿Süut2´(iv¢¯[†ÙÌN‡þiªâÎÙ‰¿“Ëñœ5£Ò0LXí#&‰ö‘üBþ~ÜÚo!¬úJ_½þþe˜ì¦ÇmúYÐÛýEYlõJísh}¸oþƒëå:5LÁ¹Y :žíšeRšÇ©^?i˜º;•³Z«£V«,Nµ>£VÕ)§ ®Ý®’¨D%EeÕZ©¸¯f›.çÓjâ?|v·¬ÁÃ$®0djE{Áþ¶JåÛ)èbV,!#m¢ímeÑ6¾ÀʝH·3»KÁS†ål6 ‡MSyªãÊidï_ºËjZBÕéuPïvL¢\Qsõs™|d…)$&xPq!tj9/ŒØî¹p(…»ÂȈ׌%\Âÿ€š”0BFIÚÀt±i“ÃÉóùÄ_EBÓÌWyª½rbR¥òA©Ž²í	HƬ‚AáÚHÈËèU ¹ 5ÓÁ±"Ü#Rp”À©F%ÒNzw”NG¬x¨™¯3Lƒ§u|Œ¡/®L£÷lÕ#´¯|üÛ6‰Úµáz…¥[L#&n`(¼”„þƒ$Ý\o z—¸UZ®©'ÔãŽLsǸÝ9;Vàø‰'g2Cw6bÇäœÎGÊU읜Gèü]3t½Æ죎ö‘G®ÒQ»Aߏ!ŠîEÝ(fŽÔqkç9É«3ôšÎ„“zг7Zx90%†"‹s]ï!ËÄšZ5w~£Â…Ýîûâ°Ø2×b¸\mòiŸEs~ÝV_Ûky›ÚqÉÈ¥Ýð¢åÚfN·?2Gn\²ížËéÅ8'?v¼Ž·S]@¦>¸à³\“ââ#ÅÀ]u™M€ØZ­Q¯ÿŸìÄî·Åa³'ô©eÓ˜·.Ñ¢¸<|Æ‘…'U?Ì&#$(#&xµ8åKB,áÈ‚U,gÏ#*ö{E¶\]C_¶†µ:,ä—ûTÜë!Y‹Šù§$8óÉRÞW¢*2æ§1Óª®9C(BflP, üÙPZ˜CHÏåĈÇx DúûõÈ@€WÁF5r_Cš×Ĉ#*·,æ ñ»1†{eÿýD7MÙ{àe@aáwîö90 =F%Cr$[s=€iBtÚÞ'xÑe¦“îiÓîú*êh”1zö¢ëO9<$ðª´cÀ5OÈ‹£¾CTÖ +Ô0åª		çÄM,)Ï(Ö¨"Ñþ¸^š÷ôã`ãƒÛ]h]´PÀn÷ù_¡nÙOÏ!†£Ú,XŒxž1~#&"×í#*÷eçÆ–îu½ÉÞò>4°¨SÒ#&ë¥EÚvÜ(øKÇŒšúQh©ã‹”L]‡>Y]7¥¥-Šeî51ÄùüÜL[*¬Ð÷Y¹YT¥SÎl‹•KK}6‹©×­™æXõ܁ñîo<ÿßþj~4té$TäªË+Q½¹vŒw„~öµ›Ï’®?m28ÝNDK¹%,Ö·AÊé-?KC¿fX»( ê¥bçvi‚Lö§	ß[®¢Zadã’-Mœ²V…ÒéÉ2jŠ•M¾Of^×kQBnkÚÖx:½F8֐Y˜ ¬°?åø_¥>môUQí'P Þ¯ÿÿ=}\×ÿ…ß?ëÿþ·ÒÿýY¿ÿß[ÿÿý=ýêÿwÿ/ž|Þ8ÿOž<ýùüÿëÿCý¤ ‚aµLÐ	hR]b at KèΚt¯¤¦þ¿M¶É´-úè¨Q&¥13IEÿÔ,ê|¢MÁ.s‚oŸ¿KOžvðÎGj3úÞú…6 #&îö U‡=­oa˜¥v½@ÇñWv¾ÓWh%VlÖUrv[VÙòåvÎbu"ùÝg=Üþ")Æù†›}¶B9FÛ8Ñ>Õ‰ZƒsÝ,Š©—Å)èhJË#¿*…w„¶ašºÞ§_¤c#,=Ζ«<:±iHåµÆÉóA.V¢‚Ù0Äz”k*²ç‰#*ôSwÊS•”–9Ä}ŠüÀrŒê9Æ´bíσ%2•= õ£ªÇc®–QJÄFvx‰%†Z¢òِ՘j=h5Œúii3Ùv¬#*ÈTÈ„)tÕ_Ò|°Ëì°TÏŠ¹ÆlëhPsñ¶þò/^¾ûðêí™8Ñ%œßBŠŽâŽáÀj~ï$oÑh»Nl—Ëj,i\¸ÎªkpÍûuc1œæö®ÅîÅptg2gß¿xñòì¬c7”3>ÓœþÞ•¬-$ŸÎwžÙZ·4#&Láù!=µŒN¾YR8Ö¬YY#¤uó„Z~o¡9²nzl´mÈ?-IIVk#&ž[NMÔg)\ÍìÅêÏYî¯rŒ¸E^mòÊA„ªÙ”Bù#*¦X­ÿ°*R'x'Êvs|ølU¶uÝâcÚU}tJ’î÷±£È»6ÊL•„ÔA˜§k®WP*:ö"ÉòüQJÚlj@€uAãRÕMk=ï«Õˆ!9hÎ.Þ3Žàö2²JÎNÝ=r=g“„ö–›Ü¹`&*¶çùǶM˜B<!§”ÓÚQê±%\@áWo3§ËˆâjWËu샨n>ÚƒDÑbáÏHâïÁ(þcñrÝoR;Ž½ÂNÔÕ12>5̥⍊c%åóò2›FÜW¨¨&©ŠÊ406O¸ÔøË®©e10¹-kÊÐi="Ý¿„ܦâwÜÇPuàvý«¯ô«,[Û1ÑÑA¨s29…dKtË»§Ò»”#&ÁæB…8øöBñ—.¤3P´—Ôãä=q¤›_â®×ÎœÊHíaWB¹Fw´±¾Æ¨s›ûïqÎŒAƒG„÷ÁÖ~¥d²¡îIf/õÐ>ÐJw/xø7æo_½{Çþ½f⯛¬&UrÆvÞîw5ú–25aŸÜ•ÒËA»ä £PZ\Ðì[Õ«t÷¼ʉé%òsžF~7‰E΂ˆº#`:Ø„M?h¡œ=Êo'„ Lì9á»Îk:ðOj]5É=÷ñп	2¬|Ú¿Æ%jˆÙ‘›»Á:þ7“ƒù•á-ºKþóùéç5ùÏÓ§Ç'?Ëþ½ý? zRùŒ+“a1Í.á,ðÓõ°þ1úeüà×Ñà¿L‡è%9H?úKþU(Þ’™‡r€ÜsP.Vjâc8¸»I—=Nwã6&KuPRÿM‰ª²åë|f´n\9ÅxêêÃpÃxƒŒþ×Ư²[¥ƒà§óލ«š¾+×ÌãĽ¶×&6·ÓwTv¸¤†™¹1ZÆV€'Ô€±+$ôëVÀÆ£u쑨¦R±ð;	y¬6ÊõÃn	à—¦Xƒñ«û1WOÈÝ€oU÷ÚGã|ý6¶oùØÌЬ¶-ã-¶ÒB®xH•‚x.ºÀ„K2*A®—Q'ÈŽ¹SgoözQâšN0æÆXu;4víFÓlÑ6K´!®ÕSÞumûx`œS OV ´Í·Çó²`M[©³§ˆc3á†ð°ö…ÎÈ~÷üý«ço>pÀ®çÖù„-“–~úm¾~ùÍóï_PßükÇð?ÏnÐöÆE>±I–.ô\Y›²e…H 8ccQ„ÐBÙ”Œ </oêÅKìxù´ÅŸä$t&çØS¯´fùl‰Ÿ’ÉÓH{š:'Z<FjyåŒÏOVÒ¨5­"Ïÿ‚õ¼hõˆcÛˆGFt"F0âÑ.²Ù|27k-çžÊ¦³±ÓÀØ)ÏKkb…´//—›æÜì\Â1äæ¢ôï ?ôÉxi†þ[\¼ßÝ®­»´º± F™×S-#*©¤ÐY”;wAtc÷¯…×°ªq¿îäýbÆ=6#ôVdÿfÀK|ä¥ù'C8ÁQªØ1Q#3t§*{ž#&ÿ©S¥HXT¯ÄôeNjxCQiÈν¤ªõ¸”³§½;A£ŽB-’%QN­\ÖߐL1»ˆÔ)Ý8þPËKs›ì@*ó‘9%Å &jÒÒ×Nini%ÂLÿrœÝ2*vSur?4;~¤«5¨ªuxC7‡7ª%ä¼qYZЧëŒ#KºQ(²ì#&úXÂ(A*£«Ämlp5d],=Y¬Ø³?ö§-s27¦Ìÿ€žX ƒ¢‹™§¦ŽC" fFƒt/ÑóS41†îéÒ„ ð":‡i ]Ditä±H|`Àæ÷­ßÝ@Œ3‹6øØé.½¾yûêÍÙ‡ç¯_Ûè+¡ÝດMÚäNÔ?9_ˆÿЄ#×µ¸µÂk®‡j®û{2`×°À0R.ad|1µµâÙ|YÒ‘-‚ö¹›òœ5íÄ.OPN#õ÷q¡^§¨Ä#*˜ÎÛª»Ý*e.óîüä?ëÛÇW³ù6+ÿñ*@wÈ>üyCþsrzú³üç¿—þŸ‘ÜtP¿€ò-ˆ„¾"Š°-V#*jD‚b’4|@Š¿ÆŠªÒ†½àÃjµ(ƒÇÅîÆê6T§j¾1תìፂ8ҏ‡ÞÆÖ¥×Öú’ŒWÇ;Æ-ú¾@·[OéWhÙ‰l%²‰Ñ-6RŸÆä8Ïê×&)2WÛ*Ñ-ƒ—ÔÌÞW”±É£Šìg­wîL.C)c*ÓŽ1‰"÷ž#fq5’Þƒ	¾m÷Ìa{lâ@Ûá v°>måS4hzlÖ€MúP'æ¥ëwÂ^JØ¡g7œ/6× „V×Y×xØMºç-©qkõç_½J¿€ø÷ñ]k̊ŸûÓ}ݯ{^¹ÒêˆQ#*è%ŸKzëÂ5Š#—@yOð®ÇÃ0iIì¡Uߺ¤cÕ¥X]±>Þ7Ö¥õ·WÉ/Ž´‘¨AžãÊx÷#&8Äæ0>VÂàZë?Ù7ß#&§ZTâÄwçÞµ¦ªçVÞmÓ˸Os&V³µ¡áæš÷kŽŽ¶6!Þr÷o«UåCWcFʍ¡œ|g¸Ä XŸƝ1Ú¦ËÉ|UòÖÖ’À´So%î‡íÃ92>«¡„™ˆg5^„®-×°£LÜÞn·œ_øáÌ»I¨ÀŠÅ|vaÈÝõ=d®D4{bÌ™”X¶à~%õ¸ðþ4 ýé>@Ÿ¼›O®€¥™n–ë󘸘äá	vßž¹#*<k×bB­ÄÄ|1-­7Lôí†u -ØS7¸1¯Ï÷~¡…žøoûˆ#&‚€HÛË-ÇÛ9>àrþç}Í!älí(Åñ€3\…—üF\Ù.v• °‚~ÚJeùbß²ìpZÝ<©®Ûj踵ž{&Ýò;öë?÷#&_í[/‡¶ô{Ýÿµ¯;%r&ˆ̇žjm·½á“ã}#*ãƒ\ÝÂr3A5„p稑Æa,ñÿ,²_+*šÝêCIÛ"¢pìÖA!zÛÉÖ#*ÉWøŽµ…(3‚›¨ŒúµŸ¬Ñd˜VmP£¡²taœ ‹w:L†æ%•Hã¨8‰5‡ˆðG“	ò8’yj2YL©Mê8/ñˆ-5ÃæA#§>1‰ìí›SŸšT´D,>÷jr#*Lÿ¢6<æL$ó?k™‹ùù©äýW}^«|6¿MtÚÇñϦLMþ_wè'èc?ÿÿ“/êö?§¶ÿù7×ÿ@ ¬(òURd	"Ääb’ CAååðÙ I!€ÄôGS×”ˆ­k¾d°=["8%yƒ^ŸÎÈÓZ±ó"Ë!GîlMjv)¨œ=ÿÝ˯GÏ?|x–†7¸$Őuôׄ­LTª ßð>/˜O‰+X¤ƒÎ0I)‰ :´lêï>ì°ïÅêg×Dg8÷AT£íZ‘âžß¸oÂÃ2mª:®F´8‘:Hôt›Ä@|#³1±Ó~¨R¡ª¼j1±FQ	ê ú¨rì¶ê»q|·âòxž°­òÄÏNEÈyóÐUWXój<hó1b¿[*K¡)E®ÈVËÕ€¾B:¨æ.Ì×­9P#&PU…žÏBM#*)À?Ák)¤PLþPEčԹµ;`’ ¥¡Ôì:t˜òfQö—¤/Jbê$9ƒ¥o÷1d+˜¿Ñ—¦ð±W	,€£âL~ì4p ˜4äñH°HÍâd­Û1¦_ ÷Ým%P-_­@í#*¹8P¥:ŒuaZWÃ:âþŽ¬V¾6kh‚Dlðõ²ê$aô'ðH##*gìù®à.ÌE*ù€Ó‰a›ŒŸMG³ÕbŠÚ°6ˆqñJgd«H0†ÍFÌÒ‚vNò…°>›CFzÑN®yvÆèºM®-œr+Ž¥&d ä»1m ÜÈÝŒÍX¬.¼EFë%²õÒñjC͘~Fx=ôÞ˜÷=Q…abS*µ?›™€ ß,2`غØR·µ‹¦¨Ä¦­Dx-VI­wzÔð[ßzÑ`Z½¿œŽðé)ƒq!f#&›5kŽqpž±æiXBõdjúK=O‘Òå@ìÞ/B#è1Nô·UAŠ^½eöû홹²šJHè;¿„Bi„Ã/óò¿{ùþìÕÛ7ûßüN(“弄+crùYPd<ŒwR]fè›çÐ(6±nì=p•áÐQÊØ\ùàAåêX]LÐzsE;*E¹ŒÂ؁ÂÔ&­m²g}!‚ÿæ""rI¾þê›W¯_ÆIXœ‡ŽA†Y»—o¿qÏ:šÖQµO£Rùk¡Þ£qç¤/ÆÆì$¬…ëuhž~é{ŸÁÒª#&æ4¡—q>#ý€à† }è1mòK'àV!bÖwÞQh²\·žFÆ×™s9øÛd†ïîS·mß®MÏÓýûäéOLϏÂ^µ\‡À’óîÑF}ŽÆºÉBµ1Ù-l¨ApÔÜ®ŒPƒp”þä¤õLV¨ý€É*—ßµF‚™>YdcÇ<Ûß[ÊÐ*Yv]GÎWÖ+õ!ÙÇ9]¶~Øë±Né‹o¾ᢟÉ9µ‘#&ähuš¥¾^Õ2X†‚Q¤±ki2)¨?‰l„û`ˆ‚RW@*bjË4uò$ÓAµNs;öuá:M	à¾~õ^5 l¯S5îvK~õý«×_;±§#&[gÒ÷£î¹°lÄu4«/ÐüÀ±Ÿ®Á‘,¾®„«ÌÐk¦änOì+m‘¥VÒ¤i|b¥F¢üåo#*Ÿb(°B9Û…Qfj›òÒ"#&Eœ¥“l꯮‚C–HKÓ›h•í+«‡û耵-^å}dµË#*ˆ¾BD£„˜Éáv‰Ôz¹*F«Üñp¯#*³YÜXtúµ©ÐÚ	M2ÓJ /Ž”ƒ¹IÏáÕ KÕXRÚÊyórîHsñ#*;»æÁêÁ8{pŸž}ÿ¦!s’eöš“1Ìá[z¡³Ó€iÞ–³wÖß×µªuÙIgõXTCoyk/Š qÅ£©è³»£ÙÜ1|¡w¾dï|³¥C¿<6aÄY¡Ù÷œfØY2àôΔH4&®0>j`8l<#*Ê¥«,H_n01Ž¦f‡që…&ߦ·ëÎ#&oãgOÜÉv C-wz—BícÏýaåqµ„gS»Ä-ÚzN+||Ja˜²?VdR;ìd¡úŽJñ.Ùs#*Ž¢ºÈH®â4=VéEªâx3˲;:É‹’Z&F_¼ú1uk› WZ£=×ÎÀ‡e=ú¶˜³dbGjûÉ`˜mØ5V$¥éB=w†"• ß$ÂsáÝ9ú'ì†Zyí^eÔè*orkց¼ªMylY“"L,³Õ#™lšÒŸÞË7o_¾ù°Ñú`Y©àf,š”ÑSlò {3žÙÄn0›eõYXãáÊÉÔƒ³»[f`BÐ÷ª¸EøÈ–ë궿—×S—Ø.ª{=«>öâù‹ß¼}ÿÍ7¯þ $ҏdé•žO;üôâqó:z!8ž+Xq9ñf:7æSeôi„ól'áœÝ´Es\ãÎâšÿËqyi]ô"e%´P5ŽÕç6•üd‘nwÂ>´±ÿ {$Ýrog¯¾½yõÚ‰_¨$ãÀSÓt(ì«Öe@–¹1ÑÏvÓ1µÐÃ*[ÚÕ†²Í6Œ_ÙF7Æ0NÔŽ?Ð?xy’Ä°ÖÚÔ7Ä Ò¾ÙÅczß^̵ÉØ‹ã¨>*8¯¯Ý*u*ßznÆÐ4‚Wù£rw°B0À¢Î5’.õߍûüݳ35DŠÕ;I•y¥V€&¶ž~[ÑçÝgA&ì#&£maÒI0¡\=E1#,íèS§Vc#*%ÀØ2Ò…vX„‰S§/ÃÉ:‚ÖZÚøLÓ]|Iq=±ÂµGƒiw×Êz`A?Éœ¶ÜqHGôÐŒ(“F‘²{#q¤ ˆå/±¡$ޕύžXÙ¥ 	¿J—Œ=q¶a2±hÊÙ{õ³TÉN'9Ïf¾zÈÓ%µ„Á—Ã=ñ»óµC¤' Nì¸vÞu_>ˆ+úwJ]¶CGö„TNÐðÄ(Çñ¸ÓÀQ°%EftºØ©<^ãi€ª>XÎ)vyΠ’ÖˆE1F•fÚñ¥K-ÇW‘,äNá”;EA™}7 ã½§h;j¿BÙ“‡TÀ6Íxô]ëCGwææSqËä‡Êm­=¨ÕÚçAƒE%öBFþ[€Ì	ã¾¼ÍjŠ×¿nãtÄi#oá0-Æ>¦¦ix3ÏŸ†~l_ÖU/ên#Νå›(Èó	N§‰¸e“ÝŠ,ÜñŽÔ\!Ž)ɸ¦FûÞõ÷é=j¸HÇ}ÆÇ#&‰¢~Í£kÝzl¥%ƒhƒ-#&Ë£†¶>`¦/DÚœï¤lÙa¿áxÐz€Œÿ`jlûÈ[ÜMDbáa½3ßa"¾;ãtGc¸.#Ç#;¤æ²#&x°òå‰/c½Ìæ—Ì_žúÀâd.ÚóŠƒÊËÓg—'#*zãRùž	 ÃÕ9ÑS^ž’·²†tÀ#&#*$'ÞÐî¥-ï<›s†ødK¤jò`ÁϸŠúúGPÁ;”‰6®w‰{«íº¢l„]é°'Æ–§;shê‚`Û(NÔOÙÁT-ÙD´ëHËaö-ƒm6ÛøOÙ{LÝkGm•¿¸ÞB‰ä‘í„Ù1¬f®[”åæ”S*ØlŽ £Ö\âA];£læù…è%¸ò§f6Vs†ÝˆZ04A„ƨ¬,˜ÏtYDfãiS5ÛÂCFÒói‰¹PJhw{‡m݆‡»ð½,—býœaÖëՐüœG͈m8þô” Y­rØoŒU«ÑjFC‹4<lè¸7ÑŠÆÆÔêZÕ8{Š‹r/6,Åûå¿jÕ?¢üw3^à3àÅ,ŸÜ*Ø8Æ°kH™5Õ¢›ŒB>1x$8ƒ-XãsÍcš!?ô×®x5ZÚSŠèÞf—¿oòÉ¥=NžxËóy4Zä{½š˜Rm<»r¹ÒÏ»P,VçfÑ«¬ÈRnv,åë‡Ò‘gZ#&@Ô²¢Nø!ì¨G½ae5X”NcÑûÒ¾ùÞභÔ+?ã'@šiœŠÒYó<ˆ˜̐wÔPm-L´Ðɺd"uÝù8/¶Üƒ+ç¸xU­TµYßö¡(ãÁÃBŠB&–8EÄÂpê|.¦[#*¶5Ÿ²dê?L‰_Z¾úÑ ê·ùƒ‰ÈŠ>š_ÆCZº±ðÓÔƒ,œ!éõXz¶.p"ý€üZ¡Û²*Y4tļ‰ã캤šTŒ Vç?8xHë;ˆ´M$m¹‹*ýWK„UºõmåŽÂQhr4¥˜¯«#¡(ÓmÝ祐Á¶yËFÒ%§˜”jžHmZÀ8Ò’"O¼Na n]wÆÄÐ];žuí¨y´jÙa#*7f~D..§Hi”žÓh/P‘ëÄ8p£©ê<÷̏|uc_ïГsw[cÞñÍQcéÑÁm6#&ð¦!¿.æA^ûÜWÀ–÷i#&®ÇWŠßêÁ€i£¢î%•Dòd|óúÕYøÏ#)½GMR Pi%î ÀÂ$4¡?MõÔùÝН¢{ou	qÚX~§ÑD¶@^ñÏðASg<pª˜{­¶\á\mÚ~ÄÒ›×Ö/‰OH¡4§«Œ™J¢¾º‡Në¼%«‘,dýy×︶"æõu«¾}M;:¯9FŽ‹;-a¥òÈéã{VIV•š‹tW	ßvcø>ìçmšm2Z×Y•î³8?)º”÷®QðÁÄkr>öBe¸4…bñpp,OátÿË#¿A°Üju“\_Vaª}J­“Âé@3#*Œ6þ™ã‹äŽ3#&Ì\±ª–°V.ŦÚ‹õˆ?ŠÙcÝbât«Ö"ª $rø¼.J<Àç¼Ñ®w¥gùøóQ¸Ý\*Êü.¼Ó4Ôèg¾xc>Ý9ˆŸøӁ˜ÐÙ…òvÛ¹½k=õµ }d;€M>ìŽÍ÷ßÓÆRøLÚWü`æ« ÜL.±}îL č8ì‹N´¼sþÖ³„p'“Õâÿá9¹éGÂ’ÝsÇƧ 0Ýjä§6yrY¼B‡Oˆe JCIdT&itr|Ü{@½Ç¨œk5–¶ˆ]Œ×%ºÝª$‚ŠÄÇ”iwpxx8>¢‡ðQžN鿾áÝÃ(OòdÎJŒ‹lV¥³ã×溞ðt‘°Bqab}ü¿!êr`’)Kg|h:´(¦uì‡QcñÑéüÀfœß§Bá`Å/¿èS›_=)éÀR¥·4ñÃÒ…+Ò(LÃTô(|ƽÅ€4¬@NÒŒ§xô6AÍ”CVu•ã–­¼0n[\U-|„Hª‹*™\âJß~þä‰÷aµ±ž»šu’Žã¤<§¬NP¤Æ„.”(.«S“#*½ß)kPíÐ,Ô-Vž³uj¾øف³Ñd?Õ\üÐ#]³—B‰âݶcÏÝúÂNd¶ðÈIÈwÅ»ê>Põ6#*È^¢àaÉ/yÐ2.ol<ôYÍW]‘ª®6j(öÐã4’íâE#=<ضÈl Û ÷àÉ(Û–>R©æëK„ßH`_Ÿ¨:O[ibxaâ «`e#*D£•‹¼äIŠC´êêzÝ?^ñ®iÉ×4¦z’kVá®]H¬;IÑSú¬EO©=x¹éÍCŸÃó8rc”Øçf\äö…_`X4â…U6 ÛƒVŠÛ 5Š‚‡××hoC: °ÚK!ŸÚL-š}Úx}( <G5@qFwq%Ë7÷±È¦®ëô¢ûÇhðüáÿ?üó°ÿzðè#ü7|Ðu¡neGèˆrKW%E”*úê)³ÇzK∐ü_ºÎc•–1`œA<#*>˱ԥ2ÀdÕÏR`riTèW©ä{Fà>›bcÈ/kéØÁÊšæ©ÐŸöÙãÌÉEé5¸"”EíЋ“î<geÆõ¸€}ƒû¬ëÒâµµ”UÆÔ<†ÛYǜ޶ÕÖkÇ%‚Ç8|Päx>Âá¡Y ,Áû0¹Ì&W´næ]ø&àmm¸Ah‘£ðÑv»#&}fzi--¡o³1ÎÕiä´#àô'W¬„ž BÖ¿tÝSÔ#&³FWLäô¾LŒç‰1¸WáŠhÙ&m‘Bm+ÅUé±ÈkYVȉ÷³Š£•žê9:ŠT¡dŽÐ)o1…	ëõ[Åp‘y~Tî-ƒQG"¦:zœõ÷ùæb±Š#*¯Wí¹Ãs‹îÌûÈÃtÃòœØÈ«Ž_h:ØÆ>¯=ÅïUíq†,‡4³NcAn­ÿlàMÕ¹¦{ÅAß“íÞF-×?²÷pŠ›œÄv‡e$“/Àªô•tyÇòøãmìz]Ý^[‹ãújÜÑOîh#&X׍5³&×(áÀÍlµ¡âd'}`tqÔÞ#µ’>ö»¨è5ê§#&yýËñÔnMº›Ë¬È€ønW›à_ó˜:,~DðOÌ$7ÍÏÜ´w ¼OÀê€3õå>.úh –y‹?sbíDBr*YuбNƒm‡k¨>t8¶ŠÍì…¼³lÿQ§Y§j3Π¡¾]{övYT`wÌIS‡Þón—huÚ n°kÐ|m´<,Z8>ãÇØ0)»Á«ÌÂ2ÁJ›ÐBf»Ø´H±´r"ú`#*a¦Üg|-…Q ß¾õ‘Ï^í4èTŠM6”ø#&R…E>ùZä0#&»+¥<6X@çØ=(Ö,½ ŒGÞÂºíµŠ%$_£Vn³	ŠÉ—på3(N–Sû¸,¢Ã‚løú„—@Ê‹%Öp÷q±ºpc9]X?õè¢^#*“1dŠ1–s¤Œê.æ†Þ#&ÉCŠË†Z¯)j1p·fž§Z½]aè,ŽY•OJljC±³x3#*…gÌK1KV×­Ý ê —eUÆñ—}ú,2´EÍð¸”â("´;Fšmäµ#KÁ8%϶âJOÕW—]-¦¤ïGå$7Ö0§è#&n•%šzÌþƒônÖõ/d¿Õç®'Õ–þ;ÿljýê×â\‡VË‹àOË ÍHhmB–FƒÚµÄ ±ÞÙ¸ºjo]s[šGˆÞ¹-ô¯däðÞàtS¨ÄÎcàUIXxèt%CÙÙWÝ·Ñ}:Ó:^o›ˆàËl´_Ì'véÈÙÐxq±B׸ìzè»çx÷üýóׯ_¾Öx“y;—ȶU1žT”b#C»‚Ø-™zNªlzl1¿ÔZN9;{gûålú¿[ÌËŸÿkñÿHtïOâþñÿOOŽëþŸ<þÙÿã¿¿ÿÇYNΙÐ$¾~h.{g4Ž;ß¿ùúå7¯Þ¼ü:=î|ýê}zÒASô´CºÍéãâWÔÂAUžü"ý‹©Ðïnò«n‚îUºpÅv²ñè¡ÚMXW¾Ww÷o5ЂRþeö.æUÐ;ÿsô./‚^y£ï>¼	FÓq1)ƒ¿;Î^¼8³^á¾Xl¦Rݶt>ø?Á/ü2èýòApøà0èØøü"_³Ò›\—òóº,¯QÅq2	z_ŸÎЫz³ý"»€á…açÁƒGþþ­ãè ÿ@ô5¢/§üyô€lø…SпRÀŽ‚ŠÃÄõ¯¶ ƒ×¿N’mWMÿjËù#	¸–úW“heí/­j–æÌ>ÛMíÝŠd•ÜštçSt›NÊñíq\IÆÃÅI]Ÿ<اv,=Ʋ#É9AÿRc‚R‹@  eÜ	¥O¬?Át_A3„Ž±ÂॾLíÓlLŒYîŸ#­‹TÂpÁ=öóde\=–¤Þ…vòÜ ?kÁxA‘½7sÖJ8üÕ÷zÅvvd`¢7ÑCº®:º¯rËÒwš²_ŽÈYÞĬ}"Ë—8‹“³5—»Ü_WË›ˆVî t<þ“!w$,š.”©þ;úk†¶ú„ÉíˆÆëEÊò7BuËþ£GôÒí£Åtô‡Ü—k6ÆÝÙÚëÏ•ÿè`LaÒ»¾Ó!ÁvBR™1	hÝüzS¬ØÁЧ84dC‘{ù1$õ˜ûdØ	—ª ›rIå¨æÊiOª‡µJ†§unèWí¶Ëó,Œƒ}Ãúq-áu6t"É饈¯I‘ÖÊ۬ʜ´ˆbWYÙ:b‹&æeˆƒÌû(µëD«%•8ÙU=mý£ ëû~ðlìO0¦îHM¾‹ƒ1&	žøßÓŒŽ{ë+”8îŒÓôD|fº„#&Òq’­è_§úú<e$«&	\·©þM%VÒrtÄ¡‰¼wuŒi‘sìXR‘h£?<]ÒŽuˆ‡{ŒË¿{Fom=¿1Þ¸«"ËZ®ÙNÃ×l38–	̧Ã~CƒO5üP>úÆ*‚JûÊÊ7#*6åME ¿1’õæà^À‰úš¤)¸æÏ6E{äҁGJu Òqíò3HÞ#&’Ÿy`Øz1Õ–U^\Æ|~áŠqÀþ'8	CÇl×@ÌÂ-†ªWá£Ð:"wåèögµC#&4Þ‰‰Ìýðwî¸è$ëþÖ<–X™këfIå˜5¹³k#&xìl¿¤ôjnªE“"W_˜žGôŒïÊ戄½ðŽ|S@¦Zj^Ùa[d¤Åqb;!ŽµO¹d-½¢¢6N¡‰¬Œu'&ےﱚ8‚CÇv€Î&;vZl¶Bh#&ãQh’äe>õq^ÃËtJx4ŸºÞ…KÚ^Èä‘ÍÑÛh Pw+Ztšˆ3ÙùÈ[Z=ÄjÔKšžšåœaIúa,@Ïž+%ê$jÏ…V—ýSFPÖUaÍT|=[DK–µVSÔ¯@Êzð;ýÀüsÂ¿üxÖñÍß}^ï»Å­ÛbhèJpœ+ìÖõVB¢v×¹.¼[XÉ<¿Þ}#&·½°êã°E7Ü#&d^÷ºÍk¾L¯ªwUÜ«ºÞF|#*±àheüø¹ÅT[,^°ÜµïòDç;]Y»ßu_*êÅuª²¶ªQk¨m¤X@rPMÑzÙÓ´RG®Œ#u#’{d‚0D%+²æc:/ltë¾cP½J}yÜw–°×l”P i].^	¬*z”‰ÿ8®c0›O8 ú¯oŒ|ó)c¶rU¤ž»§¡­K=þ㤛¾8Ç‰,<Œ÷W:DuTij’UÔ“ˆ7&CE•´*¦ÓÕsð€YP۟罧±¼l6MNÈÓTk«ÕœëÇgì*䵬%™^?¹}œÒ®¦ë°¬qé‰ÐpÂþ°ñü|’9W¢§æ½›µ\ä)ñbu#H£d„5ž“w›¹9Mv€ö¸QóªÙQ«—xèI£iª«F•ªD]3ºtüÕè£W¼;Φž±ÙLÎþ„ã¡™ÒšöQ8,ˆŽ[—»nNàéí^ÏãÚâyK"~"xÜÖ¿¤Nôz¼HɼK¦Ã3IÝ“EØÖNš'Ï-¤g „kZ¤÷uéUCrÄX¤ì{”ªåX<Eì$ÿ]'Æ{¡9²sUAK}ëÂJ=—&seÊâ2r‘:€èNÃ'W„ç-»åÔu˜l ÚÝB|dDàþMõܼ[ÏT³Ã嵬àn·QFí¦î<ÅoÀ¢¸]±g‹Tú.^€4¹D+â½bXâxWLä¹3¾"ŽªW ¼§î®ž‰ënÃt#&úWÃ#hÆsÓ£™’áyºáå®KˆøIG<ÙÏ—Z[rŽ)Ö„å¹WÍsÖxªÕ<«ò”V-}eL]7¾dØ`U#&9¶•”¶›'¹ëÔm†ëv;àŽ~¬Éc›ø]åX}GAö|³ƒ÷š¦y¹óôwçÇ-8eª#*b¹Ùâ æPZ^_î#_‘YŸZÚƒø`iknÁ»€–v3›Í·¶êUºo£cûÔçÚ¸eƒ«þÐ!™É¶f¾\[“`Ò C´üÍêèÇx‚¼{6!-k¸ÝI#&¿`SÈ¿LOŸÒ¸ü'Õ¶”‘Ìžãµî”X‹´yë$§7‹3²šå½Ë:ù¯$5s–©kc\LX£2Zç8·ól15/žíŒß)qZ+éÇmú³Tg©—†º‚Ž¤0’§Z¯æFÕMhLœ‹è®X‰™	m9Š	î<nº»ßf«í.돇'¶?åUÃ*iÿHïÞ£;…;VûS—û_ºXsºšÎ9[žeëN9ÓÝsòœ\¸n<½¯öd<i¶B=?OœU«õ«Jü<ÕP#*73Ï‘ËIáƒp´}¸jL‰Qcršvà ¶§t°L2[@=kÈ ‚»‚‚9¨‹Tã¹}ÈÞmdÅœ;Êòd|ËENä·–lNäpd:S¿„I× Nî^ÏN»#&P’B,PÃ6ü«¸õäï/©‰GÃ÷ÓÏâÇ´¦f µÆ…ùãó¾{fòÿÀ®#&_ówŸV!ŠÌ¥t™ÈlÔˆuge‡m^ÆècǸxô\Ô«Íü#*»‡G at SQý?9S!“ŠÞ™9O–IƏ0quúØÆ‹NÄP:ˆÝ¤<æ„IøàA¨€Ht#œ§x‡ÑniDv5^Nh¤­csÿšÆÖcŸ‰ƒ‚ɲ·Û£Ç ±N¡ñ°¦Uaï6Ò£EÏXÔ¢³«”QÔ…5T„sÕòr•^Ùaö`”ƒÞ0ŒmÒHê=pS~)êZê‡<,^µtèxA¸Š‘‘æbI÷–ùg!«B`?ÇEþZÃœéfʽ[Ö,¾ëA…e®°áÞÂ8ã0þŒ[äû*³œ{t*£Æ£˜ÓÎà´?lnÒBƒa\WK»µVO¤ÕÆBñY6HBÀ5‡äÔ]CÌRo\y‘ýÐÌ4ºƒ!.+”#*›âeÍ)LI°ÀPÇ §šn=@usïŽ"e]	„Ž˼ýMsŒÓ:¥€[Š·ÃTʼµæÔacM„à“D² ²Ú\#›¦<yÉtÈ3êf?y&Ä–6å Ïuƒ¸u§Öû½È¼–•k§øt¬TÝ%·›ôö¢­”ƒBnA´A1;T GÒlZÉ@¼×¤ŽÏv…5 at 218,4í€'øíÐŽ=n'±Á9z‰fQõ½Î’\Kx_ʼn|à5Õi±^ixq‡‰#&‡ù¸¿7kôŸ*O©®ˆ ÕKMÇwö‰[¢~ßœ°Ï6Õk€*CMõj¦ÓÍlúlkôÃî£áa8j‹Þm>é>­Aòòîzn«ÙˆW¢•…Äs¯yF¤Æ§Š£®DN=\åÆé9#&W½³Ñ«³÷/¿à.áï£ïÞ~ýr¨ÕäÊ!Éä•k(A1Ñ€i™Í®`añî7åñŸ£ajìSzNl2~£ÐYÛ²kVŽ’ŸÁžÞ„XkOF[z÷ûºTgÀvÐ5F›H}1ò³ßÿßíÿÔuàO`¸ßþïäñ㧟×íÿ>?}ú³ýß+û¿šå|%h6Q&U¶\“;‘ÕºZàô¥$ú¯Kè#*ìE Á—bø 3YNË4D‰o‚v²Ž¬	OL¹Æ=X@¾6Hµƒþ¡Ok-'ž#&ÈLÊ:ߏâóÆÅyaE€@#&‚?«É•º'¯LÂüþù7¯ß¾ø-²›Xæá#&G«Ö“"àÒí‰â~–ô¢AئØ²‡dæçÝé^#0ã'…éŠM.æ—p?ÖŒ4›– Ÿ‘ÒyâχÅ&/ÂÿO{k¸¾YxiñäùW¯âºÛ¨P±^¥ƒð²ªÖýG 9ô.V«‹E6¡@3«å#´‡1y at kþÙ|ÛXœwï_~óê°ãÙ+—¾h5¼¾ÔUÀÂ&ñ·x#&$¤V4$†}/…fp€½1´ÿõö«³0yxBcsK~‰<µÐfóYxöbôæÝû·/^ž½}6zûæõô´FÞNJZ_à·Þ¡”ˆZ©9Ûvj¢çYq&³BgS­7U4±µ#*%@søçò¦—OÖ›<.3Äi‹väãë1‹èàágo1F»+>™ï79úem@Òq¡äg÷ ò|.†Þ«IV–«¢ŒöÏ¡¾äo¾ÿî«—ïGo¿Ùµ@!ZlvJDÖk~ýòìÐP!9vUÞM9¾°tˆCÐ2ä ^ŒRuúMÐÆ?I‹ç|‘Š7ðøI5á[]v[¦$<ƒü~q45üe#}\°£´9_¸úÒ$ecëÉh$.0ZrRn§ô¢s	îîÄií¨‘›Ú6žs8ïh'˜Ömdáz¸®nò™7È%50‡Ä¥	Ü0êÐ1œdN#Gáó’?éfÊ-IæKÊ/\DG)rhËÓ¨…Ä<¢“ezNpw3#*Ø0v#ÿq«å	xE± 8,Ù[x´ßÍø0¬Þhô6#&?æb’¡M)ҁ“wÔ 3Ä ×¹Œ†Á@ÖwØé|7æxtKÀ"aE²~ÐC„+WßÞĝòí"‹[Šeª^²=¦×Þáï"	͹ó“O9óDI>”¼†#vý¨Ëøú~#&T;°qA8-mD„@¶Àót	óZ@±.Ê£×Y7‘‹*¥5A_RìH#*.¿ß½|öêí›~¾ù»Wø;6¡ÿê%…=êÝ̧ÆlÍówU͸<z}áy at b>ü±æCDL!Q+)ÀvS@s%—Ùb†ãåj“S”^ô“ó^˜‹ÞÃbôYêT@¤¸¹»+êî*ËÖa2žT4cTXD‰›ÌöËfÜ!–Æ é9ÚÅ^”ηÁ#*~4ÔW%‘îÉù~(ÝR'Òí5u+þƒmÏœ‰íôX:äróê6Xd×0½‡×ä›Îü¹R¾µ3mZú{˜¯ˆ4¹ÿ$ÅËâ%x‚ˆ^øªX;ÑFµ“?Œ–µ.lëa(Mô^àâQ… ÒÀI€tZ<ø“UÓ7-­iõÔ/ÿË÷pÝ7Nüãÿ#x¸†¤9šˆÒ­OÿPÈLJ£ßÜ9-Æóë,—íÏr”ÆÁísé]ô‰êr’ðßÓ®vÜiç¢qf¿¥@ZkAz?p\ ½	ì9´çJ"p]Ôª“³;§•äx»÷!Ʀ öZ#*"o8fפᖎKꘃßÝ1Š¼?¡[i¶¥Û‡L}j»ÂhðrV½MçtC‹O¸t/™d†'êì»é#&äÇnæC¡ÉZg‡Ì𮹨§íúdl:ÎF[oéyF»I¡îa¨8Uº#ÕMäÖÌíðRtØãLt)Å\”Ì„éb&zy'ÊCv"ÍÃz±^H¶ñˆÚ£Ÿ0Ã{â7±˪ÑQ)h}ÍDUÒazÜQb«RD7ÍÚtHŠÊ˜kˆã]"Ó ¥QT®‹d(1ÕN9¡GâÍ´¤€+Ð>¯1Ýò#*d?ƒÿ¹v´¿ÃG±¡e„pžÍ𪰭WlKJ éˆÂÈC«ŽA|=*Èú³”‰Ù~Ç/,D.Öhx§öõƒ¸™/_¸Äf	=¸\è	ºÂÕÆp3úLMS†ïñ¿×Qµ#5 ïl»†ì#&R\µjH8¹¡L³ò-¹äg±ºˆüÙÓ¥ˆƒ£Bô•zyN at 5û–âEçñ:?é°0Ünp\ë` >8‘Ǩ—=m”} ÅX‚ý&1…]~o¬/-ª#&¸ã»ü©Ñ¿Æ›Öi£”møÅ›)r§p¡Â/âeZÛº¼qY{TË®´l èF35…×V¬î·ya8<·MH©mgK›JZ^õ]Ï•klQ}ö=ƒy’©Ñ<=*ø0®»EEv¼ëq¨Ò=Jév÷ïAß:wD}c»MÛ#Ñ8£«Ú%d·²!ˆTßæJÔœX&K^<ù*5_,`¦„°A$@Þ)°vI ¿RüÇ*¹Á!ä€ì¢ ‹¨Ø‡>è÷Mèä÷« ëÊZžª¬´¬~syO†²X§#,á?‰yº3Ö˜³M®Òg‹ÒǵFÿÅ* —N]â8 ¥*~;·)Ót¯èƒúEî@2_Ê?¿ríyÿáýþI@ÞåÿñÉçOêï?§_üìÿñ¿ýû»K(ÒP‚Nk³óñä*š:9u¤ Y‰¶M.&ô:BRéïá\bŒWJë·>ƒ¼¢dÆTa²Z,²	ãæz†KÊgéñöôøsÜ#*m4eãêÏrs¾f¹6z¨\ã%)ÁiΛ֮×,Ɖ»†:Íþ”uËÜ€ú'’†#*pÀÛ¾(¯­Wkg-JüKzµŽŽc|â¢÷“´Õ•þ£"V#*Åà8'ôºz±ª°Ol)ç7&nUÜŠ/îÍ®!§Æð=SÕƪÕOkߦO¸5æU¶Ôn¯2éÊ\Rºj;»¶-`eçöòôkHÅ+m} 	2òU.kè	¼~ÆoÐKê%ý6jõ][†n¤ëŽF_‰ qr•šh\HSzd™(ñy@—¯éº×Öçÿƒº Hͼ˜ßMO8ÊŸ¦°#*³- 3wÉ.]†öÉ/áLŽ/²DVù9ÓUår3ìZxÅݏF	â¿Å7F3DAÔh-iÔŽÕ1þŽÉç@ϧ4Dqéî²¼ ’<Æ0tì!³öË¢÷Gø_½¤éÆíXŽÜ&ŽÚÚ`†ɾ`©€¦Üç°Š^#º{8Ýæ 9m	¸yëh`înà¦_ž‰?ņ*DY—²ù5‡çò@[?²ç Ò&&0 TžxÙ:éïÏ^¼õîÃHÔµd‘¢æHý³±'mËÅE¦¿„œ8*.(˜ ¢©¢y<fáÇíÉùà9ýû[Ž–ú±WEXKq‘ÿéçÙ#&"ûåô©¹ä¬¯åƒ†Z0_(¿‡B1¤gv^ì¬e#*ÍE®4hÙ»ô‹uÈî`Ù›Î/2	:MÖÆ£ógâ±%ê’Œ‹¹ëê—o­LèŒâv8nôv6pdGÑz¯É uì´bèßt1?×U£å:h­- „_x×bÌÒÕð§	4çÌÌÙedgõ e&’ÕŒld1„/üÇ—ÏRUD½Ÿõ&‹•ãÅ…ÂÎ:{Ð>!£FFÛ«õlJÏå‘]íh‹Ôä+ÀGÓó:iêkí^³š¹u¦Ù¢íBwÓø0r_;­¶Tv\ײüÖ¾%(jàvÕ÷úUk•F¿»ï4ãÑ)Å|FÁbð1ý†,†oaYMW›*¦òèP>(®Õ"2ß0#**x™-P΍h•°¨F€ÉØ”ˆÙÞ;‚¾RåCF(Žy7㹎ÿ$.õð¤#X#&±Q¿-ÜŽ+òçwÏ	6fx×Õ6¦ŒŸÂy÷›ã¢Ú¬1ԐLûìÃó÷¾÷êÍ7o…Ê´EzÓ›oã‹ò¯nÙoFߟ½<ûÍÛßÿþÕ›¯ßþÞNÀTØ;öËõ£óˆ’ðW@¶ãÕ»—n/H-oÏö!A-&\9N©îÇ&ÇëCN¿Šg+)oԍ¹žF^.anÏ¥c©iþ=i¸bÝ;È6(ksÓeàLçñ²–Ÿ- '9œ&&qäùD—Â?šð¶¿#*% ÑAy$¾B:;ÜJ¹,ÕË„É:ŽªëŶ÷NæyP­¤¥u"ÞX	/ÜŒg#áX£%†h?ÞNG;ü£béo^þA&øXC•:>ÁªGÇæÐ~¸]‹¸M Zò­éŽÃ89ùœŸ¤ä3èÆÈÝ3	­6ž顼¤PÄçY0®àȍËJô9Øå)XÃ~Pポ¤Üb¼)ØìcÁD0/2̯}ÈR€†…ö™K~ù)C^®ÚFÝ´Ž˜˜p’ˆŒNŸŒ.6ãb1Þ®‰¾Di…¿ÐY¾(â1K…¬gs羍º@!Àþi3G­wÔ_ð,#&N{ƒó#&…‹Šñ:“­—<í=IàŸ§Øóiïó®Þ8J!÷i‘ÉÉ9ZŽˆMªó”g:Fˆ;푨± Rô¥C‚³ZÎ(S2jmßÞ,¡hH™¶ìC,²’¦ÜX±²ÄZ˜F(X{±0ù|Í,Éë\ŒPŠ#&ÔË©é‘Uu™Èaæc¬%˜æçÈ\Hk¹tl‰Eé¢ÞüÀÔvÚÄÌK÷@.ö€׎…j“¿¦ì#*ÅŽh™†Å÷¡¹ #q#¢rœçûO/œâã©ðÝ´ëÀzˆ˜ÈÁ?EFôSëPóºIüDTßX§•R‘šÛb{‰Rˆ™p®kZ™–1²#*È»a¹m#&º]õ¥ö‰€'­”¦¹#*RUCUê›?5øÀr˜·xŽÎUc5@Û«¡2ëØ")VHŠ^GeRSÚlŒ)ôüÝ»7Ï¿{é*×óPI÷=lÖ6×RKmÉKÓÞq¨G«Bµb¾kQ+•PÉÔ¼4ÌUg±†cf¦Õ(Ápì&—Ù•xóLHY?á|1À,`·a3ðúK•Ý€L£Yì(öMÿ<6Z%ÆU±™TÉl’W‹kÌWe;SI']…É‚[/`'ªêV¦Ë[|ùbbcºY.o?&8ˆ”{êmò5âñîoà¿.÷Û›¯&Õ"²¡)ˆ\¯#ê}xõöÅ·@·žýïDÚq[9æÿ‹ãxÐ?u¨QFìŠe|­DCöyK—R•NóDucú5¹,ÒAøñ#\à%_Iø­‚º_Û¾££c;¹ðK&·@G™Jó™Tpt‡‰÷TÓ­µ†¶ðœƒ¶÷rÄ?k†¥;†Rd£r:ÂÁ#tý<l“éÒ}£´>£qœ…/õÁ/®µÁBñ½£mk¢ÓŒµËˆo!v¸ic;¤ÄáÝí…-IK‘\PW¹ŒVÅü‚°è-“U¾¸ÍgÈ*[ï0¤’ÄOÞ|ïSYZMªy¨¥qiì¡#&Çã ²Ý6)2`®@½Ž“#&ïüO†4YXö£Ja…`¬oÔ%)’Ì£×9øŸ*>Ë`0Îo9}ا»“å"ÕJÌŽ)µ5Ææ¹måê&ཷ̸¸…Vìj;µhþ$Mg“ò^‡àÆöÀ}ÍC\€,ˆ0çªÈbl	Ê•™Ó^‚ú$TÛ¤xÁ¼*¹œ†™SOÖ…,{“kf]{hêÒ±o¯Å\ÅE½Š½õ§¤äš—ÿO´-‚_€ÛØ}Žž‡ÙÆ=EÝÁQvíøá#&»q¯ÜœGÝQWÕ ðlÓÛ¬ñÇR³ÓÇÍ%Œ²\#»àc“HŽ\QÜc7lA?;&yj÷°ì†‡X$`8—ŽK‘nÐUWN64°¤®J¾·Ô¦‡	w¯ž˜U ÷Ý°K/$è­›¾Œ+ØÁIÿ¡s#•–ÒaŸìF.h„|ôÃA"šR=<ê†ÿ5IVHì1M·SIC/€ËTžsQ7C¼K`›íqL.Ón¾Â–»®0UzK/÷†3–[E†xɼ…#zq—X²Ÿgh	— KQâ±á®ÌÖ8Aç*äˆÄ]–‚ø°xtùB;h½bjÏIì½yûþ»ç¯¹l?ó	/¬·]Iµfç8ÀM)†NÊ-ÇWŒ’˜Á~aÑfrÕ„31ÎÉœtÒÑ”#*Ë0 \8ρ24¯/Èâjm¦ƒ¶æcnØëi„JC£„Š¬xN#*Š³\q£&P‡™­V-×T'óŠgVr—å×á0…b;e•8Lå픏áA¢8‚Ò¦¤L…žʉq}Àë’®}ñÝ¥mÓPS%†5惽vanx63L|YK»WÙœ#&éOÏÆPdŠ[GÁÆØ?YˆÇ'±_êCsÎÙ¨À‰R€.¹ÀÛeåbÕ¢!‰ÿ5úø«¿Šÿ#*ÿþ%üñoãøãßDZ@•€á(Ͷë"¡;«T	?¢BÌŒŒ¨|Ùc…ÀW-	?ûÔËþUè«ˆ#&‘¦!:‰´æã8Þ‹-¼ê[kèPA²tèœÏy—ý,ºe=ŸãÅ<bþ0ÚUR.€]ÙpwF!à¨Í.Y‘eçå~åYÅ?6ùW¹ÉWhÄp‘oBG´f‹Y(j´»:Bn:.„ÓzËñäáꮚ4<ÖI”LÂ#&ÿYBIo(ëÌ@kß•Pz)|€]ãÔvÛT~Ó#¿üaã]kUT·Q(Š<ª‚Œ#&~7žÀ™#&þàzÆÕ51^Ã=Šû÷pý¯nÊ ôÀSf´´üöìÑ©×êªôüæÝÃïý~/×°Û¦-ñÙ&{Kz¶ZŒ‹yéwÊ;¯Ü’¢§iÖ‹‡…REÇ-„l(ËÏRnjè‡#~œ‘ôñÄÜéû÷KÍ)6‚ä`^Ì·õà\ƒ1|òb½*‰S‡ÂLjmcõNmq­Å2ö±^•ÐBC€sq›±2uvÔë‘I5UµÜ×H"eM™¾ÙXe§,¡HD	~¼XÜ›ÉJÔ&€;ËPÃgž9)éXý#&(yšÃŠÕl‘–æNüâ¨Õ?@ŠŽ(Ó&_¬VWƉTu¡&O’y#&–,©ñ/p¿9©æU—ó©9â$ÄC4$¢„ïa9že}´²¿-™ÞW¹UÂÏ<A¹#*–›²BãC~òüÓ&ƒ»X Ñ×[@œÁt%±’™ÆšÈ͉+”Œ#M°BYÝ|®½¸Ë¦ŽF¼x£µ·¾¸ÉäÈûé&.–YIT߆©ý9™ü˜…Èœkà}N Ðý‘i¥zØê}¬Mð§Î¬gÑŒ^òQ<K'\Ÿø9Õ#*B«m¥÷±ß§}¨WÑÔ¶¢öóñt9ºíD)³#ìÙŒE'ÕjÀ5§4êjmDµ9œe-â05$‹yÆžGn¡YUZ¾£¶¼Áb?iJ¯±2 ËqH	JhÙ‡nQ{}ûÁf°¢ê‰µ‡ZE©“Ma©{Y¶Þ ŒQŠOˆÆÂ)·€¢[q/)âõàÛˆxm9}Bÿ—Z¾Ùlnb§b¼¥³=„N¬£ˆÐeÆMàÊS®MÞ€'ÃÁãa#¶µe‚{áWªRüðŒê1A}ØÇÒñy	Ø]<f[œÒÖ–Ô¦~™í–#*±ü2\/ñ_Œ!¬sŽB,Î(ïá!Ûùp¢{)¡/l\4Õ"mÇ.÷Ä—j{xy³‚ërè—Éó€mÅv6«;¥à¸n_¾2ê®ÎÌupˆ:Å(r!§h„þQïæéß#&ym= %hn:¸“Ø®«4'7šQ‹	ï·»Rge¼ÇÖ¡ž@=—­¯€q6àâÅZÕy©ß?ôð2{Æîd‹™Wc|§“ô/á¤Ú†¤ô·½lÐNcå Lg°¿{í/ÿ¹ÍïF_Û¦õÛòÈ&é÷yhÛŠÇc›=ÿ40hß	_ðM{B#&=”qŸJÜüI.¬§¢¹¿Â°Óò­B#Ì‚ÿÅ#++‰š#*úÔşçkq½HòúT¥Ó„#&Âcû2Ù¬ë?Rùèýïùú¿nxƒý,×è  í«MéWïF_¿üæõó/1j‡•Õ•”ƒŽ²7'ûÂÍÏD·¦/^!ÙªÛäDÈãÝ‚o“|§Q,ô€},ÝŒW\JɱæP±þ\bäD#&!Š`Sƒ¼?TÏ“Û	×B$‚˜m²·dÇô±®eJ5d‹ñºv—¼#SÉÈ¢§jçÒ3?òÕM?¤bPHqRk¡Ò=ü„N.W Nr™MVÀç=zü9)v.ëª2.à—xH5P¹GŸ@QFº«ØCiìÁçÇG3¸Ö´Ëå|R¬¤xüUŽè¤ÅJv@ûf†SÒðp:…ÿAªÉFñ9õW+wRr³ þaÕê,ÃCÉ0‚‡Ãò°÷x†7—KtНVÿWúH=éM‘RY°|f¹~	ò{³ª^¡že´åÔܲ¶fjjý{Yû?«öý·Üoÿw|òôø´fÿ÷ôäñ“Ÿíÿþ{ÙÿYÝCRK|z|òEÇ:pJ»'½§½“/ºÇ“SÚýâó“ãþŸ?=ù®ÛyþÕ«ô‹Î[€„ôÉéqçíOŸ¦Oþëqç»ç@§|éÉò4úúÕû4œ<A—@’röý7ß¼úC²ob€Ó°óõWÈ@À1{6|x8	ºê¸ŒCªº1a§i©a2ÙYnˆ3½xûæ›Wߎ^¿ýV½§õPÙÍûÉ¹;ÆVb¾Ø\O i­®³9‡°ó»çï_=ó!#&Gòkã~ùÍóï_@?(dG#&¼A3w3¯^ýÙ{׶6®daô3úŠfô´:42à8™Í¤3/l³ƒÁàI|¯Žh,$Z²a²s~û©ëZµú"°ÇÉÎÌxï‰Q¯K­{­ªZu¡oñzSs*8òàªZü ¨û‡{'ŸÆ¢ÚëCNÛMÙ==ÞÛþ>m\ gô¶QƒQœî¾ÞÃ÷	Ö iÔ`0ùøè møß#&\¢WÛÇÛ{a>5~6Kü¿O;ǯa‹Ô^ì>O7j;ÇÛ'/ ›µ½wö^b§×N¾ßõ#*RÿT;y½ƒ^ÓÿªmŸ|ßÁË÷ã1bŒxm³é×ã,Hç¶uš6š­nÖÃk6ÎêÍVo#Κ-t{›”¨FY£öâèõ±¯úb«ùr«yÒ¨îœvŽ¾gÇ';ÏžÓ–€)ì]²9LâþáÉ)7Ýxüø˜Qý\£ïÚ¿	þ'iÚ¯bþ}þL’Çÿ_AùÏøÿwiÿÝg¨rcìÁgƒp#ú`3VàÀ'VJ³; *ÕUÌzá;¨ý÷sôúd/Ú¢èRÑÓ£ƒÝh‹íÚÖ7þ¼q%ÑñžMzLiϏ÷ö5õñ&&½Ù;88úÁ¥=Æ´Wû‡ß»”'˜òôàõž…ö&î¼ÙöÀ¾ÆFo® &qìæÎd¬©Ù|rmÒ//MÆ(J~©‰îŸ<Àã$žê{	0ú‹›ï=K÷sÆÉÀÀßt{Ytn\l” †¨™s׊ñźÌ.œüo*Ü[ü¥~çñµ=«ñ=¹v–>JÐëÑáÑÎÑÁѱxË•á¡í¸[ã3Zâs™'ÅüVodÔj#*UŒ,Ù+,JšÁÞˆ|Ų¤ør2ÉI‰ÉÔ™n5ÓêÚ'&ß‹®³C/0÷æ^¤Ø iÂyžà£ÖOïWã­z«ýeÁi¿Ô>BI¼g0”†¢ö3ú,7¯s1c¯K®A‰4ÇlГŽöÚ½T\pïkâfh½H2žË¨Â1ÒôÚä(r<ù.Õ¢	•Ê‚Kì«Á«í^&¡´æÛÇpÃ>/«Ë':Ï…%#&Ô#*Èh`dE}“òâˆq#&–u*Pk@ºY ^Ñ¡&­¡J‡×oàšÎw–Ù$ځ#*	¹›$Æp"ØI%œ’/#ýª™Hʁ㮝øinPºÁÅ?ªß;šRº}h[ŠæL1=‰•šI£¨²FD°ÏîYJäðM~ZÜE9G#&«n—«›È´·û䇼эÅ	ïå‚Ž{ýÆÊ«Ry•ûi,NC~lòRŽÞqÍëÛðRW‰c¼²›'RuB=?üÇ<”¡.E^´½ ÛêÄÔ´¡eÃÛ6焯9ä.KÜ[×#*}…ºEAVs2–Ö“e ÌjŠ++‹KíÌY1£:Þx’¸ßl|ÏkUŒf”HÖQé2aÍþf?qoeàüs…wZ€\Áª¬ùÏŠ—Îéàâr+œÍÆOcMC”{ߝÝ–ď™Œj#*ÙuRÐDç6È•€³Äó+m nÿÇlðŒ	Œœùûº?š¹ª'sàÅnÔ™]̹èHËmÊ–?â±€ïöûZ‹ûÔgîÑE« Ä<}Mìî=}ýÝ8W€Ÿ}cýgûÿ:!îßXþ·ùÍ“õ¢üoã3ÿ÷{öÿ%oVžßs>¾ÔýI¼B²£a’§(i#ýëD%{Ì( >9ífo™{Ä"ªµEø;AV®`/¯:WÿH£‹lF>Ì«½MábîHþçIï}Í~䥨‹h$§©4?÷‰&HÔ$-hr»Ž/h%^;Àz¤Z×àxÍÓ§L‚协Âý41iwûVýÚ^Hwmi*ºN³ìCéÌ»Cr*Ï.PH?¤O—.d‹qÝÞ‰šVXZ[qAÃ:(Åœ#&ûê'©£âJË÷ˆãº©­;Œ„^¡ðm#&ug;¾¼ú®Nt¼EŸ/IӁq	ÃùÕÕ0EAn n4²Z'y'ºjÀªPÑóP<ùÚñ1T&ªL9™uJÆ®ô»#»Di#&†vÍ¢õ'ƒLø^Z=X:MÓ²òŠÛ…¸¸T4ä=¦^֝-ï.×ëÛô1;oF©00.]Õ²©á²ùÙ í¼tù‚¾¸–¡wÒ$êR®æhÐDÛün…nI1dJß[Jž÷|q}Õé…*…h']¨´©&!ÐöYM±ýC :?K†‘õY¾¾q@ì^^••„­]çÝQ¯­¡¯ô<¦ZA„JšCv¯±sÖ?ÅZu‘¤×oºwèJa8FÙÆh0—]¹ß•#¼*Œ—;%ˆóJI°NŒ½Üqõûë,lÈžíjšæd1F•1|âm4-@®˜7Õ7–ÕÕxqŠG”¬mc­(á‡ç#*ß˝)IT?bˆ×] ÁMÑó%.ªŸ›Ýj‹Ì#l¹ÍOMi±¢×°„¿(QôÇ)+@Ï긚Ò¨ ˜Jª˜ˆ§8×”*¹6ƒ¹‰' O´D0ÆèÞW‰»´ú-áoñµž8¯ëç¬ÿɽ~Ë#*7ôÛÑ!ížAK}8ŒGM½G¶âhŠÑÝéâ- ñ„sø´MÔN›þÕ6Þ®FxÕñ	§ÄtGI7ž;—¹èW¡[æå‚]wö´ëáû,"„V~jy©Ù©þòÕÎea#&é1ª9;H.øÔAÓZD<µ¢À#ô_)é‡÷›{Îþ"§2têþ*ždn†É#&·êÇèÛïêÊ@‘S†VçèFÞD8’–È*óD?­?~|ö_â¿*QÂ:ª½ðñnzçÅkë8Dv¬0?í×Bð^Åôbҝõ÷agÎf¾·Ä5´tŸ_’ÈP¿í#*ìë?ñTó¬{7JŠ›`ºÙ5ƪ3á¢e°ùÛT¿Ôå- –ñ°JÛŠÏmj¢žEj‡šº$ºb9>Ï®}Ú‹+õ­ÅÓˆì ì=¾æUX­‘° èÞü¶²ƒ-’0æ0¡¦|趄¢kÊÅW>fæùVÞ™{zaàz¿L®Dœ›­2u«Rœ#*]^#&"a"ñ$˜ì(ØÁxt|Ëç?Üù!ÕQ£&J#ÇÃì8˜dtë|¹î8Ü[ c³V.[9H·ëTÈè²ÅÊV÷ù!ªYÏ­`nô	ëwèvQKÑYoËVÊ-ûÇÔ‰æ“iTRÏ(ÔŠÚ´BŽzë`âw=Ï,±–*P•ƒ#*ii#&*lÙJK雇Չи¤#*2 at PKNp80Ìàø-ø^IF'ƒùœH*¦€íѹ½î#*ûø´°ƒ:¼¡4?a&˜Úš}sjŽ,åûVBt¥ù£’áåE„×R…¨·+¸CÛ¬Z”ÂIP‚Ñ%N4ž2¾Ó£pŸà]L&Â1{§‚#*l/¼AgÃÏ$·UŸOèv()»)Û+lå‚ck>´ÀÒVxöyü@Íð¡Ub†“1´é‚.g/‘/ãÍ{ÎS†	|DÏyR‰sC¾#*ÝB#*‹%©ŠL çȯ¡ÜˆTB£›œvƒSJÑs”¢¾ãoIfe%I§ɐxÈ"÷­”/i±ö¹M·Ù¨+GZ9Rl+ǪªÀ©àdÂyrCãŸY¯”÷ÅKøìû€žBÌxXiáÙ”Íõ8ô)3M<WQd£þ­ríKºSô}QŽX'ókܨó‰±ni´9óð#&ҏ¥pÀBXP·WB²ùlI˜3¢¿1ÁœúuNÁ˜@lYäûÃW÷Ü“›…§34VÄô¬ûNãùÐùáèäªöüVw1Ÿp1£IáðO§7Ê*¯€"S–£„hÌKA0g[Y]Lí0r3Î7á”m§­ü‘MªŽhâãU%Ö—"¢§<”Õ`S&WÊ:!Ø.ÕYk9ü''[*¸³/Ù†^”O0®ô‚ž”?Ù1*UÐmgM¬açà&–•gqÓÃÏÑJñ$•sP¢Žá÷†QÏ0mÿÊØdNÏš¶Ò#*y¢ê­‹Åa”kÄ*§z”ÆðæCyÈÆ»ðÜ“˜M]§xÛ´Z×rp¼eçŒæàÀÙ RÆUaœY¯IÕ¼Ô<“e•ÇíáVÃsK;Hœç"—GìŠÔ®žöuxÙ‚‹çƒ/ÖØE—4D³‚°©Paw|%,q®ÅÂna¥BØæ²’”òÛ#*·z)®­°Ë™KiPÇb	#®RB±„„äÚ¹F” õ­ˆÄÜ*(ÃRG+ÅaÚ;Yrv¤Ë†“ëjùxÂ1ß7§ÕíŽ]‹1™ü JÌ|‘ãðˆŠzÍË0ñ岍ÿ$Q®v1e”¸í\~ü (QRR­°¹E°7÷Cš¨ì#•ÚÔýÈ}ù …¬Þ˜’S¤}ô¨å¦ÅuÛ§mýÚ8»ñª”Þ«·ð–¡{<Û–ÍãÆ?G#*’$¤AÄ{(¤CÌå	þßf5šX	þOúǼÆñ?M4bu´o潑£"E6܍æͯTL$2Gv÷ãv0è¾ûÐqoëzXÌÑ¢Jéí‹Ìêø„,o_#&çô~gïÆõ¿žÔÛ½w™¦á#ëÚ°ŸÕÆ_¿ÔOvvNêO‡óïƒé À]_Õ;/Oë>ägõ—Ý·º¥ôGCý:##jÎøƒ„êÚÐõÕ¼{•9ï85Mt€x…Žÿu¸ÿVo£w¸z{z×Ã&0”îÛz¸#Ófÿ^ý£ÞþÇp#*#y?5PÕ(áN_]p¢‘²D2’\¬ÄµŽ„>Õ	¼,%I£—Î|úêjy:Ò)¬Ïz$¯¡—~²è,œ?©´Œv§.iit:TF"zÌïÊÒ{õ¡ýq䏄“ÍUrÕú{>Ôà;œ0òäiŸÒYäø$#ñK3ª$⺠V‘cž5¶Ô-è‹·U};¼gM‰¾VÿɁgé¯>cÇJÀ¤}0Ð-5¦òù*²ßT°†d벩Ȱ»ƒNÄAáI!§± {G&õ2t}YÜJ¡|é-pYxÏ'VˆIÅ^è_Üª3±k&Ø7$³3»¡-°%%¾5}ÔÔ2ÿ‘8:	OñEŸÂõàž*ãÐœ¡Î ‰R1¨ Ny?jºbõÄñ‘ˆï‡¸Ÿ/ëÄe•”þ²cØÝ&óy™0ÆäXbÑ|~ϵºÓ©<`'¢¾%oÙ°»ðdB[ˆ*/0 0ù(`5ÂÇÊ°+T¦UE=#&j°ûÏέlik¹ÛÓù[÷ªÿØ“-íQ®¸ûq£>!R¼­E«RÀ¡=]ý#JHîœ# ÷®Ùa‚‡±Ñå­bÏUV#¸:¼Ø,œu_t9'²o§Ã!»ÊµùÚ"ºþÀ7ñäµ¼rðØàFñL#*ð¹žLÞV‚s%ì†KtB¦Ðs”Sm	&ÕFWÃÝ7)®"“êK¶¬{*{¶M¾ÊÜ$Ñû-Þ1—C¢0ßHuËtÛðЍ×3cz ÈŃͅ[Ë®»¥þ–)£:iÊ{ލü §zRÓæ,n4áGËŠ-üf‹1TK>šB'œ^1n»#&Ǽä•ý踚èþèu:¸…Ëìn-9;Bf8˜þ¶D«}‰û7È¨lVÏႯêB†×[¿á<ò+q`³Á#&ùDI~#´¨¼ø i´3é±{œZ®×8øzFÌ­ƒúÏ_Ãìg|i7ö1ë󭹚˴ðí{îÂœé*¢!ʈziäeH|ÞùÓcJ³ßDdPpMu-Ú7oûøfÁanfk¼ýrÓÁ›(ušÎò̳‘¥G‰Óf*ÓbJ¢µ5ô¤OkUºsŽZ'©ïlì¢y‘!ؼZ~鶰8 at f}5´éª7‡Qê–ži7~`zõôý„B'±O¡÷`ž0’²)ÄZéÀÓæ¹`ò¼äåmu…É2yÿÂÖ3Îþƒ7ÉÿFü÷¯¾)Úÿ?Þølÿÿû´ÿ@»þ ¿Éƒrš3.oqy#öÆ"úý¼ùµÑ„«žúö$9ð+ŽÈþ ÙÞ{Ò»é{—Ÿ>=#&¢²¹›~#*ÿ-rÝØ-òºÏiäðÆkÿÌ&uÔv«³X´Þì7š-…œäÚ';~7eÞ]ûé…)v)7Ù»:#*ƒòä-Y#ÐßA]ž@ñšMÓܝ•øy>˜ŸÌÅ*099Ýíì¾z}Úy±}¸{°G	G¯Os)d¢-	Kàî,f3`~eI’ÝÅtD>ó¥1(ñ’nr4é<Ä+Rþª7¯ÚCÅu÷õ«ƒýíÓ½Î	P#*mòþ’œüÐy±¿ve:œ´ÖQ\¯ %,ÂË•’ÞšˆŸØ¯=X²X‘ ›ƒ|žîòLœ$e‘?“ã=ìïáÞèýçä(7eƒw0EÚ…à6|6™ÀÊŽGä~ ìîŸî%?lïŸvŽžþ÷ÞÎigÝ_ý#*/œp8_âû'3f 8\)J»WV®añ÷Ç@™SÊG	°It¢\Êû“ëÉ{ö…Np¸%¿Û¼~*˜‹f%¸`0‚Á¹O¶øÒ/#*Tå¾Ø9S­Ó!w#*éYƒÈ‘FÒÀ°#&ð ¶(ü@cüï	üQÄ#*s	ÊõrûÇg»ä]ð.£×¶ÆÉNçèÕÞaríÙÜ|òµTdžºƒ«’ÊÀù@¡AºQë ‘¿šuHbµ˜¶4vÒHWH¹³­sµÌ†Œöt2µ:}8èˆ*¤„á&ÇsçÝ	X‚òÃXß#*Z|#Âé#gI4è+‰Ä’(ÖþrŠSŒÚd>Ž?Lt-&ËÊ(9g;–ƒ#$[YxhÀ¶üA.:ø«Á”d¹ð߸¡¤¡zFÒ‚§þJ.	)CW€qO‰5#&»	¹¨g˜úïÜuònˆVÙc )¬>*QTªÙ•8F'ê<ë8»wêV1þôæíôZá!¶õÚrÍ®b2?Ÿû/ü·fC¤]Z¥j#Ro̽:××w{–ÿôS$vöÔK­Õ‹³#&,ÕˆÔAB *I^9©nü%{T\R§åýQÓ’ª¨b®|Öàbº¿tOdV¤ª9+6Y6™alR.¡^Yøtä}ÇXºƒ69€Ï†ÿ l‘plò‰›#1ÇîçDð°hæßSà80nö¥”#²sÙÏx&&G~#ÇE…PG‘~ “†Ì^wÔÞs€V©fâ^3\¼á:¾äƒHÅ”$êô®I9ŠåÎfQ¸xãeBÆœ ~š'£Éø*ŽÆ»Óo5¤ Àè»h4\#&f#&u¸bˆ"u"+S¢Á3”ÃiKg‹)Þ6@¦µ¡Q>”<%œÃ'Fgº#*²+ð€ÝA ¯n#&2\qŒi÷à¡ØÅýBn”²ÙrÒm¿›MÊÄš¤{[“¦Ã~ðmˆr›\²—‹I¨¯6ÝÄqôøK>}“И 9z@	ð—bv£nŸ:ì—#kÑh’0dº;||ZtÊýÙ6gÖW2sYr$íaÏ!Ÿîä#TqthPz—Ò[‰Â,î@”“¼J‹0ZÖ/G 2X˜¥ ®tq	X)!Ï_ü‘#*Ã	€Ê0— •±ÚèZ ˆ:¤ó>$oZ¨Ù'lîæ8z)ê–é”NêdWrË»`—­ïëša|×܍÷U,tHøÐáÁópuÏ< CUƒÑíLû8Ô0p]xÝ9ûEÃh”Õuî?Í~Bþ‰«#*øl¡Ú°€^¸ýó½„3Ï6âEɽežìª¦ÀÅÅQˆ™‚m)$ya[*©.….` VŽ:>tŒ™ôýÌïÎÄì‹Ä,Éy»7YŒç-ªõ]º)>˜,Ê]	Ñ­Áu5n½ÞS¶8D§Ì¸–Ës’l#&bå»([‡ûaÒ]8›\蟫‚}5é¦#*¥ªYW¯U@Ï6”JÇβ#ixŸöQ	ò¯Æ¡%è/D^Öã-WRõ#&.ïS—]ó¨Ò!ÿ07„¹ùîo)J'<iD­¼€Hi	)\ÄÁNó`T˜$ŒKFx6EN4hÔÒ‹nxŠÖs÷þhïæÝÞu+—Íb1zŒéL²K^NÎ×ýÆ3d*¯3žòp&î‹#*ç0äý\Ðm»´Bo ð×6—|ÍKv\z¯néMÉ.¬V ½s¤Ÿ¿½ìæÃlV¬°ñ*VLïrù®—f–/—6Q¹Zxýr¹žTMÿDP—ñ ñ€*á’¹k¦ùq)Ýâ¼…T,š°*-}ÿšY‰×1¨Y³:¨X3%•äo¸fšY¾fÚ„Y3íË›rS óU±ÂPά°«Uµ\‚÷Í#*?¤J¸Â®FÅ#*[ªÚEŠþ(šœn›|ºr¸:aNŒÞ*Ú[±TKʲ֓¤TŠîz‚a;ïÿë–¤iFq]“Â÷è¼c™‚T¿µÇIC+·r(Ealµœ¬ôÃÚdÀ[I\›²æÖž°¿Ç@A#&oa@åÑg½nA'õ÷×ÃÞ5Iz:&/’ ¡ÝÞûÉì-?TßMp‘o£(áÂ&·ÖHë:„줗ý¾xÊ-³–æÌROé) =UÇW(ÝÉd–13#&Ī"î-“€x<gÅSæQ£¥	áQ?üI´7¶°Úò ò?iÙ£N¡´1‘6JKÈŠEk…2ü¤¢ÓÑãB<¬î©PÚ>ÏøÇ1òK€öò¾Ã;G/O^ííàãÉMßœZ(©´Ú¨?êÕ«˜&ªåìZø&qû'yÂ> —>rÒ0ûœb@±Æ©M]|kTñoètgžoˆŽD#*L‹È#)±h~â6ÖnðÿIKßáüÊõ4¹ž'Óa?™ûiðØ2'Žöµ§Î7rÇÏž?³öÆ?±GÙ$ë‰±Î—ƒ¶K™”UüSK#üôzê’P~ÿÑóݼ½ã9³¥Ô:gäŠWS‹š“«PMªhŽ©@ÎuÑ&g¸mv­šÓvÜjÉËiËN#&"i¼ ZÖÖ‹o½œBhÎ@C ÇB쨿5ïë;ºnº·óúl8îOÙå.ú`ÆZ¼—×(Ĺ‡Ë¿Ufqy-<¸£ÊEñ‡	òbyãá¯÷.uªíSî.›ï²°¡³š¶9	ÿq.úºÚín “±ÆwI	<ÓnW	*|§áëŸî4Ò½BÏÆE¸U¶%J;óêGˆ|ªWR;CÄÛ=X^Ö1¢a/UžDèÑ7ÇlŠ“,‰þ˜âå	$²¹îf¤™Mú¬‘f©]³ëšNš‘o•J==óéûéë:AWE]ek&öRæç…Y¿¹œ© !Z*BªùÔ’ÜPz¹Œ&Ç,±”HF–ÊAîëh…Ђs*Ä9IÄÙB‰L`© ØÛ_]çœ#*Æ<ǃ®šâa&Ì$…&—+ûyâÏIIû¨ýl·³sp´÷ãÞŽ¡ßJBx‡u7j—Ð¿­Ë~"0;Ï÷NŸír,êò'X ÿcáú{V¹<È…Þ±¤M„Ê·3ô"ÐzœÒ’GSC´mT4eÍÊLè_÷^6´qª%S6Ô¿ gúA\éþ{nQÇ®†lªgÔ¸fƒ4a³kà¢ÖzsÇ(!Aì&&'ôªNm‰ŽžÅŽ‡>JŽ)_…-Ô ‚W½ÎûnÖá ¤}ŒG:Ìä£%‚0§ÆÖPY	|è›ÌÞ¶#*vŒh$€—ý„JUç>fF/clQüþÌ?ÕV?Gçße+_˜ó凌¯ÆA²[Øv,¤¿˜n:Ôµô+?*ê6òFеҲšžlz ï÷ô[„!ëI\6aá—'õü‘§lÄeó™›yÇþÉë|)$7Ü͸læó‹ªÝ¸]äÐ! ·´¸ñ¹îûN×z€~o×Ñá--<Ïè®åÓÍ8ÇïÂãL@±Ø»i^f ÓR1e@.AÁªŽß¬óÁ1Ô= JjóAu`RUzsMøóÁ|B°#*	+﮽™f-U˜¨Ó!ϯ›Ož(Z-C&9\R8ŠÁKKî˜óSº÷Kv¾?È囼d‹—T	61é/LØ‚0À ÉÆúWzòÍ×å³½D_¤†k @”-ŘVÌ­s*K€ž>²©\™S®°ÞðÌ*Ðâ6pKgîZ…ü°ÿìdÿùáöÁÞnËeÄkX£BY*æˆF±÷ãþéR XœnŸ¾>1 ²@|#*í_ßŽ'ïÇ<@kqñEãIüÅ„“½JË;xôbûð¹A2x½i‰£•L¼WiЉÈý¥è{_†çò³éKjQÖ²iX7’ƒ%ƒ\.¦Z&e£‚´`èè™ïÖ€12ŽËÑ"ÓWÏœbŒkƪó´½N€Eø—šèXò@ì •ÉRª ¨!”Vш0ì(Ι…°+m…‚Ò|7Ri éáä=ý{‹ÿ¦lÑÑæ?-­š¸zÉÙ¹|¸©@ž… hd¶»ù #„>çW?¾Tìjƒ(òI–K%vÉ“ÍXO›I_MèîüØ2ߥ¨ÎnöUå«/vùÕÇ:3c#&.«冸±¾ù•GTÞÝ f`®cnùsýrHvn+„›éA=¶\û{ŒUÖc·aeÇz|¿tP)3þûe„¦’váßVRXû'í5®ó¯`¼Üþwã«Çëùøoëë?Ûÿþ^í#:tû5¡´|Üi4u2Yˆ¦\–·ä2#*ù–¨C	òÝ„ö=òxSH1>::ÞmÌg‹œ&ó:—ÃÁ¨ŸuÒ³VãÇFÒëd×P%NZ7þë\!œ¼Ü>8èïíœ.s0¸œN'Óàûxxu–x:™Ï'7%#&ÊSuçdãwž¾~ölï¸CjÕ8þcÐHh´|‡ÂŠ¿šÀ)ßd8qft†ß¡‰,¦¾ìÞo7œi[(ôuçõñÉÑ}Œú$‚†d#*”´¢‹¿³!:]M¥YÈ.HÝcÉ4 •`²í£'ÛÞdœMFƒ|G£öÛÁl<=Þljwk(w))²ÃµO€eŒŸͱ¬¶‚M.îfƒËwT|·ðGØþñۍuRÃ3io m‹÷±³QoEÙ#&zU°ÑÒÞð’–õƒç"VóU«Æ2ÜÐwL¿7&ŸOpÞÓQ÷æ¢ß­7ƒY¤wíù“î:ô¬ÈŸh‰( ¿èÍ<vL8pA5…Ùæd«é©›º—¶áN9…;ÅÒUĤæ;îa‹\®ËÖ÷4£ë!ú‘¿c˜BWѺw˜Ød!‹iú!»såCvU0˜ÂÖò%IÑ oÖóTàŠ¦ÝY÷†;xƒ}»uã\X¶u3&·ŠCU‡à¤L€`KاŒQ×ÙÜ!¦i¿‰}y ¯æ×ip2œ €ÁoV€/þãG6ºV.)˜N”–ÿø6z×Ý™çpÑ•ï’gÃÑH¶	k“í@Ín(­íÜ6éu(™'¦O‰„"Ûvü°VÝ%‘kT†èïmÚo]Þxå›—QïZ‘"|Ìž•†‚M«ò2>>Á2æîËŠ½V¾ƒ?°1Þ3_k¿æÖæ$‡ÿµùíà›Ïë¹›ŽUo렏­Öƒvv¼&¨õf­ê¨Æ¿Á‰°Ã±s󛜉nœ“‹ìºÃRáP<dó—\hm„YŽI½8tZÕ¨²¾!L‘D£/¯I––6:™#*‡ÿ‘[Y€ké­³¼‹·I6˜&w|ÙaˆÁ9ËþÌÎn“Ü&ñ½ÓßiҝKzÈìŸMæ“#&pë¦{'ü6N‚3'>ï.Ì{S¾Ï8)ҁ`R&£ÅMƒÞ†èó×å²køÓŒ%BÁºß:aerç~>ü|T­·­jsK¸bVïJ«~Òõ§ÙYL‹˜+Ù©sSµ–Û$S÷°–B¿y÷ƒº}P·fÈ3 °#*XãÁí¼œT~0b-ï{‘zßDMgƒwÿ;*›îAÖëNÈŒ2™¥?ÃÖ~'kýv=ÁŸøó+ú¹‰?7éçcJ]Õϯðsƒ~>¡Ÿ«Zçkªã>¿Ñ\Iڐ¶Â¤#&…þ'úÜTüéÛvI_)þô}pI_ÛV8)ì%ÿ"ز{q×6Ìì]><eU+«;ÁWfڐ«K&}H=QHYÞ#*UGe=|˜r°Çཔ[c² iåêÄÉúí7÷à¨S8JU„·çn¨ëÉûª{›åmý°Ý}ˆ±’UvÒnøzØ<´áõOÕ0ŠÃ;bØÒa実£íhKðt=•ßˆi“hG¾Á%Ñ®|"îL¢½hËa¬$zm9t‘DÏ£-õ'Ñù¤~&ÑeøùßÑ–åµ’è{M``×PܯR¢-3yItãï:âiÔ$ZÀ·£éÜÐ$Ì'oáo:¸Që/[?Ýn\ütÖ:[_û¯¿üùü˸uÖ]ûÇöÚÿsÿOëìÿbîùjL1¨øÚ= &sZ$Mínïï‹áL‘P’Q:Rœs¤Z*Ó—6Z¡»1J|‰©jäM¿s¹÷R_3XJ:-ì*Ì×¥úÆ¥ßvÃ埂+9ž¼Â"µ%ɤ6ß£?àÉ.ý!·9±>>hÂ߸”åðþBå¤el|#¼n³ì<cþÃì^¬ftMEò_ŸÄƒþõ õ¯©“rÀ±t;‹P%:O£wóõõè_×ñîïÍÿ¯ÑøÉ —¿ÿmbfþýocýÉç÷¿ßåûß•¹Gƒ[tÈ“ ª=Jfï»ù,ñ×øEÇþZV2L Ž/¨±()Þdñ—zYÅ"œŠ#&íÜ¿òã$e.f#T`6øûbÍ½WÐ’2ðEÜ‚Hå3•ªmͦ•èŒŸíÓ(Šþà"2’;ö8³á¾&cHOÞCêÅÌ.þj¶àßwƒ¤µºC¬v1Œ³DÖ ¾§w˜}˵a¾ñ=4–ñõE†Hš¬ËžÕþPC×ýò€gƒòÛj1}¬I> k꣑µ.ª@9–G#à*‘¨ÛSznhn ˆQR°Ê–øsã)œDÛŠƒ;Âå{‡¾+¬{ÃñÜÐ(¡Øßôì<yם9ï‰UõÅä]’%f1•ðWG•ððÜ/;«Â°„/@hâÇ»geã3ø:ß’Áé7çÂ/#*h%½ÑÌTï>.)}vÝ0]³æàÑ«íÓQE±ôSfxêñÜGµõþ»#òfÅ@)Eäi¾¤}ѝ'èÙ:šÌ0B.?.û™ÎöêmÝ…F ÈÒ 4ŸkäÑ`»ø¾³|«bCÜÅ^KU‚RѦ¼õ4N­›§[ã‹©~köKÉÁ¨¿­00† öãÏ@þ’‚¦¨9Î2zL,ºuþ8%¦âà0눃™{-e¾%‚‡I¡}G!ºýæs~	é)æopY¥_­kšßœFäÝ$¢ÓeŒHãÉòû¾“öb…0üåÌ'“[@€|×ÚÝ{¶ýúàÔw­›Íñ šÑ`,—Ôõ“‚08·Óëö®Λ®	ÑèY¸­	Ž”ä! ,„	•æa&;Û;/ö:»ûÇ1EÊÇã°EØ~†¾ží?ï=× ;P|1†Ex«AB*C	Ý«ŠÅ<E0;ìƒDï£e \­Ëî¼;²‘ÅÈ%IsF‡#&Ér¸¢¦öîœÊX,8ŐO áJ©U$ÑXmÈÙƒâbðM¸«šYÜ +£«ãÉû)vÿ¥ýC7‘ó׃[ˆeEî°ÔF#&¨‰éU£ÞÅ¨/1ÅûÅ2…5qbVà–L·Ÿî×üÜŠ~ip%7%ddÜžw%¨·’êúÑ9Ž ὺ#&VÏ+:ÒÝCCõn²+£ÏTr÷bñH¾´qó½ç¿që–3óÊë|þ»Õpc\®º¥ Â’’ª^£ñ“B× P6œ„_)þãÜ1bhÆ$º½u‹OEÒèoÝw݈šáßï#“ï`à˜9âO-«ß\þ¦{•R¯Õ)G³{íí^9†ßc‰­B½\Õ'½a#K¯ÔÏûÚ†¢¦é§N˜ùYÉ«Ù˜`vO¡A^àî½pòõjEEØ9š€L'ŽõÇ*Ùâ‚"r]̺c@ö6úZ“þ0;öxÖGéã]Ôô{?‰æ³ÅømI¡s…äj=½×Ö-¢‘®FÀ×EªPm퐡\¤B׶à¯+„ã‡<º&}Øþ_¤À­ùz¡#&ê’y,-k¹þ¬Œ&=Æ—â*ºøLWýXȍkÔ<€]ö®-üsÚÊaÜ4$_Ê„,Dan# èó@žkhCáÌi­`pЙ·EéŒKÆÀ”pJԘ鐼ëŽ:³Úü»£âÁ˜Kѹ‹8uÏÇ°sMô¼¹	¢a„׋¡UþP¢?Þr’/+S*éL/c¦çðç?$‘´HñTá8"l%ûEp#lS	͸ñ­#&äÂñ–Þ&L2™¸ô5}|éh!ªŒå:@ºÁtŒ1À›û3A‰¶õ÷æ·üóCf<¢†EsŒT‰Z¢‡8ä½ûNtÕ,pŒÝÁ\4±‹l»qô”ε\ÿ4‰@5K‡±ˆR 9ŸiÙÕÒM±FtaiÃlÄEL¥ØI~Òz«-¡ÿ(íCÑÌø´FBÔÓúúmóö§qÔ|±÷£ ¼|YÚfP²9Ãr~ç¹rþðZ'ÁJÿh+(qM!='<{tC^ëN9~!{ð…ÁðvpçÓöüfŠ´~q¥Ï}f›—iÉ´AùU&XO^?{¶ÿ£1(» v—§û’ìL·ò”þfëè]çÒŵ £:xg .S.…‰AÈÅádG¿Ö¿ÜyG#*Xº*|n,΢WÇ{0¬è¼ðÏ#*¦@Š-2 +ŠáÁÉ; Ç<¥#¶Îøeh[„§°ºß+Äã7Ý; ß#&êƒÁØJmº#¼FîM#&¨œŸHáˆÜ4†ŸÀñ\+Œ€¤èŽ+pn’‘ñ¿Øi›`ð½pM´ºœ6Åma9ÔOÆ:!%b¹Kb“ã¸dí˜iñTêÍ ËºWƒÎ†˜ŒÎüÈ<'ŠJa½ dìæH)£VG5	Ë}­ÁýMé3ú‡Ô6ŸvŒ¬¸âBR øãã—ÛQ‚ŒÈü3k^®1¾ä¦Q—#&iS‡$O½ÑsÔ÷5̺ï@æãøDên¾cü¤Få-ʳ×5ò#*	Ùl&¼™ˆ :±ƒ5á´Áà˜¬ :®…¥¡îMÓ’ÌÍšzaœ¶¦­hò¶­fpÙp˱X1eËËÉbŒA ßìýP>q=˜ÙÉM0NòÃÑ)}µøý§[ÙÈZÒ(?qëÍ4bà…L™â00ÇXƺì®Öù¦=a›ïUŸpïÀæ~pÿ‰# ÕrU¸ù‘X7[á×hˆ%så¦*806RJÎ?Xßæ¶[TZ-@Òe_Âo:¯5¡»Ïâo,ŒûVÃófÈn¢Rϐ[²'›–ˆñ¹K–4%(M#*õºYt_Ýsiì4Eô뾂yüô¢âœ£V×o–ºëgê$´¦šDhõœ«–ñMeëÚëäÖO#&]P*·´×Œc9°)årJOyˆ¤EÂÞfÂÆú‡’…®Ó2jÝ´9#ér†?pݐP¬××¾Š±äAƒ†¡gãÚŠ‰`›;u¼çÞŠó8ø–”Mœ˜-îŲ{'„(’%nüdÑŠNC B¢¦¸Ç‚„A.=B„ÁoPäá)#3ÔP ¨•óÉ¿Ðy,N)é]‡¶‡Å©N!L‹WëôF(®¸÷õ@…Î ãÜwÚäÖH…쎴R{ÙIô;ø…søO´®ÊóâJê3ËLv?ä³êü`§Š:vnE2םÈ;âzKòÞ°°˜t$TÎ2&ºÍ‹Í\õämôªž†¬¹n9Ö–˜-Æ­/ßR ='3šáúòdhV͉hèT;iƒÝUÒ1"t1ä²pÍ+f¡fµàkáxVq8Á˜Ê×õ›ÁüzÒ‡½)5L׊—ðÍ‚?#&9¹$1×cÝåÙwòV¶ŽÆ/·Lß¹¾a Öv£yÊ /[KE|'ÏÜcOë6	'MŸïm¯Þ#&œ8G.8Èß9:<Ý?|½Wæ›-ï=‚;ïfÐ4ËwÐbœÜK æWf|Ù"Ùu&³Söž•à–#©A'¹ô‘/Ç2˜²êmzý:ó@ÎÓKDzðYåæßRÿçÅ(œÄþSjÝcÿÿä«Íorú?_?þjã³þÏïVÿçÎEò~Š¾ä´›½}>—èíP«éH!U³¹ þ$]ÀH³ärÐEóò*}~¿Ç½Ù!üµ$.gY ðÎä­Œ/nHV‘Š×ä _–ƒ#*Šëþ#&{Ž¾C4Óg OØu/#µ½[7QçRšoÄɬ? ÿêîŠu˜ç±ö>oˆñ`²žô¯Ñm(Ò{X©Æ>j(Oq#2žc‰l0`@Žq°¼Ê ¥Ð^vP^ÝŸÀ%ϤRTs$L¸ÿžÓ>êMs1ëÎî:¤Tpfø,\ŠæqvV6mª	$äll$ˆèT¡>	7çpp€"‡´8ê"PV#*•Úîë?·Þ£°·‘¾à¾;mÞèÈ- PŒëä³Ð”sk8ĨÊ\YüBÖsó!TO.U_.´2AsSìˆ?h+‰\²UIp‰HÌG=a›"䟡‚K²¼7ÙèX[•ç[å”ÃÐ4T´0ê°ÓwugÄÊ6¹ò’IÛ±0¬ì}€K÷´“7åsHìD	±à·þež§žÿå®NéI¾Û+¥çn$–Þ¦‰¢¤Jxæèx1Ó#ð¸X¾Nåi9)Ì!U‘mÈI þ:æÀ·‚'âíà.sPÔê‡Á¤å#®ÙE¶åÅM¯¬`³qÎ2)è‹ýÈG@êO%í¸°udòE“²i¢+°Mb§¬M³¤°$Owuñ¡C¹è²¿lLÞßKA0+ÎgwîpvF^úuÁäÇU ìM¦w­Ð—Xùå"[EõÞ÷Ó=á*®žVÿ(n/Mzmôy~?<ëQÑ€ƒä%àÊQÖ»4˜Ïœã3#&Ý~oÎOÁïº3ǦC"Kc¼²%ü¢‚l¼z–àƒr(@rçކĪI9åLçÒV{ò.ɍ!aÝO÷x_„ÔïΠ؃@í¾9Øíì?=Þ>~Ó±p—Öª¨cÕ>¼ºSp“U¤çg‡ÐP(âôN§Æcš"2”œZ?ši‘T4Œ?V²œ»%b3¸û<I£åʉÅËüYVÐQZt½Jòv_Eӏ€º’úKàbҝõ÷Ç@˜Ïê·X.ƒ{ðÔ–q÷ŘÉâ;ñ+@bV܀љTó>†~2›Àš—ŒüÝ%>ɧFT{81*”d@õDqðøñA·]7Õ7’Ò´º1×I;—€ÕëX[©z¾eré~[CdùycÍ“Þ}òÖx5ýª¶<õ`Ú7ŽÆ„Çîôñà$Q;úrl¡Á’ïíÂz43r)5ÝÅf˜zÒ¢™}”â'M·°ÍìÙöþÀte¦ƒY߀¹MºòrfwüÈdäöOüåÆúz{=%ìK)8Îû`žÕ(…ŠNÒ?¢‘ÈÉ¢‡Á¥.#Þí[uú¿æ°Þj¶7.›Í¸öŒ:dç‹ìiçÂR¶Hí{$þÇê“K-Ù¢±J³8éI°4Ié,&…9OŠó’”Íb)FÔ²ÙN¯=¸Ž‡Ùõ oDbá]¬a‰r/iª¦#ÈŸÛ§ÁŸ6)xˆ“¸µ5@L'IÏI-¨3Ÿ-‘zk£WÕäz0š¦ÑÞí WG×r†‚fõˆ˜D!©ÉÕF!%A‰âTF©«Ä¢hÃ+¦°/Fb®z1ób ‘/Hé‘•®¼.L/ép‡^” ;ÄQò³(S#‚ØËV´`†Nß«C®“‡@núƒ!°iÄ”@'#&ôsOŽmIÀ»>Ľ¤,M|¬²fNíXúµ˜S”ðÅ!’Ô(ñï§ìКm<˜ásU¸\ŒEáÒÉ<\6ç«J¥Pã—‹´ò‰[UšKâ–*ùz€TF¼¡¶C éå…™8¡6ˆªªVá%Ëþ)‰#*$YyYö`ÓT~Šl"›{aÁÃ¥j‘¼„Vÿd„úR*Ýuàr‘ÀX]~Q^¨YA†Ê••r$êCJ£]Ð’mŽuØÃ#–[sҐZ/¡ÜíĨB©D‚])^L›„:+¤C#9È)åY_óxðS#¡žôOò¡×#*gØÓQ)@bS±¼9Ûp`ÒâR,Û\,®Z#&à}ëÍY#`±ÑVÂÃfsª¾R®Z¼W¨™žAóšUtwööû½Q–¢t¾MÇ•Á;(ˆgŠ­IÑÜ¡å@Ñ+AçC¸ÂÚCT»ÁÐY iu#*øÑaÜMˆzg¢QÈí¤;.Ç\$ænK|<~}ØAë&ùœH+P¾ñÔ4Lù°b7±ö9°³»ÌÂ)$¡â`N#ö(#&C¡×Λm¤$øÊDåaN'‘ÈžA]J@"†ÎŒ#&%dÖþíÙÆùy\ÕB]•ùu­A3 ­ûš}²F€VÖtB¿U­u™ÐNÇmŽ{œ›²ÁŸ1›qoE›u¢.Ö+ìïÕ‡öçá}©	ÄK·×聩Q  ”×Áµ¡iX‡å­GµþSß{··¿µÿ‡õ'7¾.øÿæóûïïëý×»¯	éâ-;ëßÖ×o×7׿Z_¿\ßb»(à‚œ¯†“Á=>@’‚ÑcüËÏÆEtKj…^ ô%Y"/Êp¡¬É˜ß–kWØÔ¤WßÁsŸžE;?þ¸»÷êÁ³ãí—{?o‹á<*Úßò~»%ï ®½gÛÏƱ¤TMÚÙq¿^½ÒìW¯\"¶ÿlÿpï$:¯íýxځèV»7Bn»×£ooñÏý^]…’<ºžý@¦ïѹ<—Sa˜) @Z<{mþÓ#&CÍòу¢"¨Sà{¥Ü¢Èˆ¦SØ"ö=:Oe]ÚÊ%ù0œs¡©¦f52Qk³‰1Ê­€Mέ\ìªû90Õ]bXÝ'ׂ×2D	ì …4+ö±‰§8Ëè^Jªíy	¥y˜™º¸ÀšÕ[W««I½ÝŽë7€AIæ˜9ƒ~ƒ9X¾p€%¡Æƒ™u¶!dG‚vÕÆžúþwTƒ#*¤¢ÊnÎt'uNNq]¨PÊÛ?Ü!úý„ǐZn*H—ýá¡5‡îùQy¥ûÊg³ž-¶­;ü!-Û™_ç$˜%Pл%—T!¾F™°ÿ•‹”‰W‹YºÚîܐ›¡r¾—ìÿ~X÷ˆlM¥²¬>4\)fcw†YIð/ùÏ#Ñ1‡‚åPeýêD«#çd´Em­†!]U†š<¤ô¬AòÕF³u™Ú͆7_L€¬iE©(Ta¹uDZœgwê²#bõîÁc>‡îÜ•÷•wbÞ‰÷/ï()»àì®iè[†Ì»ÏèõdòV4}ÅGZNÖ’Dx ³‹¤pßäÃÇËÖܨÓì·'b*8ì߇†‹¢PŠð-6Oÿès'ºP±çî¸6£‚>Õ÷<|,Õ”â˜èZŸÝM8EWt·F‰ƒ9½™Þ­7 #&r”ýF$s{5OR Á	…¼4úãÏ°¿Ôé-ý–kÛƒªßºdR¯sr¼Óyöˆ¿štúü”’àï/‘g34àÙ$¤+S*Ý	­ˆc¤°N°6ž}¤#*’W,ˆSËzÝq*7þ¦DDª:çîBk$&’Ñã•ØñSp _ÅÑ`ª•"ºÃRîj½w´Â_h'’Ьŏsb' yæâ oº·› VÙ /«ŠÜcÜíw#&σ³·ôþŽkL)Ëãî¿ ŒpE*¶…KÞææ@¯²[5÷DHYZ¶œÁÿ&íB;\RÔ‘w-¡œâ–¢ø³fò?Ëÿ]M.6?9xÿ·þÕ×›ÿŸýÿý>õ…ȯ)±ß »1Ã0ò] ,ØElA??zºùK}mRwPTrK¸[q³Á• ËbËž¼q±‹rùƒÔ ¶˜âG;0ê“ž !X„DÆ„ßÖPލ•ˆ´¡ç)VÉ'g…®jÿÖçØëýæòŸÇ›EùÏææçóÿ/ ÿï¼Æ:­æR›¤;K®z=§ÝÏ5T|£VIÞ«#lBw°‹Ïd½»+}&ãï#&(QgiäytT".îýdöéæ®#*§þ]ªŽzO^ª‘ëgxYH“Ÿ5z«ÃŸC6rºPÆ~kq•¤÷\%#&Q¾C	ÊÇ÷—ßß9¨*o†ÏC߁éU´×ßwyœª¶a#&C{=Ê ›D⽎öh’^/`Š0e^€"—ß"AIid5FÌ赦‹É?º³lrÄ=³ŸJ¸mv9Ì:Î!$:_]~á»%W ÒÚb+5oÖ&í}¦?^þ/Û§Óÿ„×À}øÿ«õ‚ý×7Ÿã¿þžñ_	…gÕt¶ý*ÜeÄÚ²÷^6¸î£ûýá,³òzƒüÐÑ=šžEP.J¢«~ñ4‹~Ê#*b‘„Š«¸Ïå’˧|ë=„ñ¥wÞè«Æ¡ûÑ têb(¬ß]ÑryHÁê}c!ºVT]¡Jæ[Çœ,#&UË:W³ÉbÚŠvýE SLŽ@º9•4âÌÑšL}™f+£QÑŒz( ‚Ùõc`ñCàÔ["_ at wXnÿà ïê3d¬#*l…EWý7ˆW,XQ’÷Á4CH.4oú:‰Ÿ47ÿÁ6Íyþ4üô€{ðÿ7_²ÏÑÿ›ß|ýÿÿnùûb›{Œ•ǤԼW•ònº³ìº;bó9Ç;ìÞÍûf½ôjM¤[Ë.›L/:œ:˜_{!1ª{¡™‚”ôÅÖÕ­|ç@¸w+DO—R¯“ðé"è3¾_m‘Ïä¾(©’u ‘®³A6YÌНñ_8V-˜ò—쨧ðÉ=Õ¾îPù·Œ¨}ÍvwUÙ=ÖS*#A쀻:…ü^rÆm%ó\ëÓ£Ðóƒý§ç{‡/·O^ltØó_ÊSUsü°¢[)†Ã3îóáxpþœ~×?ô®VHÓîÊøZ"®8†y#&ûl¤üNV_[ã~¤ôûzÐíÃÝò¿ ‘ý\ï£8ɵ©/£Þ›qY=µV7#*¬eI~ËA—îmÒµãt¡³Á¼úŠ±^~.S¯L©7J «»ÜŪŽ{£EP‡™hü4F}ü|×Ø3᥺ÖÆKØ;ׄîl–ÏâŤWÿčêI䣒ŸÆÍÒiTÌ4/n2Ö~TGââ.N&º¸c½1úå£$ØÂ`ôûô+E^<‡º|â}ˆ‹JFþñWëy¯»ÜÉh‹ÿ&w5Úâ¿ð-†ù•¡½mE‘|B‹ösÞŽø5¹ä{ÒTæï|¾¯®“mé¯_âpê«'›,N±)÷í¸l?ŠË¡ö]%þ#*ó´ÚïsùÜráäåÓ,œ››`ýÜ$Ëèf+XM7má¢ú	×Oe¸È~R—,v0!ÁŠ)ÅûÓ̻ޞË·n¦IÓFï"¼R	çH$#*šd^¹@ÁkŸéZœ[O¾ƒùf˜Ql.-^7&{¯3­žU]ÿocu at fÛ<wXMMrM|êº|ùýÞáë—'“£×Ç;(“;{hïTÂÕ888tÙhç$Ír~5ï”Ñ7À_ËkQ+lIãH=º{`Éúâ#&‰’-ëï7 ´V\:§ÛÇÏ÷Na&pû¼ÏŒ#ò‹Îu‡ôLÏ‚~v–’mùªd¡¡f²ŠÖÖ´€øAµ ƒÎÅq—Ü#&Ö–æX&³îM–þàñµµKú¢sH¥_!V‡Tú"÷µµ”#&püÚÚ; zHJ;Ðï´Ç(gЏ_j6à#O‡Â1µî@Úp„‹_N3LÙâ‰/?»H’ 	,nnS>.ßG¯N÷émOÝM#*LGÇ¢†W£o„9Bˆ˜mXmJQ ŸÅ{@ã&¢ÜYAÿ$‚ê\õLž¼Þ‹„óJ£^¯Núµ#*}• Y&øNkæ…^eK橐Θæ ›s|ð~	];Wö–ÎRé³.Y³É/¼yJ³¶róVH:#*HRÉÍ‚#à 5U¢Ís®yM›Þ½+¶rLbÔ/¡/K#*ÜYÊüò@ì½ßXÿcóñWO6#*òŸÏï¿¿SùOv½ b ™#&’I–×æ?D1€%ìÎùs[ª½¯‚#–ñþ¯²	`g–Ó;F«óì­jUÏ•ÔŽ)@~€ùæÄíÊ”°ä\H>iÐdY»Ùb؉ÔwÊž¥¼„ÅÜð¯ Hç@‹½ë›I£ŠÑ– K\–‰6°Î,	ã;ŠˆŒ·Ã@òV9ÝFö·¤°Nñº†®] ·)üêç$Ùw3Œiø„Nñ/TÕ”Û¡ÖÕàà¦ïò¦ ¥¾úëå¶`<P^ÔhC{9c1S¨>Ô@ûæñ`ÐÏÌài\0ÖìÄžJ`ceªp9%Ôßgæ!Ð&`Þ{Æ^Ä>Eç#&çù784×™ã9‚̲\™óA›ºå—Ùø¯W)ã3M,1FÃz—»ÕDz*òV£¿\BºÄv‚ÒŠugOä(œÐµG!œØí8)#*¦gáŠìAÖûÆ„ñA½~1æünC8óÔ±08ˆÁû{8!ïöm^®—>ÁXW¬˜ÎÀ¤lnc®8Ô¡ñ à§$ß³#&W,òÀH)ÄòÀo¶SŽ«ù@Â'ȤþªwÇ6°Š¾`..²y€¨n¾‚eÂÉÿŸÖOïWãÿÁ¥Ò~ÿJ˜œÜ=qÿÑgÇ¥ qÍÁ¼Cï&ºŽi’°&¥þ¶a-d,~Úˆ³ˆ¬Vñ=uHm¢#IØ#*èTMÍF†´ƒah}#&Y/5½#&bŸó!ůqâêÖ0&©ˆMi/ ÉÌ(´™‰Á$×GW2“²f¨)Nzûà+ˆñ/áo‰ ¨Åû1”ß[¿6Šbà°Ìy«¤!†Yûù—ß1s^°ÏÐF»)™	­Yx7Šâ|ÈSš-÷‹6ðÍ  ¿«ÕŽ¼·1÷Ö{»û;§Û'b|–¼„ÇÆû1Dï\©1Ã>ašÄÄŸ°fâ0näÄsXðìöÜ™.aÁó ú‚í…*áuãàt5|"äΨ&¦j#&júñP¼_qgü:ׁ§ac-óáÌÉüëJ33w6KH/-§?\IÜ©¤ÙÉ-Ó™á7g鄶NÛ‹só@ý±gZ²i̲Á,ˆ¶âò‰áiʲùF]Üyw°k ‚ŒûXn†ºœxÿâ{²ÑôMçÅËž<÷>†þU¸'#8oêmO¿mØõ`j›®£yé©Ã÷T³BhY¾©ÿ7Ö#è>rEŽh ÿ²Kb­€ÍÙìgt>Û%q!)?r-v]xù¯„E#*ؼ¼:\§þâææC#&ʯ`͸F¹Íÿ vÿ¹íòò+¸ˆ¬[ŽÛEp,¥m ¹Qç>‘úúW´>ä]¯¢ï¤áX)¡;§IF&>•”¤VÛÅÆ“ÙMw”nÄ¥{J›o¡i¥ßV±1ÈÅüTþæ’©ƒ©ýpaí±Ó)ýk’Ð܈ÿ8@ì¢J?yh)ÿ1É…'ý©‰?[Aˆ_¡X§”¸-x® ýý~^âZß½ƒŠÇ3ÞÍ´î´8NƬ(ôlƒŽ”“éè.#*ðƒ¾Ÿ–†pÊÕ±б?²Í«:„DŽ­WÕIWNúT+iŸ„Q¦«a€+)ÈïöŠ6»z—ž™©#*õqxQ£ò¶:σÒ&6Y´ÓtöM‡ ™"nñd"H•!§ºx°¶"è2 m‡AtJ’–U݃±=ãç,<LIÓ‘ Ö2?/|ÄiV‚Û†«øHxZx"¾åH)»Z Šƒ &÷<d¬Y.c¥ ºJÐè´4Ö́Ο<øk<¨·º½ù]©Õ›³8jóŒ±ÑßK¨qkÌÓ™›t>äõM6Æšx?¯cÙf–Ôy›3ú…ÆŸ´×š3¸Ä›è³‚åcLôÜá(5R²”LS—”Ô‰Ýõa{‰Á•I€$“ ó‘;?{âѤ‘jKCê¥Û ²‚¿¼mÞ]«Ëe~‹'fO&fém|t†2Ƀٸ+&þ	£ó°;œØÁ¸7Ä€¾Û'×Ã>ätœÎŠ&ˆ„Sp–©%YJö·HÈósîü¹ov·”SVáv­«æ‡$7âH;\2{¸QîÒÝËØ/ϝy	M®’—X0†FÐz³%­(Šv&‹Q¿î„&:fÄ^	¦>Ÿ#&íÚ‹á#ž¥k ÿCþU†¡5“Ú"ÔË–mã Á¸ô1‰eüÚC3Y!ŽÑ•ô“QBÿÀQڹ驻=3sßs¸FOœ·%¨#*<H6µ'¿yjöÆbÅØ”ÅАöªÑ믢Á²ªžé–«.ÔgA`*ö(©mxD©.(©¯3ËGÓNnpTϯ©MW³¯y ŒK)×Rh¾â`=ËóÊ©H·ç†ëZ2ƒÜ“¬¿Òî,"k?Xç~~é`Ù=ª6×üG»P1XnÉöj8VGsÜ?Tº²t¤Ãñr,CEü(Ãv?bÐ8_ÖãÜ©<Šß»3È«ƒá~+[ÜI˜ÄM?+i ÊZÝnâÏqtr0ÍàäY6:u^5<³ƒ¿Âpnˆ¹Mê‘€ý0|ß	ÆY5±gŒ«]Aåî[“föÑÞú£3ï ØèðÝ@Å&Ú ïœô¼´w’÷©»71"²|ÿ´ÉX\rå¤.â4Æ&Öû3qUQÔ`˜rïÙ»OOÙ†Ãö’HIá¤ÎþFêâh$J&côktÙÉs5|/yègg_DèÊ%Ë$Mo[ù+©ŽÈ+ó`7U_…ì“nêΊ%#&ž£"™{!6cÚžN2~É(ìx·8dÒX¨¯JŒU…}0iaïhÀŒNEEçʨQhO`‘¸•+Ç?gáXë8eJì3v¤˜(‡BšåR"P*÷!†epש¾Òüù¶Ôˆ¤Ì>îÂN6¼’p4÷úó³Ûö°ž^×DPcÇîú$üÓŠj‹ëjµQ~%R¾€tF«´âZû¡`p®à袇·e½ŠÝô.#*àís°;.>*ÔmW™Þl]&}-­.%LãÁ Ôk™ɲ¢y¦ÈùËÁ(-úŸaÿ«¬ò'Õ½Ïÿ×ú“¼ýï×ëß|Öÿü}é~vªòpþyù?±ø=úßOžíÿ¿þ|þÿ%ü…‘¿ù_÷:˜9‡`¤^¡É¼ïÎÆÉp|9)Õ#&÷®Ü—º¨ö+FÞÕ_½Açê@³œ×žo?ïl’s*oýŠ÷üuÒ.Y´Ü›ŽþWc	_½±Ó¨ÿ\ûPàC ±ßM†ýú«»Î>Ü•ÃîhøA“â?û¬gqÅd”€þEá#&Çóú#&zOŒk?×êõd¨Ìi$§¨vøŸȉ³§w¨’•÷©]Ô‹‹þøó«7§/Žw÷‰4 ù¬Y“\p,*AA€“½z3íÅs§²ÃŸÎF‹ËN¬_nï<}}¸{€&‹Èm15ãèd×hTUã¼WÛ§§{LJ¨}år¸®Ë	&çæbЁ}ü _>ÝÛ}ø°©th+šØÖñ5òê ùa¦‹F#*p%.£#*P“'`Œîu×êÍoY™Dßyo"´pP\¨	ëR¶€¾TԦЪU†0®áöjºº:É€Ùœ®:ýè$,5°½¬$9£çqW5ñŠk	a:œÛ †ùí:ÏËå¤Õø²N#*Ÿø¢qq7wþýû‚Ir‘5”“FVØŠ(ŒÄ>qZ£4ÊÛ¸*@+k5–wê»õ-£õB{øÕ›è\ãlIÊ‘¨:jïM§qøR¨Âø",V­dË·´Õh4LPF¬N‘j¤OJ+N¼ó]F"tËîÊ9#&n.›hÕz„nD Ø¿—Û¾ ҉Γh­%ÒŠÏv.û¯±	é+.X¡TR…SƒÚÖ2=]2sᘑd#Z1OG¿é<M2O6‰<Ñ¢5æïdþøÝö73`þá·u´"è`wHhs(F·ƒÄ%&¼à¨Uë—>"ߺ/蒐b±KvØ^#&[ÞáÎppq¸¹’#&ŽjEÚÍ,ŽM2ià]R•ö¯÷Þ ­?Õ¹]žG'?vv÷^½y¹wxêŒÞk… ¿5ÅB1ùÎÌl4Öz$úi,fÑÒïø¼*_øÎÏr“’0|äò…¢M4~Ëûq.ßVy¤éwƒÙÅD”pl	éV—®¡\ûÚFñwO¨BÞ½ndoý4Fy¿ãYÃכ돇[ü€ßãÉêFBñƒ)¥Ð7AYÜ |pà'ˆd‡|¨€žoX³]E2’÷o°¨„(’r¢R¡=N[Ö÷„z"œÇÑUÉÒ””R"£í)°usi N7	3Ÿ¦¨A„ÄÙÚU×Î “A©  \Yýáb‘êz¸Ÿ3¯#n½·_ƒ-9ÉûŸl<ö”±ãÙœ³noçç½s;÷³j`²‚à>Öû"z—­w½ËBò:Xo]õzI]ãúXW»$c”Î_÷ŽOö5;ÀÁÔy®˜2yOÃœŸØݵ™ù®öBô¢([›#âv–®êq))š÷bM²ÛÈ#”wi$þËNŽê'oNöŸžÔv麩Ÿ¼àÏý§€LñÏ«ƒúþáÎÁkÀ9o5Ù;Ü~z°×9y±}¼·[¯DHrîqg(ÚåFù:9r¿¸ú)=q¹/‚Lê—ùzu¸î%ùîi¹ª^Æé²{"9k‹dÂ+˜KŽ&k›ð6ïΓ³ˆ˜Ò>\B“ppeOC(ä,DµÅ¹í ¯?x7M¦hXQ—cž2[kïêüðƒî7²¸ÝP?÷£É•†ѱàF>—p·SÇ›Ðr°BõÒjn™ÂOÙ.6M·NPîE±o©\l/Jñ{Œ>R«Ö‘saœM]ºßï–“[py)·î¹õÓ{à0ì·üŸUÆm“ÅΪ›_;6Ý*VZ˜+à•ÉùKPP1Æ–‹"}ÑFÝ\\­Ä5Æàšìâls‹¨`‘Š®šFïë(žp\.Ó¯ìÖ‹ëÕýÝÀçô}Ë*I¢’äÑþíã•næ­Ú¡‡Õt¼dþŸ9Ǽµ÷Á…£ÕÒ+ÒβœöÜ,¹~9×=jÖOãŸÆ¨ŸÎîÑåb>hHÇÊIçüU×Â]A¢ñDvþ¨a©+—0C¨Û™#t”ëryßà*­w¯º°[pÔ×þÀhe“›2èÓ¨Þ‡›«|ÅÞëбYwFØþȨê®5ÓÊ…Ézupþ	þAcs}¦ØO؏oȤ¹×#*:{ž_wõðüØ~SoQtôp0‚]¸Œ G7zƒÔï°Õ¼ýv›$uÿôÄøI¡ö$þ§;%ç©#ÜsÊŦ)ðžŸà?ü÷týðè´þìèõ᮲F­ÒèòÈ5˜ô ùL²MÏ^]2ò·S\6Àû—Ú”.”´¥d)™È)ó½ÄšÙ‰š¸p¼#&Ê×W‚¶£ølkØ,ö×$ÅvŽŸí?7d{Ð>!š‡uHº³FîÙ>Qø­AÔq/‹]#w ãð}xîEkÉko;W«#*¨@Ô0¨8VÖ1wEµxxKíÓ>)Éy9N]sSþ£—+*êrgqžQ7RºåêЗç{¢x™ßúûòƒçˆHÖWÊÛÈÃOVo4ZLÕ¾vëÁ™éˆõ&hiJâý½iäTÝ«Z¤$_Žµ/Quf?´ãŽ¨ßLúÔfÖ{ª±ºÇg®Ðyu§ƒBä+/ˆÎ’FÀÞFå€Ä+ö+Z»OÖp+õækÝÑ°K~âû*Cg««º.9¶|yŸ$håGvÊÔ^Ú+s3p˜Á_4/¶ÿº×‘sü"*^—³î²_)?)bøú›ì*Í›˜{½„g³áÈܯ¸(	¢ñÜÇðj\ÑäTÕ|EeK£Í™É|1%‡'"†È‹5>™,-„Da!bÃQ{¼;éáÈ:øž±UgQ(úP¸ã<¢É”àå-äŒÇHý9áÛs 4šTÔª¤š¨BZ!´¤è½nx™ 2vÓLÞ~(Èpš>Iât}HBA ƒ·SŠ]²Eo1-_>á?8û0è­EJ¢2Ê€ÆâÄm_p³põ³Çç&ù«sC‘·Â ˜½eZú.åì<]CERwɝñÜ»%2ð~;4¦Tœ„“‘“½ÂfÑãÊ]8ËEÏò5kËb 0&øªi¶aïä4!À,Á‘ÚQ[ÕԄߤS?Òõ¤®¾Îgq£if‚}sž¸à'©‡#&Fyf0 š*ÒÈa¨ÉƒÆú¿?ž„„Èd&­3o'Ïp…	¸…b¥¤Áå«´Ù:ÖÏæ¡éø‰i”À„«spBÊŸ\Ø~Ä)-³¯ew–œ!êzJÙŠ .£‘?˜7Ý)™½òñ¹ŽÂ£Ÿ“öÞ²¬{5èôÙ|D®P*‚y‘QJ|‹†Ma L9ß#&A&qiKÅ&ߥôšâA&Œ‚Äéot œ#5aþ¦x#*.4™Ô'p7µÈ*×B+Ü¥LÉUJ¿éÆgÍl¤ØxÉËXñº/7 x®v¡…g²ª›È½Î.™Rn ²=—©¼oâª	†E·¨ŠÈ]öA¤Í3a“’”"ÎöTAHs”1]‘åœ#*LÜCƒ”ø䲚*±1¬ñÉæ¨Qþ¸ÿç’÷{ÿžøç~¸‘À4bWòïõi´v¤É@±2Úô®%±=Z^tBE+‚……ÁÁÐùøxBÐÃÐ^—(ÍóQ·6$Ê×îDø;–Qå€Êi,V‘©·‚—Ö¸~¶ËÀ¶¤ö¹ÆúÂæ㪞M>®gäf˜#&úA×&Þ5TÇÈY#¸ØæI><yRaÄáƁ¾s™a#@Fâ.]R„CË?¤9½¹\tu×T¡X¡¿…ŸbfPû.lS#*Â0ï¯Þxïוö&À—г»NOÐ#&¹¨7Éh›3ì!bê›ÎÙdÜF­²Çê²,¹œÊ²DPû=êO²Ûß:þóÆÆ“o¾)Ä_ÿÿí÷«ÿÍ.ÀñÂt1{súàäœÝ‡¡—ÅŒSWàË]€ÈÉ6;‡óO¢Òèþö/·7#¥#*ÓÆF{½áF‘6^Ÿ>[ûSã/ßÕ¾ýb÷hçôÍ«½úu¸PÙátïe½—ÅÖ£G£I¯;ºždóG'ôRóè€ßcížîf^Í€œÍï0pOÞo <ãÚ]oÿ¦¢êÖwµ•oßî¾Ûyö”°î«nï-Ps§€¿}„2©ñÕwÛ¯^|ûH>rÕžæû0ÈÊÌWÜ!’}¸ë?t/«@œ¯Æ4¹ùêÿËW:<:ÝË—;}±R‡ÿmןïîoŸîíÖŸíì%õÝ#zµxy´»ÿìMUû{ŽËnf¾Î·xÖ¾}DsúÓkGÒæ¦ÛìÔ馣ÉJщ\›Üó<NÑB³½~?œÄ¯, rߢêùÞUiê<´wŽ+sÏ@0ExñXÑ•{š0na.á" C÷#*;ÙÀ$™†ÿìxûåÞGÇߣ̙õ W$:H?­=kf‘Œåd²‹ñðïV(KÒÓ nó6^Vo磪¹g튊´8ßNþõ<J΢5×R”Üʤ‹ÇW&¼ÐÕ_f¼œ¢;ϐb¢p2ÚÓîö9©Ö£§@yGt>¦I;HË:Sè–•êÄI`m`{ÝqËË æò,¬#&¼§U<œ*k-L¦™¯þ²Û;:AÙ\® €*ù8(ñÀI’ÙÁ¾S fyø’é!™<6ÄŽ_ßÒn{†Ìípš”·ß¥ëêv›#*œm½=_p¹"/Öp¹.GzB Íz‘:2ô#*U¢ÀÚ¤¢ŸøÙë è„íÈZ:­ˆYÆ-Ð3†²‡¨<½·ÄEZž‡_ǹdVeëØÙê6'‚ÚH!­à~ãÌl]v]£óüx4LÒÙx#ÈcïÃëß<ybEî@DW´¡Ž{âƒÎ¼ü-[á©;øÿÔ˹,–›rì:_RÏJVªd#*ä1¡z«0¨Øü4Û%×£ð³ÙÒuû…¤O›Ç}^x~_ùܪÁ…þ‰æv˜_2÷Ë\¶4ß@¸¸ýEÓW¹‚ál<Û	kí5¼Ìíµwãōxp	0Ñ‹éß±[»™Éov‹Uc1é#*¦¥”ìi9ç’yñq[Ý­õïàƒ9k½aEN¯·åùÃîÔhMCèQü J¬Âã÷_.ZL+ê‘lÃuPøô•çÄ[fòKÍK…È\xˆ#&#Ô”sãíWV¬­b™Ý¢Éðö¦‡0$±SÌÙ'ú"ř밁[ǯj%ºüÀ‰(Eš¹ìMíJ÷‘‹Ù`75Âû+â\ÄGi€lôç#¹Ï|±¸ÕÊÄšë_ ƒË^€4 •6„Œ2>tlÄc:4y„€¬…A Á,mVÂA/*^P5´sˆ,Ã8Ï®ñjç4B¿äÜÓèä0/Ÿ6z··„	ë½ÿeÁýnÄËÁËõ4`&âM¿0=ŒH‰Ñ[ËøÊ¢ öBe™Ë«•5”c¼r2YºPPíêŠ7i!ÏP¬…ÆoxY9ß[‘ÆO6Ð JÉ2˜á­i¡1J.–xˆœ\kñô-[#-QÝ·*”XÝ×ê¿7ùoïÓG¼×ÿÏ“õÇ›9ùïW_õÙÿÇïKþë_Ik"½ºÜêü·õõÛõÍõ¯Ö×/×·Ø‚p¤Ùžæõn†I^Šœ—³°˜=ˆ`ZUìGõîÑÃYQR|…x'"t¤kW¸ .GÝ+›³³³»÷#*ïz/ðIr¯$:9Ý>Ýß9Ø#*¿Ý¿’g©ÕcIs2+ÕÔä_.Ú|¶¸äù(ÙÙA%=ø¢î¹‡3êžV24úËî9»kž6ÿÁHdË~²Ì8»î…ÆÓS3™HSmbÜ^Œñ.œ¶ØÕö]5µ]bPÛ§†N¨©ZíŠzÛº–tÆ›l¶ÙnÇì„ò‚<L’^ò“‹¿QÛvÂ@ŽP.-ˆk+½éT%œæí		]7ÊÛ?ÜAbý…p7(:Š`m!YÖÐkƒ,ñýÅ-Õç[Ö]ö€ví¬°’RVØ’žwÆ©Qr†¼vyP5)¯VHUÍÎÇøÌC#*µu®þ./‡&vš#*:%•ÊO¿”qÁlÒâ¼È–qBdËEÀ¡ Y¼vGiI·:ÑêHBÁC‰-jj5…ŸÖñ”=à1¤g¬›ßh¶nÐf֞φ7_L惬¥"¥¿E¿qì”+ÏîTDŸF”xçy¸+íoº*‰w‡#*ª0úÎÚ¤2\Hw®'“·¿3áZãyA5 φI#*÷K>¼\Us£N³ßžˆXaØ¿­­TH³òâÈg¹`r)6áwŧ:©vtÊ\°V†’+÷mñ=ÕÞM8?W“9\è; ©ÉRoôz#&À5°ºñÈÌžŒ$=€×HEî?ïì`ttA×ôSð=þ6§Q>u¥¸Rçäx§óì—?þ%åôù)¥Àß_"@øYZÉg’»‘DϏ÷ö£DüØÂÞ›ðÇpœâý’d׃ÑHäôP´ÓëŽS¹<ð7%"¢t‚¹ã‘Ü2X¼‹::âø]è?&š!ä¹P,ä.´ûÆ'T½v at cÊ¿Ù;88úÁpbG$MÉxoº·› ªØ /‘-‰2Þ¸Û¢úíåÙŒ‚jžAý‘„õC°…K)Çq8åšÒ¢e°<*¿»´%C=›`Õ;ÄŸÝ=þ'ú„{®ûÉ9À{ü?n|óuAÿgssó3ÿ÷;Õÿi³ÔŸä›–‹SǏÌÃ!ç&L†ÚR5 {ü<ª?ˆ‘þº}°¬nL|·¸ÊóƒIÌÿ„¡ìˆi5°æN#á¿j¤"ßté ”[‚Ò=ÔäîÝÞ6â’0k!Ÿàâ©t’œÂ©8u.sÎtf·Ç¬u%ÒD⦲0àsäzÇu'Ó´‘–8"‡äBÈ5,î4	–÷QÒ|ϼ%Ïw­õd#ùZ¬Ðœ‹F‘Dk;ø"³ö÷Åp@"YE`²“¯s‰¯17î0©ãŽµ5΋¬{¶élBZÅÂ’“¢½®-ZŒ~ܹÿŒùæ(w#&s=S…üÿÉP~r5Ížü‹’}L2j¦&‡u}\ ÈÔú¨Gj	–Ô>4ö^Øgu­æ‚5W®i#*‹úM².†½!4Öd`ÁãŸï\bYÚ×üM#!æⶄt_€i.ìëĐѪƒb™¾dÂT-:|3FcA5Ûa.çj8‹J'2`+´1Ÿ·ÃkÍøèi¹pý:î0_[}K¾ëN‡øí0ˆ&d%óúÔè©åД•ù.3}{E½‘"÷AèLgÃwÝùàaLF½ÁJB×Ï%¨#*Í6:bÛé«¢§yÐtoùåð…öŠFD/yãÏíÔð¥ŸÉSàîó‡ÃldüÖ¦°“è=?;Þ¿\]à$gÝÐyØþNNYçrxëü´Ûšm‘b׊¥?¬èÕ°?zpÑY±¤±+²{ È!#ljꈓÉQ}Ša<TDDt¥±.[³–ÃK.¥JuÃþSÔ}ËÊTàoì¹¢ï»ôò .D)ú½#&nâ âˆs’‡‡Ã;ôÕS#å7üC¯(‰õ†«Ó°j˜Ž_`ðkøÌæð\ˆÉÜÒ³	‰œ&ùÅÂÀz“v¶¸„¥oÅiÚh_7È•a¯ûª¶|U8µ#&ÞÌIƒfLîaV`ë|hpßQ]ŠPÅ7 T²âÕ¾Ÿ½:ÈFp÷j{çûíç{Dò5†´*Œ³èáJÌBÚÛ¯öuÓ±íj•d'¯„TW/›mv/Ë"M®Áž ׺™mëíƪ–Ûàž[Ú °‡·Úh¯7ÄýGè†UüR V at ZkÍìyV‘ÙJ¸„§¾=ŒHZïz÷ó¬‡ènÖ#*ô¸²u*–gÒСÝíÓí㣣SꧏpC!*{ñCaÀFZÛh¯G‰nB€<ÏŒG8Q¢Êl}Ñn»¥›	÷ep©	¼Ä‡E[ég…‹6¸ë‚áZÄÀ“>)…È>dë}}Pb¾à“IèH”šÜHÄ-© oM¡|·B^L…×ÿr%õ‡f8_;"Š/õç®…è)#=¶/Õ§ÒÖÜ}NÅd¥•–ö"_ØõƁsD`®¾nSsõ¹ÊZ©Ÿ6Ÿ΂._0a«r]æTà¯8ö[ûEL“Þßn¢2ftà˪¹R®^ài©HŠðBvÈÈGhúÝ©è¥Y}®$´Ð`Ì#&¬¼¿FOÞäæ#€³Cw)„Ùíé„ýû²kK+Æ‚h·_nRÉiCd;ø(æõ$•\è?$„%Õ¢ÚW†Ê_[yy9Xîûn.T¢’zk6øûb8c#$q‡êлëSö—¨qÓ¿MŒÿhËhðwW™ [:¸:ÂØ´tËk¼°a‡Çe|J«E§·ßP£ÚÓ ÒÔŽgUH-ëÏEdO­@C]jåø?æ,·#&:ª—‡†Ì¤ yIéš$åÁ	+¹Zèí«ÌãW–9ˆfêKÏãJñaÙ®Vá0RyXw¤!„_*ê3äO‰+{{%ÌHâ—Œ	Ï×ùjX­Ý›Ì<Ûβ£öŠÈ<”xùÊ7ï{ñ§€pˈJ”Û¶Ù»úkŠ_ˆ/£8/ó*Òvë@ ¢Õà†	ŒÎ{#B·°“Z.·üð*ÁXÄsycËïÍPo8¿dÞ¤Haò?ºþ'™v^aÖµ9§®ÞÜ©»£·JùrsYëÙóÝ°¹uòkO¨® ç}!ÃS”Fºõåö·_î³2¾ª3€É„Ý5LÆlAa#*Þ-ˆ¾´½4:áå4G!d@‚—DϏžþ÷ÞNYТòø=Z>.£+Å9§À÷-G¹#*ÆÍ­=?}q¼·½[ÚÛòîJ…œ;)³Ï^q¿Ð±d2àžBøºÔ³Åhð|‡ƒ)/çqůT<z…žðÅeÑ[ŠÈAñx3ÉÖãK?¯‚ºqX\GÊ5T!#&(Ùò܈uÊ ;ÂÂjÑqd`1beÅàê°Öp¶¡‘@¬æcN-mèÃÛ!Æ7ßÔ}bô­û¤|ޏPÎî"NTõâqò$þÈ™õ-™/ml#ùæãëJ§·@W|d(+4`˜½’På.WŸmèõµß²—:º:·&©¼‰¤ÔhöÛô?òö¥Y5y-qÿÄl={â÷Ñ|؏bŽyç„Ü •G å:0Yú³ò’Ñ–âÛµM”Í(­IŽ… Sñya=HX[ëÑ#eײè—ÚÇßNڝ³¨;'U‰èü!w”ñ Ö»¼j}ù¥Â«žF÷Ë&ƒÑzÅdÈmñ¯6BáI°¡‚ßdÚ\«#&¤Q¸ÅF’ák‹éîD¨ÂÓ‰Ffja„œœ;e”¥ž­o=>75ÏÐ!§ñ™)éîéߝòÚ×rŽ”Ü£?CvÖ€Sÿ_áNƒyG~T¹þ]ZVsÇ2	à’3P's5'6(6Ë1c®Æ·ð>Êk€æÖpÏÔZ@½õ…{1 at QBŸÊϯٕߨ3Wïw/‡›Ó ù|A㉭Â9V‡ŸøŠg}‘u®f“Å´³³£ZæGžfÕz9ÿey*Ø{-Ó .ÆŠÇäN!?C4Gâæì”#*ºy›ÀùCj·õîùËhÈ+›Èvq+ĵœ^NHÜrâZ£Ü—Óÿêÿ#*æ?÷ÆÿýêñFÞþçÉÆgý¯oûr5 Ðiw–#&r†=¥ñ…IËÌú5*fUá…ÉWÔûœò&CKBÏá<“†Ú.ª§õQ7­?Ä1öÁnçåÞé‹È1êÔ(‘­›#§ÖK4Ô9Øšb°Iõö½Ûù+ÿÚŒë?¾•˜÷áRê'Æ°8¬:ÁåX»éõäb’m60"ñŠ¼òKí—:r.X\›9Þf ÜÜ@#*6Òs-å›Z!WÝ—­•åvlCÐÒŠoª¬ïˆùÞoT@­ý‚A©.ƒU#]´ÑvšˆÝç·J Õséó`ÚÒõÚÊÅâ’ΛîmŠâû9:8\¹\#&ǘÍrý᷐M—Y#*ùgCySè/ßÀP=Aà9›(J€¶†ìý¸´ÖMÚ#¶i5Ýðï~Ђ¶AÕ4|ÞŠp)ØöO?Eª¬ àÜýËÖL­GѽuP.ëÃ4ž¹ÖmÿàªôÂubgÅ2"笺0ZØ?ƒw<#¹¡s8HÈģ–mÉ5¡-­ðP¥òª«ü(_yÍUFZZúœ®›™ÁêøÜL~™ø?=Ô/moM?#*M?Ê7mÚ£(<ÿ‹µ‰¶ò@T#*$»cMzošŠûÇn Œ%8.]º£Î½ä‹Ê.ð}ˆëg-fÌÊcÃbTg5ðÎ2P°ÇWö(i6‡tæ}ô68é§lµuöÿ|¾7bSžQPž“––ïÀíˆwaT„ò[P~«Õþ²´…™jœýßô|5mµm#(cµb~)s’°÷rf¿ubRýÁ3|9â	´hp…žì£±"•QPæú[¬ ƒ…ÆÌšÏÄÓ…C™a\¥GQ¼ŠžJo©®›ÒÊ42ttq#&Y’­›^5ºT§âŝq ™±íâ·ì±=N’ÛìdP|¯õDUAüñ.B§Í+j¸‰ï«Çíµv6èÎz×­ÞÄ	Þµ¤qíä¶e¶¸hE°¹ÈϺl3‹±ÁÒ Þ-pù‘fFî"Z̳#&æªl©“¤ßtç½kz))·b‘È&ßK[ è),’œÎL+NI›r[ù†ÜK`E‘T¾[a)×*MIp.ò•”OŒ"¦›#&©¤*Xx:ËÇAY2ú×ëO™Zz©0“vuŘª:`‚G™èøQð¥P‰&8/)G½¯)º·yԏ±èéùBõ‚u¯·IˆNiâWØ©ƒTêáÖÒ”õ‹òD=°«_0§{èÏ›î[' ñ&Ô;`T¿e¯£ G§ñÖLñÞ­¸@GƒåÖÝW³Åðmê. ¼dò&Û±”jûåðN{XâAÏ'&µ¨A~‹´T3Ñ‘ÀÑ63"MzÑ-55 LãYèjp¼±·5µå[¤¦èM„#*˜êfÀŽ>MUdå}_Ú7Y“³¨Ï¦	üpÖ“@ݶG,‹è"ýŒ–ѝfæüU5çÓs+œ®ÑôwoP0Ù'ñb´Gb¬³½#%ÈQ™t‘qÔóv´E#*NÉ/Þ¿A¿èÔT[åSeô‡n“«ðSKžÝ¢6‘Ò,¿~h{Ž"#*M¼¿Ûð׈®‹#¿úÑê[Œ#&TSÀˆ$;θPá<ã²	av2:8f¹	yR‡÷™ºˆ(¢þuiK±~çW†5Ï’ÐhÝ7‘ÐŒ¨?út>ð8 •uM€†«YÅi~ ºžAIË4ºHŸÝW_ƒùÍ4Õ©B³z9h‚z!«u ߈mGƒË¹l×¼@ŸË`µ»¢¢–V1!ßYu¡Ü~]t³š³ÑÌ¢Ø(®¥œbÖ"ã°ªY¿Ÿï”ž•»œÚŽ‘ô#ñtç¦ú®¨¬3¼T¼]½<îõÍËæ]ø~ÊD™ñf ú;ø Úl«#*{;PÄtárɃ׈[ѹýiµï“éqBË*þñê†HÌõ+7Ô’)(„þU§»Æ½f£œ¨srÚtŠ?¤¦¸.iÞ•{Ÿ†¼g’•œ¿ÊPÍÀqÇT^ô-zõ…Бˆ”W"…<÷kµ¤Ëª„Uðâ¬[/¶,„/V¥ë1c”·Özò®¸3·LL{¬pê·G¹#é»vXCÞÆI½á.§7thhb‘eª™þøoA«ï€ôDzc„æMRDËuµÙÒÝšÜZ…¦’-ã©!¦#&søxì]†ãGN7˜4„ÊݘÆdEÙIu›Ÿ EÆc_¤bÎék¢,|z67Û–4;Ý„wŽºKùÿÙ{óþ6Ž#aøoáSŒ‘Ѓà!ÙÎ2æ¥IÚæcJdHÊQ„ñC&.a #*Œ©ýìo]}Í@Šâu²J,è®®¾«««ë0MNµ³D]>#&ËßÛ¹¬À"í"5du/B–!~ˆ•tÞÝ’ì1Û—B5ZÇuþ„³rŠ	t°ã—åç§ö1d6ŒR”àÈàm½ÇLaý1´Ç–ðŸ¸n„5a[¬Õ*ÚÊž¬¶ôIW¢×tµ©5r¨þú|Ýo(WZT§¹¬G.ô’¢9Óㄐ@b9À·3ôè`Ǧ	ºˆ5±ÎÍ™R£HÐÒ,#*Œ•/ˆzÌb6ÒKáÒÇ÷¸²Ž·Ž^žžœ]¨þ+gRJ»ZK‰¼hFj5ì•)χ5„î®YŽ sî-˜UµWW¾dfÕ&UZÐò3;§z/ç÷­Ê#*ÖÕ7w	Ø5Híek hµ`POfîÀ*>¯2c¥xXÑûFž«iWÒ<s‹K˜C9Õ]<“2‹KfК½¢™ÓÚV…“—ªE‡d¥82…PœÊBú„@ÊçYïÊnÚò‘ÃQ+¥þ]<+mbªËÒ¸-Õ@zLU#*]ÇÝìåMbh9h»šö²K	çºoWcyk“K|/¯¼[à8­˜¥°­íôßg€“A]Iòñ2à‹S‰µBñÅÞÖÊC‰H#&m–™‹ü­)Ni¡£5e@œí(-Vàµfã‡Ã½ƒÃ3r.G¼¿Ýºõ¨iaiUºÊßØA{ÿäåéÑñá:;0ŽÔlrNYYOdGjÎ| úË#*‚þpp¦½šmµœCC8mऌ/4§”ïøV; •*M)ð­vq­Æi–/5\«£ûd2éuqô“¸÷‰fÀ%~GèûÌö³À‚,ÇóBN˜…&¦øz;$7ÎúæÇ¡$ݘOpþ96 ª	¿š=Œÿ^]ûÚ#B_ÒµÜadÝÎP/E"tT}ÊŠÔ²]Œœþ.p7×%þÎr¦'N‚ìë‰'’zäH/?kuèB˜[¥Þš­±½e¨Yí÷52´#&M­`²®¹t¸QNvˆh˜º´ðûZb1F¾Š)c§LLAÙ,l‹xÅt±”\âôÒvo¾V«Q AÑ71P=~PÈñOÅìYi!ߎPˆ¶'®à)1™îZCò$+FqÙ¹P*y“‡nmº‹if›é:~G:åWJšYãÖò–åöíñëÃÌbã“W9“S_)¥ÛQ}¯zÃëÁ4ºo`hïö·G¯¾{yáÁ„ñxΆ¢ñ'[ú„À_AÉÎäÙ:Óš 89_^¸&¦Ru䏢gÄuÈåÕ#*î*û°e|‘#&þÏ¨Õßïuí̓u¬°Vå.«,­X—	¥ÝçSz€G¶šv\Ó¾Hü®gnñדÎ#&¾F(ËÈèù«·‚¶öÕ㣎ªÖq çD)mëXÓˆålïìïÔ¯4µ-ÿ:ªlw©÷N;$my1~’(+cÃd\p*âêsÁ°[#&)fALU¶L$ÿDg—fMH¤\¢°ì¦{Qa†0…uȃ,‡žåŒ4èj-µ®8#UOp™¦$°KÊ9/®¥Z–ŒXYîÊþ?ãþ4£ÿ}×MžÿÆþ?7Ÿo~óU.þïÖçø¿ßø¿¤¹­T|_'ôïû•§öAz§èoðÞ®ǹƜï{rßœõcôãÁáóöñÉþÞñaûèÕùÅÞñqÝÿøÖ@É$€‘*–å`NºœYD°u¿1ùX=®¸Ä£ºßŒ|Ë{ž§B6z©ê¦­vƒ5Ò	Œ_”NÕUïdQÍ:ùˆZÁ¹Œòƒ¦Jªßþñ~ûåáùùÞ÷‡ç¾B¥™ —цQ¦0p¡ëP[%¡Vâ`¤p`I(üZdÑÔ.&Ýþ"ÃD$…uÎöÍ{–.’1qòß‹ž$]/Sl<I®{ó¼e0fº.Å\McuÌÓ4KCî‘—ÛHo;“dºœnăÎ]²Áš†é,Îcà¼èÀÞí%X@øk\‰È˜RTnšÖĆ[„K'çÚA¦&ìÍGVWT_¶B{ ½*’Ö””#¿"~݇š Nè3ÈΏA¥ô€þ-×ËËK4§cwŒ×3[…×ÿjûr–»ž±î¤²ý ¬ÊIr“ÌÇN¡Z3=o5“ÃVszѺLŸ^Öø[kþ|™¶Öáëú%*Wñ{õ2 ZI!Wc£¥‰N ¹ +µvx—< ]_€ù”¶¬¶ƒÌG­0fq(½†‰Û?9;DÆžÝ/#9×G0ë峏N(³7Êgýpñò˜2o§ƒ~>ûtïì‚lòîƝÉ4ÍЉi ÉcÊ,²‹wBe)--NèÊ0dBIfÑ…«`[¯â¶¨v»^ž—PÕ—ÀÉÊ.ÊŠ¤ÃÑÃhÔÕÚ«<‘f.¸6Ö\UT³Ž¼  Û>Â4Ón•É|vŸÿŸÆÿ«¨Jíx>ÿd÷€%ü?0ýÙøo_óõægþÿ÷ÌÿïÉTº›YsN6Ü46›N€|t7â©Ö`ô«ÿ®7|¶íï4FÝc Æ›õu¿úñÃ#&ä`º$t;7¡\üš÷ãõuS®üí\A…~/#Òt6Œ9¾R“o2z“ÞÜÂ~;žÙ?o†3»-|}Ð)¬›Ü&¾¿=¥iï#*è¼êdM	$è-‘yØ°Ç¢©ÀZšiû1y0QŽ#*JT¥!ÕVë‹U¡Üƒ‚wëÏzcqž…¶ìA’%×zžê¤«ømÝnÞWLþu²o!ŸL¥FÅ£k)¼Žÿ†~ú²‘;ûW'`ªx„È(./;‹Ë:9P8,vuQ·B–Ü‹!€ÝôRlH\ƒ¹kÏbZÞ¼&ê ÜZaeèn’Å ™Ü$¨AOŵÓ#&“â:‡PÍ@såéâ‰Í.‰à¾MMˆÌäZÏkËð#*›aJ¨Nsݱ6¢îà:Õó÷…„›.pÐ@á}µÄ.Z&‰‡ËVvw±GèÒ½çV€,}nGøž„o+ƍ̞µ;ÚüI쯯º“È•Ïø• ¨T]AÏU<—k´x8²G#&Õ?¯¶–àlÔïÞ¡ƒ/§Qïzý>zä Yg\*Úñ°&-3ba®ê€ý\Tó„£*#*%vÚÒ½›§#&xo³Q„ö G¹±6ø3÷üßM'ýô@–ð[ßl>ÏÊ7Ÿ}ý™ÿûó¶Ž%!”À7Úiïü%ºÎHÑi†·mtR|Ôj@:~¤UrNOá¢ÞIÕ«óéå읝½s;²bæ‚\v¹¦ºk蟽ú131÷#&Š´¿>©ÞV\—Ú¹,Lærµ­­	ìPoÈ^¾|ÓG•äÊÄó"kØ}íî¾aÉQÒ$ªQpõ¬¢7Æš ög4ñ÷÷ý«¤	ƒ—êä5¨¥Uè¯./rŽ¼ƒË#&þ´ØãÜÞ¹Ÿw©½Ø±¾Žl?ëX	ÖjPSK#óÐiElôHm) Ç¡w ¢ÛgA>!ýŝAÿSŸ Kü?Aæ³,ýöÕgúÿ»¥ÿæí¯À=S‰?¦Õ=1‰&>.Œ'&Üm/ñÄôû6ýåñß9áA'qBO'èÈêü“³á'¾2´'ŽïÿçËô)¦“7Ný{õÿn­µ?ÿ9øu3ÜzÿGúÞxT®G#»Ü¤Z­Ö.k—OƒGøsÀü¾l<6®^^¶‚§ÕG_~ûôÛl4®A:þ|@qA\äÕeþè~3¹HÁ’Â&ã~m Ô2ÚåÀ@a0râBNcT޶ʫ›<$zœ¸#½i¼ WÉ…nÓsÖÎ9£{ó’©#&Ý+ì? Û-q×ßé:N²oú£«Nß“ÉQ¼MmïdüdHÎAF±ŒUÝc8ŽÊ<aÐs‹ÖHœtÞµí(æÊôWû9víXVób, 4Ï<ü’«¸¨Aßèq³ï;Fݝ’2Xq΢­ýÁf<¯h!…tHñ©8"ÐhB*ÃδwŸðøüYØ¥¡‹±7l¸«8žaŽPýPÕ“N ßT ¿Ø@ùň{£&L¦;Ä@Ù4 NÚÖè’õ½§¿Ë€éßzdt#*žóùlû3IA çÍìuÇj¿3IÚè«¢&ÓhÓÀ”Ú#Áë3m¨Ì#¼N7B Ù¶f%„ölW”‡§ÕƘ ‡˜wŒ*¾cüé2šGÔ²;U^7h'S¦é£º†1ûˆüzGq›¹QÍ·Çîƒn‘Snå6Ù¥JZe×EfçŒEÖdÅÆ×>9E§ÆuV4¨߶QÕëÕšmHkë :́Èa*Oì,½Ö™ÖIäAP¦Ê‚€"«ñœ°h˜ü¿O^u}¡tŸmâ©UW€äáÁ34n‘bñ°cÓ0R¥m뙡"žÜ&­üŒkâ홦.²(—ã\tŠæñå1¾<ã1	Ïfô´™£\â(ہj¿Yenëó«ïcÚ^Xõ?Ûy˜(á|y™Gy“»£»ãÂü†ÉœÝ¶S KIÎŒª•_†S÷ïžOᶿŽ_´ËÄáTÀäWÊâR#”! Öd-š$»¸Yßdêa“’¬…š¦‘%*üà¾1™#&ÉsšœYRôÿA7WLWCü¨Nµ-ÊmñíøÁ"1(T(,;Mk»sËï„#5Q	–Á›»-Ji5	w#_±Ø™³€³ãÁ¼£PÒjã7wð_=T¦Ë«Ô")”ÃÕ,R(#&SË»¹É¼\½ØÝ° ÝZò%L™vÄ&u•E#&Qù–	Õô‡Â¦?,lúC'Ž¥íÍ’Æ%÷ü µ¸W™^=,éÕC¾WO5<ôü0Wl«U”–	×%K¦„DZ·²-­Õ”’é_P™©^T”hCâÒvŒ·b‘„–ÛRДbú³¨óã4/má“,=ÞØr6eœ2Œé"{á왲¨Ú³´Î)ó}rïdùÉRÖJƒÎCÛø´ìÝ;Šjéê….6GLͳq)ëŽ…:êj©^2T'JΞ UuÚ»² ‡“M’â¨Ò®d>7Ëy´0""?…Ô­&3RtMi÷ºµ@C®Í«›˜¢z`BrO#j„㒝#&<S»-ÊÕH&ò"y…IúÖǝø6i§¬®]04"û¢w$úØ(B™ËÍ䡤rUlXK&·Wfgúü•øRà9ñµJ³¶ú‡~ÈRœì{¯›-e]©?Å(8g†œid”[®cåUšoZ¿ÿûj»}D”7Ñj”n4/Ó(Ö¤#ë*áõ„îó缘Q,îz¶U?ÝvÙÀ—_zÓ­G©¬uÒ&ħœŸ°— wàL3ˆ5R?>|³TQØé›çôÓê s.#*õß÷öé•Ûß«NšH‡—eQeHNù.²-MÈ|Xè袹ùIi¦Šù‹AgˆÂ¾uUJ;æ•<v“ŠGœ$Xy‘˜IZriS4-ž#*¡a²åx›™g«Üs×Ñä2Žßí0Âß®<†Ì3nÕtmÚ9>W+ÆN<#*"6°fƒÚ”Á¬Ê7î,²‹J9$ ‘ÉìÐ*U—# îâÊ´(K”WiT[öóÒ†Í?¬e¯Ø£ñ´Èx€ÐBžDNSͧ ‰q\Z"¶á÷ùí»Æ67Ó`4á¯qœ³ž¹¸M<¾âžðhȵ—ã‚tçr(6_^oê‘ûí»¿vî;½>6E·—£ÙÄ#‰Nàšð³l›ÖŠ &d4¨Yg’€ÐVšhúŠÀ)‹”lAa&{¦4[Å­àR¦9GßBJÎÐË(]ªŽ­û^ýÝm‚–ÊÊÂKLá™2„!ðO‚QY³|:Œh‹£°ù8`$2&%Ì.(ƒ“~P’#¯[“|v®tN”3¡gÑm1¨]›ÔQXR¯ /1>ÏÀ”àÙÛ"{#&⪜ÀJjJ„’Ïü{PSBŠ|æföJ2÷13.ÉÄ<Éú¬4ùÁþ'þtZ@Ë춟“µÿùêùgûÿÿ“ö?­àPv­8Á²þácýcJÛºÑôbeú»–?nº6üáŸÚð‡*Ãi†eøƒ)oøó¡f?ÿ£Ÿ¥&?v€Ï7í‰ÿyËž‹ÇàçÓöÄËízöÿ×Ízöÿ7¬zþƒlzâULzªû9ƒžjAáb{ž‰5Oý_hË“·äù§íxʬxâÏF<ÿ[ö?ÃÑ ùmõ¿·¾Úþ&gÿó|ó³ý÷¿þ÷Ùl8„½lÔÀ·G‘zM€ßÑw´ÂåN]nµ¼­¼˜$×är{Ú›ö“]tØòbÃMSzÜÃíBƒÎð~ÔÎRØüö-=m˜£ü¥@$=ÏÝ´UìE`#*h²ž–ð	ª7‰LÞMâz›ªùüõôìð»£7ï7’i¼qƒÇì†Ô±>ù+:ÛQõ¸,?‡Tê#Ž„ÏÛ1Eï­i‰¥Ä•ãò=rBWà‹òûÏõ©HÆëÛ^½.#&®3h­¥ÞÖ®·ÑMî7†³~ß_ƒz%†¯õŽ‹aùt8©’ÚÍ¢^JõI·áíá¢P	¡7™ñQ¹ÃÍ/A¸Jg¨ýùÉîÅx„‘*òÒi<Ø»ØC'aThã¶GÂb1:*[=‘Õ×ãngJÓ8½ó°Jž7ÕÌLNïê3MêT' ¯þÖ«_{õ©'=ÿ43w¤[Aâj?zÖVjxÑþœ —t—$c¼y­¸I9DF'F_’5ã¾3Ùèn6l\#&HðC€ú[ûäGöo#&õo­¸·£»¶W]U£ÁõÆZ–˜y¶‘˸Ñ`1.a}Ä¡	±Á!V¬2ᙑ5ƒùƒ‡Úl#*qŠ¶BZóði7#ÚRZ-¶³˜Œ²=âÙ)Ø‚‚È`ßYaÒÅЀXvwÿ–ƺÒÕ\ª…BÎØl?ƒ%xè¸wzújï%úÀbÜÐCvÛfir»1%FäFüfÖÁP6°æ´fLÅŽ^êïûvä£öL¯’QùüîY¨Ù3ô·Å…ábw‡óuƒ"ô(‡OÒI\#*íïãyÈÅ–Öô–Š¢=o¹j$ú¹S¥kó0‹ ÞØ^³I/„µœ\¥†	ŸM,¨ß4}yí€~»h,Óþ}ܪ…Z¶—v³u¹(ªK‚amÙÞQX8_\ëU¬¥ÑV5J;ÆÙj©ýÀ­Ÿ¤ùEjç¨ñ“¯’>_Z6ðš¼A=Åp«¹’H‘JY<âÓZ:$lævh«>ê}þ¡$0TÆ¢éMÉ¡`~Ä¢B¥×¨ÅÔ³½ÕÊÇäáüp¥ò,ÚÚù8\ûOqÉ’½†Ã•Ô£Ô,ÚðJ§%$HžP-#&,|oÚS 8ÿ 8 «†z醣#&ð`á`#Ô?Ê:ÅÇÇ­ÔF¿åÙÁ5.6VãžFHmqû!’#*øÙ‡N`MðÈ¿M´ä©ìÜñÉyC›iO7¡5Ó ©s1¡àï0øsiÑbp„B^Ù‘2ùaS*ÊV()Žö(¹¤ÙOµ,¼¼ ±Ì¶ÕUŽ®‡ºA¤»*?jL=®{d²Zs‚ZaVèã‡z@èúõºÇV±T¤÷G)©!‹¥/¼Ú!¨”#*¨-pCô•¶w£bCQ#*U¿ÀBýµŽª”Q-<k~Tô‹Ñf+lªä–Ë}áo_ùm#›wRUëÙ…VaìÏôöUütY*°Taó°ÕÃQF¿^¢GHJð‹XÓXŽ“qý(³Û¼Í=§lžÿ€˜ùk€ÉThi™[¶qzkÖMǺ¯Àû·e‘ˆÂ.‡„ëÒ+ª÷¡~¤BÅ‘\·”%w€Ÿ_D~Õ·5ÚJÔ¼Õà&)#:V1Pó-Öà¢ò­ÕÍ]öÁöN¹Ó§€¶0BŽn4ꋝÿòxûåÞ+£/–Wÿ%LÏ–ˆ8ª‘vÄ Em(éí¬4z«Ìy>hÆ›—Ç'ï=¤m^} z£[½Ñ2uÒ`~d-¥‚íÓDÁß\?;»…ê¥A)q{йéÅQµZ…²çǧg'û„Ê0·—•zµ†7†Ýë^m#/‰+–î•»M)(Gpñ€Ü\FwePä’½°#&͝úó–òx^÷ܤ¥•u§]ϯolœìol\x£ø[¬ËûéyãÙÆÆá+¿¬<üÃÕâeîyÈ€–A&·°ŒáÕ{¿x-”²¯Ðí¸¥÷ÏNŽ<<<=<kkšt‘ð!)IƒÌ”A†‘C }»}òò»÷%‹ÖIér´®;¡YZ™5WæÈzÆ{=8~ú½«mèäŒ\ð©]¤(K‰7>iª­ïËq '+‹9h`=Ì«³$#È5˜¥‘€§7„®~ÿêäå!Ç@ŸÒ¡¢¹ô\izeÜI¯ÕXblxÛuBmhj?od_x0ØÂR’­Ê™Mì;N®-Ê@Æì‰W;¾½‹ÖL‘bÕ‘WñÛ2zÉ¿»év¦˜¸ªò¿e9Ç·†…VX!fýÈÈfâÐP'•—;s%u˜òú1UWò®í>ã;ï;`ýêœ=_|Hô†Sóػů«>‚µŒ_z»G	Þtäm¡í¦×<àbÞVË·]{k9Ò™Ô	A1PF|ä*C.Ôè˜íWò¯¢lû’àÖS’i°ajEŒÛgEÄÁû/jZýÆñ¾ÚÚÌéÿ}µý|ëóûïïYÿo’„Ì.„ÅêeXÞ„ ½/Ö{ÃëQøÉ°üaØv'©„	P×¥@UŒ/Šâ`ž¡qFÃ؈ù<ìLÂw½!ÜpÈ0(xo÷;tSåÛSã	éçªQ\¹iã.BE¦i2ÀàmÈW:qÖó:d@ÑM½NwþÁ0`Hã´×ëÂÇ}gÜ{¶íuÒ‡eyÙôöÞÕm:½«Þ4õ®f××É£o^÷Gïf^܁yK¦•¸3öb¸½ÂV¦Ï^·ïŽÙÐBµ)àEݬxÚôð¥Û¿á/„Y>»êË;ý…“îã´··.4?ž<Œ§X?¡bþÝgÝ?Moï¼ngDµv¯àjvƒÄ’vãPl(Ø€g_ÉG·ÂŸ3ù=ƒrI¿ó #ìuoãqUÓê@·Óǐ¥0Ö –ÂMiëfcE:$'Éػƫm·ß‡/=ïºÿ€¥Iº]õ¸³.Ž6üÃGØ™Íoú3L'ÝÞ>Ø—ÊÍt2MŸm¿óètÿ–b®â‹:w;…#& MêÅ(a< »7É-dö”8†ïƒ­®Ü%“a‚sq—ÞàhÝagæð9K#*Ù¦òAáÒã±üSÂV,¯ÿÀ1 ¼•/ÁÍ`ŠÕ Aïug0ŒƒAì#&FWéÃ>ÇüGùoGøËxv¨Ùƒ4` .´@H*ƒ´ÛI¡ðâ7”9áWåAJ¦k¸&Tø>ž™Ï.|y—Žb@ŽÓLçø¯;¨ÀZá±¥C^xÃñwYê#&§]šTü¼Šûøe 	ogÉäÁu¯b(Œ0üŒÇ˜Ðï’ø’ÐϤƒfšð1›òïîýíßÀ_dLD‘rúõ&}¹Y¨ŒÒñôÎ#"6ñÆÝ[´â÷éñÍXÿ)¾LÃWèçxônH®=^‘cÈJ§õÙ•/³Š|v½·£”.®“NÊ݇/Ðü (‚@ÊáMz°~»Û›ÀøÅÃî„>Òçø1™ÂÇtP™LrƒÃVKãΤ‹È€i†=qŸ¨/ï€?…é€ÚàÚLÕ G9£å—^Ç™ÛB¯ÓÛk>èfzÛG™½ôên6öÒခÇdê祘/Bât’v®¡®û˜–®Lëôv6¼¤ÓIçúº{³a/½K½Ù¤ÿ##*"mÂ<hféxkÓ#b1›Oo¥{ÔÀá¿]ï¾; êQÅPïþú~w•Ðžô¼wÉ>õzïzjPc¤„ø9à_ú2FJŽ_¦“A>ir¼wýn—лAö݈jH·Ûôƒ@Ÿ°œéJLeçô]}ÎaQÁÆ® }×Þ²P²Dô_)V¦Q˜â¯Ÿ£Ÿ»A>ƒ~ÿékøñW¯CÙô!¹m†Í”i;-ªz'nmÉàžÊNT’~÷¬„Aog$à+¥}=Î%ÞçS2`é-V–ÞZ=‹ê·°÷ÝöÁ$ýLï’Á×ϧNJ¯ólÛ¤£igØ›#&¬ÞËUl6¦§ëq(ë…ÞàL|<«';<ÓOû틽³ï1.U0š4á @/_á/↠3—ë¹þ¬Ì9éL{pf¶U{¢L¥?ž¼‚Z¡Ò{ªô>l“[))Ñjî쐈XPY<"qÝG–êª-e³µÚñ/øá'uPà÷¦|oéN†D|ºGÙÍÎ$¾#&kã­p¼ŽŸ‘ oò§j×Ú½“侇UDR•q-÷䉱bÈB‡#*½õ¬iÌ,!sy–­´Ž¹ã#&”Ò7Þ®QÞáu¼ûN0èSåGÈ:â8‚4{5’™«…ø*Úù”W‡ôŠ î†¤Êƒ[xSÀ\zÏ ‹nO	ð~*ÔÑèðÛY^<tÕïv{“Ї{]”§êt¥ƒ¤¼ÁOPR (±ñný®ûÿ’øv䍮¯+(„ëçˆ~}Ÿ	ª{ki…`Ñ°4Z[ϵ5NRÅÖÖä›Ê@kkð ²µ‰ê5E¿w¥øš’“ã4}ø$`ãpg„‚øŸäsߥW¸ŽAKÒQðR£ß5K{¥æŸ'Sbi`Kö&£!ú¤<*õüàÇLÎÒ¬ÚYà„ÌШ”ªâŠªÍƒ/¢úÖNÅŠsïÕwIõ¢…ð)Wx¶9R÷ÁΑÆurk§euºA†ëxÞÖ|Z<&¬­ͯvˆÙ#óŠTóÿìÊUZZH‚‘@ÚÁÑY¤è´jVóO;-%ꌵJñâ:´qÂïBœÏ‹pâ{ݯïé³Áu5Ø…²V']w–„”bÐ@‚_¼@˜ïWü"ÛÆ	Ðjj©KN8PL”ÖEŒµ±ŒnV’ÃfÝvÒö]òPó÷¹ûpÛª±áбß26Ç]d§D,šx?öéiÁgwdð.ÿ]Ü xtzˆ)p[·RD3)¤TÔ® Wˆ#†ã“~ôÆñE´)¾‡1ŽÔ!Qt¤êÓ¡›àþ`ã«š]+L0S]6üÐwÝéõag,ÜoŒåýü™ßqgHQFIŸ51Öl¥[ì#hÃɏ‹)ïîz„ÖÎ	­/Ç,X>ïÒîæò¼”|Gõ¸#&]¯é÷Æ_¹lЇo²FšIãÕ5õû‡ÿÎa•Û/÷ö8zudø介¿í^^þmôîëç϶Qiâòòe/žŒÒÑõÔúŠ¤:8ØpáðÍ:m,©˜—OШÕÚQÖ™t»ÛMæÑfE|ÇlÙ­”êgl Ýú,ªIYýqMôw}Ë(mf&µAŽÎoìd<益ÙË27€Nû&uð;ˆ*òW¼Úÿ„îIç5©¶G cÌïè–ºp@­F²Î6ë/¤ÈÔ‰Zá_õ†|Ö¢çf`(‚Àa‘›-—ñà,¾dcA¡4×j‚ F3‹ÛèãÖóõ6Fõ<)µZÓƒÀVü[hÓª\uÒÔZd¦µÔÏ_—<ë…¬¤C-ìP¸¾O¼óeö½ýCÞ,./qç­°ñÿ©Ö¬Ô€òÊUûì囑~ÕlŒÂd¸±ånñ-?M#l"aÖí.Ü—â$G)¸–Pá 5RÖ>Ë<XU©¾½xR4pRiÂ*ûKø0^g£Ñô '¬…gª0K‚E:æè¡aĽX¡njÙ‹Ævµà#*/ÝùȐÔôÉoQ®?ô{W>!.6½ßœ–„帎X5Vð…+UªEgúT¾èt³›Î Û‹€†œþêÆ ;dLðzãÛ¬ù?íÎÇ“$E÷—É|LŸzé¬Ó?ŸÎº½ysk}âcºŒ‚ }Ãö-Ú°zƒ}ZnÁª¹|/Ú§ÙâÝÿaLÂ#*»?Ë'| £`7Û´ðƒy…õ*Sµ\^þtÎVkÆ:œNFÝYlhKqÉœó.IÖîIÝ- at j“eG9“fÆ¥MìõNUw¼ûˆÙàPÁþ!µ¼€øiŸ$¬Ò¿"ª¤‹#…Á^a¸œI¶·ÂövT‘°Ã=¦$Ó-hÈ>¡üZC!|Þ§(Ñy¶Í'ÝÀ%tS7Ý´ ÓÞ¬æ?‘†GͲ¢ÄçÁH˜î¯kèÖº;<¦Z˜*®VÍY^É÷ËkîLûƒkr>£@[¦è8×_ÂÕFgyE.¼U›^©šæëEj}SkEÆ ”6jŽ³€ƒä}³î&2Ôu™#i9‹Nkœåƒ@&d9YûS8d \}#®Î³ç,CW«È°é区Á®´9ÊYõÂ.˜¡sìtOÎ2«å´t爫és¶Ë¼¯åã_L	t¿W¿¥˜!ÉßS°YÖsØòƒÕºÈà[ÎGJ=Zêñ/{èùòR	á±¿¾þÛH:J«þnØwÉÍßy÷s91k­ÆæøÈ±âR&Ǫ €Çù © ¹2‘XE€A﹫Ä¢&ü3”azÐùe4Q/Í͝mœá<E¡> I!ð¬Ð#ÓãTk˜g#ÇŠ¤õübïøøð@¿òb£Tˆ@ÊQ(šžàŠe fç/hNDq´d}10[üãSb[Ÿ¯¬gŸtõ8XïÐjìp×d½óÈÙQêûÕ,a¡µÿúì#&›0²§5„­^N«z÷Å£`ï4*™>=¥:ŽãNùQ†¡È6˜!zré¥ä̹‹{¨YAGMäÀÖÒF¿ã¯)x?ó["O‘·²Í¢!GÀ<Dôס§)AÎ:×7„~‡Iôû*ð¤M!’y/ÂZé\ËöïOI·ÀÖr¤\Él3Û§QÑÓARPó9[ûcwÊ0\SÁ´lGæzà0šT#FKâ~Úˆ¡G<°^²å*`ÿU	|›•Pš&h†3õ/ðëXQ_µ„šîfYîñämÑjõ¨ßmëÀˆ¦Í#Œ½¨Úkô*Ù«‘ÌL~B‡¹IËtŽåPµJÚüEäû8¸‹*0,¬ÅÍv«R^å50£ÌÀY`ü¸Çúë\½FÊ˯ÓJé–ýŒc\|ñKa§tÌfå*ô<€¶ÒòÍ¢´|°6+Nƒ›‚‰fuÀ/^8@~ú¦‹{NÕ×2þŸ.žŸé6–ÁEþÀ·Jñ&ÃQçL£ÏïÄSéJÀ•t	^÷Xª`D_Ð¦Pr¢zÌWè£çÎâå¼ìrÉ´¬ ",Ùg§)y­õâfÞ?MB0n]›ª…®¦83DICEhõo7×ÎBí¬hxÒ€>Lë.H&ŸJ´»@æ§Ó>è®éY%G‰uPv»×bö¢RPžµ®Ìѱ#*ÝÁŠ"8ÏÓ¸þ%T'ìа¬dÅÒï*ÞNC^=z_šÈHìX¨ ƒkèVy½J¸Õ5³×D0º‰,Qïb9Áà†!Lˆì“a$ò,J”ÃiÊz¢í#*°óN…Š.ÍÆc¦KPˆj¥ì¬³g€Çº8ÚGýþº­E²¥¡µãœ}VíŒX”®BdÕ*tWS!2a±23´` #kH±¥ÃQ»3›ŽŠA8fÚ“šÓsvã˜wÐ1ˆ)B'7¢Âpzú“W!’‹-ªÙ‘!ÆðJ+1ìÄ0P¤Ñ^‰çsçgÜFã@„<ó‹¼ü›ŸX#¹*ÈwÂŽ“‘Sþ M§<¨(A]”c‹)zSTÒL²ãC@’B`¢€dAG©ÄÈ+Gö—arÓ°P…‰ïKÚ#&o$÷Fö.li1E>,_S§½9Âð+œ|e¥}ëÛNŠ4Xò8CF	µ\MËÜ	œË:x *(â`¼Ä{yFG‡Ïc§9ÞhØðލ&w©„,™Hük¼Î>ÛöNÉëÝÃfgê#&Â{H¦Ùè)¿*>zj—Ѷ€Ù»FÛÖš5Õ$GD¢u#&ÛBë»ÑŸ0ìŒHÊE€_g yñAnm‰¶œŽê}ßØóf“è[…Ød¾ùÖ%øv´’$4	ªenúóùÎ*Šxd1E-•<š#&C¹„EÖØPÍU«¨Ïç¬KÈêÚv‹#*tý?ûæè#&ÌÙ’WŸe]¾á¨?ºÁ7׍¿ø-eãŒÍQê}¹ø?¨ÉF2WýlîœÄ½.zfºî%]Ÿµoï` q«µi´¥9˜¾#²` íU·lÐ`tï{gu‡ä>Z„öj5œƒ)à|yA8s‹Ñ#*#1½¼X>Ç"\y¹÷êè»Ãó‹(‡A´º(þšlSä†d‹7ö÷yEG0±ü»þ18‘¿òÖãò¯~´æ…‚OéTéûØSýÙFñ¨3¡î\Dƒ)!»š#&þÖô7^Ÿ|‚»&灁­,ý /:ûÛÑ«3ª#&?kþ™¸}1+N+D7Dÿ—•wº."‘ìöR´èï*yü}cǼ‰„­O»ÐÝæ¢lLz°Yƒ7bS‡dƒ*ÃD±^³Dá1χ³ò¬ #û·g¾Ù¿-Ø?8üîèÕáyûCdùÀ‘sΛ7¥Yª¡…¡‡£ª•)”Ë‚õ £¤[£>—øæM(áΤ’=?ÛogÂiAÊÅ÷”]Æw̍ïF¦y9pH*‡—ØW2 Gj öÎtªñ¹ð捝âoœ¼¾Øñ	&èÕùÉñ!×zþúÛó¿Ÿ_¾ÜÑÉ.ô+`ÊÊ«TöôäüèMT]H˜žƒ“¿gaur!ôþa	ü~®%ûgí—¯/Ž.~8;Ü;8<à’@󖶎øÀ «õXŒ·mã-Õ˜<ôùçÒÖ|û½jzw¥¶[%º+µJàۇ߾þ¶roŠËº]Û·¨Àž›Šá^ý·šž´›Û8xÅØ\гÃãýóÃ倒F`drsv±¿…Ÿÿ}”„îœí­ þæÝ‡S2ãù!3Ù+uFÁ.\½}«ö‡þ5õ¡1"åqbù	õ‘Ÿ;Š™›:–›½‡ŽIÉm5G/²½r]S|?%ÜË£—9Âè#&\ìöøÙãk ²£fC¥·È…ÙkØÍ°W†““éÙœ#&#qqxöJ†½Ûïó˜ ©\®Ö£—§fÈ7ø—N–/ä«VÕêlyfÚ„3ÌTŸÌÎtæaŠé™!áã¾îm41îI`€føFj\y’ήX¹þuºÏΦ°•Ä#*Ȫœ¿a2P计ù±î½¯ªÄñFŠò(_8 at h­µ¦,1“»îi¨«áƹ­×]ÿ‹xÙƒqXÔ%ò¼¶ßÒº9ì¡=º¶ß‚0ˆ8jºÃ’dœâ©vܽ2?uK,ߎnlz W#*‡Ý+2Îh’麐­èàä9´ê=ZÊZ +ø.›R¬•÷\,ÚfŽ®~‘ •%kø0v$®–¡½â¦–¬vLoÓÆ$Œîu4L…ßÒSa]õHÏLµ–ùggž“ý°Ù#*¬¤Èµ•¬•‹ª/Yg¬ÐÈZv…î$ã1Ý×à¶ÆÝ´XDjÎQdB=>Øy.íÖ±ËZXuy&OàYRJ&ˆù7`è‡C­#&ºµžÿC#&G®èÃi­Çò{*+¬|P]Ù|dR€êûîõñ1€¯,JÝQAÛxÝ4	©–m—øçáåÞُ(’ÌuÌB¸°kª[¹a)~)av•ºÏ/"ê¶4Lç9ç´8“m/¦?¤Û2d Ýw&ÉpšsË«óÅí¯j§¯€—’"UGdwd„}(頁 °ƒk=îž €W?³Ç²"(ÝzÝT‘¬*è5¡‚#cG[äXÑY&yºqNÕ è£ÁòtŒ¯aö5ÐI›[ƒÅöo#*³.àÖ¬5Óø]‹`Q2¡FM8uläÇÂ6èÍ8Z¶Ï6.²å‹3&>h¥2Û~Æõ@2¸Jºdým¯¥¦„(p·ÖÔÓÕ#*œ÷G „g#*VëªÊêB8µÏ£ûògŒ¤W“…bÿƒ@õ#&þ´,Õ\˜v “§¤C¥²$[Ï^–óéâÓ2²NK4OéŒÆIí–iH!™@*°'qg2y • J¸DzG+Ü$ÃZ'ˆ¢gôò×qìÙ7¾ó,o óFüŽŽká÷Ž03RC'«‘a…÷ ˆõN`Ãs‹îÔ ´cò^.6£Ã'½ß½kúEÎd/ò:î¤(/Þ8P`G¿ôNØF‹fã(Û.rh“õ^<­à¨ßÁ¨ûqŒ2~ô4oåΣç<ü¢ßÜáûÛùÜ·‚jÏÑøçÛNš4ÈÓy’’vН¨«ÐG+ˆ31v¢Ü‚«TPXËYKr† ›å(½¹Y¶Ú`P\J/Ñý“ܼŠdØOá’ä>ëfíÒ讯æ¼åZé…‰úIÎJË	Y3áÖqµwQs#³<‘R4`˜ý%PŠv‡Š ‡öE•uXî\S®„].vCÍæºzAËT	MZ‰ùì(õÿ†ÿ×î ûÉÝ¿.‹ÿ¾½õl3ëÿus{û³ÿ×ߥÿ×ô!u=½v&KÜ®	X]®JŽó’Úô»äÛ©ßÅpêô€~`4Mrª¤—dÑö6”+{D;0‚¼z·®5NGio.‚½GÜ'im–2Ú¥'	:\Gƒ„:²•ýhÜCv®1vW4¦°)Ù®ëy«ŽR}t­`-Ñp]?nð’Ôsè—Qב¾¾ú1W‡óÜ…¨aQ’Òúq½¯+p…Ґu¬³Š„øõUuV˜\¿Áþ°ÜÍɈ“à\mbføå3w}z´ŸÉÎ`8®S,õÚsð>Ðœ¡|;ÙèöÔèþpp¦¦ãlÖײŠÔÎôÊ#*žÃ;¿(¹kR³‹JGЦHò~,¼¥zN7³Î>Éh[»ì–,7OPÉ°SPŸÅMeá˲¨Ôç“õßòü¿ê¥£áoÿ{sëùW_åãöÿþû<ÿñv[萝d3x˜Uha¹oÎO^aÀúb‡²ÐnH ¼4¾÷b"ü~H¡ÿýÙáá+#Tµ{Pkã!öðߧ¡—:¿ix«oÜz¾’dQN&º}Õ»i:– ¸s‡UoáxëúŽa–é#&ž£™˜’$³@|øû*<˜ª ó~4í\5ඈXªV!D—»½¥bJ¬³B=WŠžWÐK¦DEøL%Ì^ü®)	)Æšr 3«¬Óïc¶®xÄ¢ÜÂ`>¼ª#*ð¤nbijü%KmˆhOMm¥¢W.° #&´ÝÂ)ÿ~+¨éµñy¨eè?j·¡ÿÆOz,¦ÿϾù#*ò2ôÿ›¯>Óÿß'ýÇÀiˆa@(þ‡JÇ(!E-é^XÛƒ#zHÒtÒ‰“«N|'Q!Oyù±a k'H½ñÉøôäô;`kaïú•	:º'+ÿ~oЛF[››•›QN–Q6M¢Í#*JÞ»IWG—E5ì°òÁÒªdT÷£¨JªûÕz¶Í–nUf)P½IˆÏø6…*XrFÎ>U²Gf&p靤S¿‚OÛog#`–¡À#&F‰št†iô«ê;þèø|Ø…o_~飙üT~qz;y‹?"ø5šÀ·ÇGâ”Ê 2§äŸù§ÿŒé¨HÛ‡ÿã‡ïaäÚì$ÙqiÑô.§­§µ?<®íò½w#&´ø±w=äG<eñíé6ü•‘yä}ä@f3O:7ƒŽÂÔx\NžþÑ¡Ê£ï_œîï>Â/RˆƒËØa€ítb»UÕŸ›ú?öêÿÝn]¾{Z%ëYƇ‘/›õÿj·ž6k-à¹!íÑ0NÜr—éSL„L³¨Ø°ï@_âÿ&O/‡ë6:mØIµZ­m\>mþü´õôòéz­ùóÆÓ–ú<Ý76š?_[OkÕÚåeã±ùsõò²<­>úòÛ§ßþc#*WñÇÓ ÐfêÆ%׆ÁF¿úù‹¿Þ	¯zB#*ÉBõ½q­Õ7¾ðkÁ‹](ìÿá.n¶~}î‡â[X!iqÓßÙ„Åæï|KËßùSèÃÂü¯Ðú;[q#&[¡Û°vgëYˆ>,vþk;¬ú՝gÿõ¾òêõËȇKòÉiäŸø•£ƒÃW‘áWÎ/Î"?õ+û?ìÁ—دLGÌËÁ~‚B!䇞œ¶à8«LÆÍæüM«ö—Ó·É|¦÷z¯þLok=ÀÄ·³Nk·9{Ý?†áy<~ú“y™ìÊ0B+[Ázà?bÆpk÷²»4Â	umî6×ë­§ÁdL"kH¼þŽQR©m(õô²A0VÙ-«lð]z+Sú9Ö‰¥Ÿ:¥·‹Ko»¥Gñtwó)5m¸¹«Z‰ýÞÖý¦eáÿ¥ZãUô=‡•ëÔ·7þ^ÛYÛy|ñ"zÜݍ¡Mðøùøbíñ¤cò#f¬_®ÃŸè±^¬ï>Ö!åiô¸ax\ƒ¿»Qôø嗏_Büþƒ/?G;»_DøÃcó²v\þzùþ²yÙz±{ù ûùòéåú—ÑÎøs¸¶qY‡Äÿ¹l´ü°E;¨ŸÌ“‰³áå±YÅ.¯¥»kiP]«‰5Çd¨ ¶ôK-w½¸B½’‚V@Û&¨tbTEJº,õJïf8šàwX´D±€tÁ¯ì»p¤]ZµÈ‹¢¥`m€gP#&7“Ñl\Û}:ešEïûü¤è{¾#&ùÌ‚´¡ŒÝY*BÒþcfŽèt>­á뵊)‰ž®Å>:j¸6™„Û9”D	®†´ Ýg‰Ø!øGž-;ïU ø‰æ±ñ,Z4t+(åàP¨<n}³¦:º„¦Ï4;œzdÙ{øΤFѪ Ç£Cõяæ§Þ†·gÕºW‡¿/^x»»ø齈¼]ø¾G‘÷žf_zžq_Â<C8É•wo‚W—¾™Z2`Ni?šsѱš‘¤ZO¸O°1ÍY+šË¤wg1ŒÈlÖÐvt+Ä¿Ûôw4V~n;Ñæ:åj=·Xr¬æÖ‰zÃ)—s”+Þ.€¾ÒÐÛZ4âzhz»Qä¯ù;qÔY»bÕJZ§¤u;©NIu;é)%=µ“6(iÃNú™’~¶“)éÑI¢4lg#S^VÞ—þ¥#&þå—xÔOÌ(rr¾09_¸9/L΋LŽÉpÒwuú®›n0íº˜~Ö?»5P/ìîþÎîî•ÜÀctz¥ÌIµû XDäÇø‚_;ìÃáz«É`<}ðPK„ÂHat…Y‡÷úî!å/ôìE'§¢frm©ùâÖj6D“ˆ}xòûáê½À]ÑW*(Ξv΢Ñ>ј_û¸TÈëŒVügê*ŏ¿ãVTÜ’XM´­¢ž|1ê)EÃ3!#&7H;i!xk“ꚸ=zRƒ#*Û9üZC#ÞÜÚéqhq ‚0Ôßõ­–>qÏ»ÉòzaÍZ3YgHA€ªÚlâ×·üËÀŽBi´ÆùÅÊ8qi’üœ#&‚<®ÿ±{Rûhàd„‹X¹c=8Ia¨×&ÎB”Ѧº`¥ ÿf)µÝ‡Ò^@Œ­÷fƒp;5cAÔÞRSýq›Kãî*øÀÁWq–é%/Ý‘@ÿDi݃B;™eØtWÐV^#*檵Ú]пdIÂæoAVÙîH+©­@Iþy"*y²vlÿ$ÅDê§ Ì¢!h·K÷¯»˜8²)Î5a¸#*ëlÖðº„Ak]uhàÛzòtm¡ç«h|`o—#&±@÷ۭ݈¿µ>eSÍhBƳÒq¢ÜlmÛ!•¹ß^R_ÒÕïgºþ¢‘PÑZ¨.3û‡nCÔî°i„¦:Æ5•4€Ó‘t¬÷D•%mO#*¿œq¦#&Ùs[!µZ/KªãNŠBv$‚imºN·I¶e|L·`Þq{ƒ5Ý–_ÄÎnÁ¡ÄFÔ!kÉ	èpC')KYnqȵ«âÍyýRËñV	Q÷¹^wÄ:ߝ»DǦ¢Ž"Gôã‡{k†w¿·š[­u¨|«åÌ‘ŒŒÆWOëÎ0š‰çqAêÒ¹•³Î*jÐ¥ª\«l4”ô=C‘ˆäÈ&Mh–pn[' ÏmÕw­Ý}s‘ˆÐVw5;Óò>‡ÈeށXÔÖmlaÛr0Ÿ®eoÅç:.’!€ñ-BäðÜ?§e®Z5&¡B´Ì\|£dŽÒå)Š'#ˆ++ú]±:?ä“M’ɱë}òD:¯¹ÕÊ×krµîìÈê[éÜ\K¿v¶‡jØ€6™Lk½óà¢*ã?ò:“íb>S¶p7rWfá<hú«†ƒiãæ«Ý §2šÞí#*ªkBÛË–62H:îá›Y|+צñgú ”#&€Î@õQóɐù—ÎÅ:#*¬rk×؈#&»A;Áa^L“Œ¿tíáÞ¤áp¶f‰,M¶œIýø©Rƒ‚”…+tp!!5øÊy^ÊÇUx=RG4‘ëª7$7#.X6<6첑´ù˜ZŠ÷\L~üA§<°i÷ŠÉf'Žgªk0í)º‰ìýMY¿8«ï—ÖNÞq	­ìá_#*Wµþ6ÓûËú–ŒNXÁ°¾Õrn'g«…¾©U‹sûÑ]á”6u^Ó-ÖÒÁ °ïz.Po8DcÖ?ùÅžkö™‰/ê¹Óu,Ly™10}ÙŠ¦YßjYËþŸž®í.µBQ¨öD9îàHÁUfK”«yÜÜ0.È"T:‹´& Ýþi¯½wöýy»mHÉ“ûN›†¥iz+Έ½L{Æœ‰£hõYGƒ;žÖÓéºu«Q™ù,5'§(Öu£ˆÌŽ‚Æ5€Ú#ìnYµÖÆpsxäVæ<œm+k{æ®W=#&nµûœh3Žøxú"ÚeŠ#*aÒz$ý¨.ˆëLOé§Ø›µí혢ýwÄ–öþksá¬ÙðuÍt•.`»µåÕÝs+Õñ\´*ê[!ýWÈyÑx3ßELY¢žyH¼^t°.,œ¿yP–k¯^"…ô€ãÞxršŽ¨–Ygš1oöö©eÊôF|G)Ú\îtN¬Ð4"ÌDÂçSe5‡¯æ4AGþ#*ðÉ8$ß~":€Šáë–º‘a!7‡b=69¾MÒ^J›X¸46±«è¸O)j.¾°Üãáž	i¥x\n¾c´aÄ2Å'#*5òò\Ÿ¤r0µËغ6™óÈfÍ·µä#*3ê`édíYPù†n´ÕÊ\•šƒ#ÐûO×22DŽ¼Ñhh	O®iºþÉxBÕ‹n$¸FN|ℬmÉØ}Tß¼Úv~è­&¬Ôƒb‘LÑšu¤"JD‹OÐM»P¤‚-K#“w´l2)s6›­d^-Ò Ešœ~Jí>~wvOƒÝGz¿ÂïU†^Q )[;TDjÄöÖgÛt‘S«[¿ãêeú…ÚÉÀ+Xµ É#*òSv>41L}[kb©ø­âu O€§hÌOÅé>£ûÆŒ$1Q´%ÝÞŒ˜#`s-	:vBånYÏV!â›^øÌNAR]ñR»Ž(>Ã:7ú˜ #óÂù¾ë—‰"K;֐ž±@òڨߢˆ¸³yñaƒáoc&V‚¹ã#&gpD$U/(Ý„[<ªô˜·šÑ¤+SG²Å¯1t|®ìÛi¨&Šž3»	pϐïæÁhÜ&ónï¦7Mw¬¶wZáÖ×få3hOÇ1îF=ÑKõ›4¦îíãVÁ8ðxn‡[Jb¤€w{º[;[ë½–[Þ¡ª&1`ø'[ÏŸóÕ;/«Q5ã–‰W¤}>®2×8^$:}Ï_K}kÆõf¾ƒr†4bQŸ1zìM{ïPå„[ëÉpL¦hPufgõA‚sJ'ÌH«1ÂqñgBa³ÉG€uµWŽ—¢¨:Ì’ªfSï5÷ú„p‘@Ùºñ[¯Qqß.¹YX’ÊqãENÍmÔüQŒÎ<îYßfÕâ‡!V¬ÎU?e¥ZPÃM’oyV–²p^}[´%¬|Ø;#Û&gøí¹d;’}„[Ûñ¡˜ÿ?ó¤†Z^œ#YEü°‰÷°²ÕuV–f½Ù‡q`»Ž²½%°¶nܦ®Lj±9ŠÞ›¶ÛÆ–‚Ý4‘÷|ûòãïUQ›Âx#*Œí3EœÁÀ¡Ál¤h“N~)¤¨öUƒFø	#Vö*Ž#&1 ‰üiÑ*âÄÙ9Zl9ú›ï,¦;úPI7?µá9PËÂMÎk|í#&î-Žz1!ì0²Ú£!´ÕÀ\,*‡völ؍ŠÛÇM()¶öíG÷KÑMŽóàŠåÚ†Ê©d#*«1õéˆÖˆ©…hctçܱ¡ZåRešõç;x¤5£Ø·*€›3­7SJV6ýæñ×0Ž=PÉòpÌfø6DÃ#*í ®”®¬l¯lÙ%ȶò*ceìfÝÏ#&㌇T8é#*ÿ?ŽymñéÄ·¸hĐX}ìx¨YˆSr¦¼6ñCÕ‡ÀŠÞצÑ8nª¬¢#¯bb´¹³Æ0¬›ŸvÔ@S	)Dê0¾¢)–˜pø¬Þja¤ë±ÝfH7ŽN¬p†o/RüçÔn¡ ;¤˜µ#&Ð(¢qŸL®Fi²+¯	£ÆéÁ	XK½ë êºq|Äb¢ÁnY ”)ñ‹sg256T~ܳ“œâ›·TRƒ]¸–l¹E[/´Ýˆ©­§i'Ù°?¹ïLzá”¶üPί®úbòÕnÓ)Ñn£ñ—5³Ùe¡·wYÊÀíMƒ¼šM+æ£ˇÁ*(ݝ¯ü™)—s‡ß³ËëìRmÖ|>Süph©R¦PË]F,Ø0I„³v¤#+$Ad²H&¸©(‚D‘¬d‹bå)Ž%†ÝæÙN`°"«v+n¢^™a¢¹={qê×dw!O­T^¦^#&VÆ¢p@A"a; F2ç6×Y§N»h¹‡Ë­#µId·B´©’Âvô°J¯Žè°çßÂN€Ö2±&M_ôДuØôÉà£T’É}QËÁÁÑúâú½šP ïEv1¾UBM–¹ÜJUH¡òäJ¹–¢¢‚®ÏIîÞlXkÝÍ°o.V0NƵ¾¢F–0Sß*hØCÍG©µˆ^¶3	 •Ú¼“˜,iNvxÙa^ÄV=J¡—!2ÒtS"„Í@uŠžúÿ¹ú‡Ÿ²¦–lýVÓ܈XUkTÙHù=   ÊJpÌ¢µ'rõ”Û<㎞tgÖ¥ª¸öÆ9ŒõU/¿µ”ìX"Ü[ð?Ü➏M±í.Ñò«ÚI±míf‘#ÅÒJÅî–é«UÚ»öÌÐê±4:Cö†–ûYEd¢4=[eɝ[>§´aµóƒš¸¼>9z–/bQªÃûYÊj#*æW´ohb‘Zª°?¶ÇaR‡Á柖KH3ª=}®´#&“Ü”Ï>ÁötÛ#*G7AÊ îž¦D®f6ÔÓèšÚmP"‡Àª¨h+ÙW2£•·(f4³®Á¬—v3™õî"}ƒÖفd±ƒG]ÞhÁq.Ý~BùN±ÓD„¼Üž“ÿAF™cØÝõÿTÓ$$nb˜dÏc›PO§–iüúžtDµÀÜý,µ(:3®Î]'^.èµ6oOÖådj$Ågˆ%#&±/ÆØoëÖms”ãw«x¶¥×s‘	¨(ÁZ¨àÊ2ëik¹H!/S(*X=[ÐX–‡)dªR®D¶ð$3…•|‚z¢í)³òoäÿ!#&ãùü; Zæÿïù79ÿ_oöÿðûôÿ0JÃÑxJÇ–ëð„n’i¨ý ªì8Ʊû?é|^õ2¶BúId¾H¼×QúÊãúÅ‹ÃúÅÂu.¯¯û&˜_à°âãá¾Y_÷ÞuRCTȇ[\Û/tø„²@}q¼Ž.ëПšß#*Ä„'WÝÚ$Sãá.·PPœñ»‘üÐñlÊáÓÔ°Fq¬m‰‹kDÁ–Ñ0W«Å1[¸K<b ’¢Ð]âÝPE«ãÈ3m^Î/k5˜@^ùšm‡M§^ËåaßDÙqý–Eð1%Š‚÷˜r¹ÐlušíüÇX%ÿ­Öo=üÐùN° ùV¢Bg[dƒ°3âñiü²p<õÑÃ%Ì́ñŸXè=ñû²È<'-°£Û¸4ÐNÇ·Ãó*‚Á_€ä/@m²+3”׉˸2îS©“²èþ3ÜAeÎÿ›8þÍýÿ~õìÙ³ÏþÿÎË°>ÌõñÏΟ>úè‡hܧÈMÿ†²k'ÁûûEßÊ^núäoÇÚÕ½3ŽCÀu§Ã¶PÅN:ŒtMŒWŒå¹_àþ¶<<_ýDå\#óãŽÎ}ûäÜW0uEÇæþÿî©yf§âÉ8¡°W¹ ¦«œ©åç)f¯p¦˜}®šxF6؇¼ûY‡Å+¼ŽÓâ=}íÞ¬r»±ÿ^îíûúՁC­_/ÚÇ—º~%2¤pîfã̺Ï`°œ5:1ãËÔ“Jô ¹ºîa@ôÞV¶çûˆ°‚<  †Ä‰-HƒŠÁiê\’—\è]eŒä›ûðü¢½úZ®"&/òçúšd”Å‹C/ŠL0GWÆ=|szrÆ1äö&CTï¯cº¼"ùAæ¨ôz”Ë& 7þ¹DfŒ;³¬‰›¤~ÕI“¢fv;»™…)Üt(C…õÕë÷¦ꘀŒ-Êä÷X'yÁ•…Ñ7nÒ!Y²O[…«œHP¿‚#&ÓéÍ—m—jq5™öW K¡†¿É||=ë«rùŽäÚ¦¼2êÒ¥‘ñèJ{è䜢ÅñEz6”™I€‰H#&’ ³RÑ2ºé®:ý´P ßð×¥>	O™-Œ4—(K¡Cxäs;n.nBg¢çø;#?TÚw|l]wìT}ëщÓÍNÎ\…nbÛÝ{¶=™,—”e2)Ëå[–+¶,KÂgôsÿ{;}þ[ßÿ¶¿ùêù7¹ûßÖgùïïìþÇKºÇÍýFÚ™«[úñ‡L qÛAmâ™ÛâÎÍ8µ¢Ôí(S	*Ñ#9WÁÝ"kWäZÁRìÉÂû©\@ãùÜö_ÿ}2ñ“/«áÙl8L&úû#*ùŒ»È×=:=¿$g+$¡ñ€Ÿó}Ì^Õ%ýGLUÞÓÊË“ýöpd6nÑëøíxLó9}ÜÂYyøæ¢}×M y;‰%áõþžõäç_/žãï˜KÓ]Þã2Š¬±ýv>g‡í:PyV§ØbPZ…¹ƒBV ;¿U¤×m…A|¢±5ŠatœàQÜî©ŒªÖ$;Ž;C'ô‰ójÉ=Ý€T,«NóV‡ò¼±è¹’žò$4±;¯‚sÈìSP[˜PSY…e^ÛÔË~Ù£NL`õ ;ŠZnÓYjú£ôxU¯wÔ³èTëñ@Ù6­ç5s#*û&…,eÇÚÉ{ç?¶÷€cÔŠiïfÈqÞ,ïpž™ŒÂ–Ù*¹Ÿ²1È<`Oqy¥Nƒ,XQ­¶ õh™X·zøIi4IVP'uGbmänÒ·"F’–h°Å´ŽÇjûð‹íèW¡ê«­Ó­Ú5ŒÛø¾=hL:ï虸IˆºÝëÖv6³„+.ꔪƒ p2é![Rm¥ûn~wd^ý©¤êjV%¹3õ:ÞèÝ0­æ•NU!µ¡ø­/dÛQ·¹SÞRK#&wê=ZÆ¢9kBGôjoG?(}\¡„ˆÑ…†[¢‰.Ô»1*¶o“NXBà„záÐ"µÚB<!b‚hdußr4e¬"£‡@ýYO”»A°ÊÚ§ÐD×&‘U¢rýÜ£}ªÇ#&ÝléZê½»í¡±WêupžH塺†þĺ¬ð>à¶s³Üè4ãz¥‘1-µbr×èuC—Z-ñ ˜àÈ°&¹Â	[¥8ðiÓÇŠ[z{„CàË;ýˆ5Ó(‚tš Ê#*Ö_»ÕQ¦M–h®#&Lž^*¼³ôO'#;“ï~4@óþÍѺ8ÓÑ´ÓÃfµíÕBVà+îäHmQìqÇšî–Ù2aM©÷ðþS»–ôøº#&±ìQ6x%'ÜÇŽnþ™ÅÁ«"ƒWÍžhÏ,š¹•§®dîJ'Ï=Ù"–ãH @•#2R-Ô/DÍÖvÓP‰øF}#*Ø–ÈSa«80PGksѸà)¡#<ÛáÖU$¡ª'. %ŒNŸ±FªtÓÿëEûøõ霨¾ØÎ52ž®±>ŠæùÊQ`Ѝªk¬7?MIE³&ՐF™Šàó„)Ó˜,Mjþ·Ç¯ý0Ðt¾›	Œ™Î7/…}¯¹Ü|¡Á ±³ºš][†sæÖ¶.‡lÂ/&/¨ÁŠ'Aª˜/¶vô± oX…•Lç‡ÝŽÅ¥“η£\^eà€¦–›˜Åi”´Bn§â-Òæ„Y!¾_EÖ]‹„7³‰ºYÃ(p܆î˜×L	Ò_‹Ð…Gv«çlÕBú¨]÷¨0lQJ<W‘Ò#òïQ!±V­iNC³ÃnD¼¿{Ï•	EwÇÑÏv5Oë2ö%êx4C»j3êZùMbš€Ü1#*àt½B¼1‘‘‚@X¼y‘š(£Á9K€é~ÆpòážÛ#²ec@Òéí¶*'¨sI°;9ëuRK5ë=çJѨ¨)–VŠ=M଀]>I¬Pﳞm¯iž8Ág­@;:õµº˜NŸ·åR]CÄX.ªð»Ø¬Ø¾~f#*,¹„ʝÝìb¨[žðjÒ‡ñw‡Š­µ ™K½&»1ç1ßGç?Á:ñ·|:pm¨@ïí\°z.¨Í¡…Ú»0œè«òO4ÏÏQ„4ûß×w9ÕHÝöÀ¾X>,û$îh¼R*É€<ÊL²Þýu¿1M…“,X9ÓtûíÀûaß]ƐÈ,*:[Rç³ZSʧ*ŠS7Ç=3Àš‚ª×8ªåÌ¿ñC	ógÕÀîÕ73'ÿþ *̝êšé	ÙÿðLš„¼nœ>ضl‹K©D5p£òë÷‹µ&`°Kø’·ƒm$8-çúdjsuÊõòÔaÉ–ìcÕˆu8‚¬™uQL»‹#*Iinv•Åã]ÛbSÔô޹К½tñê&Ï€¢Ízt”üá%áš)%‰\¹2t¯ó£«_p%sÏåG¥ÄHUÁúíµ.Ðï5>ÿºóÊ“rûÏ :²ô_P-9\ú¯‰¿2²äbó¤ÄÚTÝ>ñ-6ñšY)úïpã_7ÞMzÀãú/¾88Ù¿øûé¡w¶¿¿ûþx*–uu«±Yݽ¾x«(ü Â°=îŠXU…Ô{U‘ƒxGk#&ux˜wà&’Àó_lPY©É¤Úx±e ź\G­\ÕèöúünXB¹T¯$	cªÒÎ/Þs Ó÷h›Òa$Jâ–ᆄam 3K±åF!Åp§WÂ>p•ÐÔ÷^¬tÈTŠš Š†ÉgûÜN5Ûô"ßA2%öY€UyµTsM#1l„p\ˆCàF¾>Ú×Cñáµ:Õ\é„Q‹*â·~fÆ¿þv°¸V!‘n]4åz®Û(—ç—[#&Î×#*é…ØÝLÅõP)Fé‡ýL<€zFCzóÊgV”9¿*OÞN»½‰>Þ åYDr,̾ê#&³Ù¤³û½«4›i0K“ë	¬¥w£É†ÆZÈŒÒ¹†ðCQ‰SOÄÆP…äCSé·Ñ¨§æb6wÅV¾çwö¿^<oŸœ\H“¤O£”%ºXQQŒtH›zYEœ#&œjPŽHUˆa™T&cRs‚ôFzøJob¾ãùø.(œ³eøþ(îô7.&£~fú–KÈápr^.FTÊK(2Féh2›~ü9IžŠh_±¸ÂµtÃ_3áVÈL¿© ^T:Ú~é¡zÐ.Üë›ôO¤#&owd½þï¢uâ±ø»þÂb[úZ Á	åC¢é8Ž‘²z¤%…%vOêPÉYH4	8ôëogɃöøéðìüè®0ÙälÍvvàšCèù°Ä±d*KÕ)ó±ä#&‚¤Ê#*ò¾‘È®0îÇ’š(	zD¥;Rë°!›UÝϨöØÆDG’ljäÂ|w1:©}¹÷㡪÷íTûZiøŽ^_ì·8Ü;€‘t†‘à¡9=;üî荅eÖ$ì;E¾>Ù·ð¥•&HÝv¬½*4ðƒ*9>ú¶°’’%$Uí4Tä#*,»Ï+ŽéÇJ &°Þµ-òEïù­r]´Q”w~m€7 mEè–Ëzf ó«ú×é>NÞ_§ßÏzð÷u´<àÛ«dŠ”¾ 	øþ¾œ¿íãßûø{‘¤Søx3À¤¿%W?öðç³óÙ_¬«*dž@bçðÚ1x##*ßžã3ðÌ/‚{Îp̲­RRNLmå¶l¡}€žw ‰'œñÄÞ²Jé‡SÉzÕ«¤·½ûåVÕZùK­©€½t›ÑK¥%ÏB”)P¦4#&0RœNRÈ”*ƒ6̸lûz¯S at v4žâ’¼}…_ŽÌÒ¢eå°#&JiCíhÍÕªÞ³F5ø"ªoéÆ·I|× ëÓ¹Iï‹=£òX›ŽFÞ¨ß#&üp3dÆ%òÑG„¿&@$ry@íZX,[ZÿlR?Ü*Åe­!`#e#&ÑG¨lŠ®Æ”Œq&¯?Iú	Ü¥ú)ðŠÙÌbY€*#b)""ù€ø»¦+_T.QÎ>òHùWe•äð]‚t‡G*ͧEøk-mܪÌc,º—hê<%-K mòþ5;ë>õµ ³[z³Ø?Žïnê1éˆ$$¨ßÚ”7­£uiêIVôf"ÑUïJµ‡Û¸Ž_Y6·ßÞUÿ@X¼ýäI7ªa#*-]Õ­`wc'ø]“í˳3>³Ã˜Ãš>)sêí¡hÐúAhAÝ:¾ò‘_Éí­š¿	䉟lab×°•\}`½;O‰ƒ‚Eô\=qK–=Kð|Áa&,ëÝu¨0"û+¦ü0®øK#*ÂŽäofÌ4üuÒÐ ÕAÚrÝÚ®ù£;Ï_'Kÿû³ÃÃWÚ¡¥Ÿ¤¨õ°iþ-ï¾Øà0¶¡ÿ÷Ããã“¿),%/ü¹ökSÝ|žÜ \ðXàŠ—ûˆ"ÂȬCªå¿V{É-Útš·F$¾¾yŠï`T¢^HAˆüz=f+âzûD{â¤Nê#)S	}ýkhò±œ5w}…]Õ¨™pùž KÍEuu؍-Ш®M'(fÄ$Š€TúŽâ	#¢¤f‚Ò%!_Ã„!¥­\à‡ŒértÏãT,éTïÆ;àÙž.Ó#*O×2w8B#&&½ò0<³YH±Aøwá´M†Tåâtã‡öÚ$±A3W”X0[EÓ•Ÿ¯Ås’™”’Yq¦¥l^de|aV†^Æž1ŽÃ:gîÄ0…‡Ñ_×SÉsy–ŸÉ'ùÑ*šÌ°eó)|ÁñÉþYS¡Š¥éûغ/B’$ˆ	UÆR!+¶âWj|Aà5Ò"(§¤úÇÉ0u\uY+(]COhÀsBùά?¶B´¨ˆœ%u›ôÇ‘Ø=J@y=ÝmzÍ.æmµ°oùÚXSªN*^\»7ú#*¿(Ui-]:¥•*UêK»\µ1‘Z#™d‹½ä¾éÛ±Ãómó×{åm¢Úz˜de·€qÉö¡ZŒt8Bö³n	ç:1ñËÕX¯¤Íα¥ËhöRª#*)ŽÛ]Ã…à9.õ“sb! j¼0wù¦©W³$Û&òôÍMªÆ£~V–­8#žâÓ*W_ÕOsU]§Èm+zòj¢Ô2PAæõ‘Q/á6¿hÖÔËoP‘çay®éÜ BÂÝšÏ)¤íd»ÕþõâyPSOJ¿c[”ŒýǼÿéÝÿ,õÿóõó¯³öÏŸo~¶ÿø¿hÿOÐØËÍç….  j}½¯!ôM{xó¦È€Bâø@ß–-¿¸¶‰¡›¡ýˆn"Zêz']÷D§§èžRÕ埾çüXÆA—Pþ†ÆcÊ8·A}ž`ãhèVõÅSîˆ@å•x"øìÆç¬èåÇÿ(³ÞÕý#&,¶Þý@@«º%ø~¡éïGù)ðý•|-0»eò²²ámÁ–ÒbLÇ™“¼ÀŽ–™Dh•”¯ó_É>dÎÿ8ýôæŸËÎÿg›pæ»çÿó¯¿þæóùÿ»<ÿ•ý$›N’¥ý­3”¬5!v“kÊ#*.ú¶hÎ(Ç{çç‡/¿=>Bwû´ÅIÅ36düÀ9mR—È)¸}ð¶…úrƒ«~/¡_J%ˆ~ˆxÙW: ÄÑs¢_N,6á \'«ò„}xºå|m„oÅ™Œ@Ë°î5”F Â,QƤW¾u?'œÚ)Öx»QæbuÇê#*öØô!A ±Œ”[#&Ê;üÂ7/Éi‘a¾Kf„ƒu£lOÛŽH"+¼l[€¡¿1ف»s°°>=‡ÁB¼g‡ç'¯Ïö­”즙mÔdƒSÄUÅÄ»;úåŸÓ˜”Va«:Mdâ½jQÌWŠŒ¢N_¦ˆÛà¦u^Ùp§¬l˜†K4@(Â`¢*•ÕŽLþ}¹ot±6¸ÐÎ¥ñ„„Ñ¡vÀÍ-k¶é§ž$£Ä¥ÅìEÇy—‹*!hYŸöE]õ,ÒX¿oá8C«#H«<)ô/Æ}ÿr¯ pÿC$`½émÐ×UC²B ”±˜v“ …1#*#„´™äeÒ	/‚(B`•ÌÀ; L¡]Â`eöœñéÿcšÌkÿÀømçü?o~óÙÿÇïVþ3Éx~v\jˆ3og½~·õS>3˜À”0á»ÎdÒK6€ei6˜ø——éê®<r>’>ù##y¼¢8¬ÃàW#ÅðæÏ¿¾o=#&ÞS¤ƒ—«ZÝ¡ª®:‹­Ü„/$[ðB¹èE.þãÙ¤Û›˜&˜ß•' ™ßºdŠ»WG3ˆ•I½IYa at klÔ(:—êOkç“ZBPáG:W#*#*B2v0<!##&’yÜ*@™<?ÁGg8¤kÐ`õ ëbÈ[ "›yb㈠\F;ó°‡"*À8ê§IÑÆù®¹ 2$7¯þvÏ2š–Ø?ãpÀ±/”d.\¥Âl¯O/-£~ôLj‚b¡Áfc[{”X)â3ÊuÒÃ6(ÈÚǤšO¹Ä¡c7ÈDÑ[7cˆ½Ï轏»×‹+ Â}zðF¯¾/«áªwµ?göo¾ÜümfTÛ¤8ä« G5Ø£WŒ_ÿXVÅM[š?qÃpCj·3íؤ¡®Æ‘=J(fÏ‘Oƒä+-eNS¡°xy›iWåñôìäåéE›QЮËÛ2™I@ñZuüä­í#*wø Ö+ çJ:3¸°0f¤—	óÏÒ½Hc¡×r´—”Q˼‡ˆè$é£ò0mYètuçÙÆH2"í¡èVL'éUµMTŽËêÈÏ;–	¡ß EìtBn\壧¨mË–˜#& Ф¶E×±Év9´¸9ÈêÌæíb»àd‘Be·²b8ˆqîÐÅ3²4š; z8Èc#*aü®›LÕ¼{-<1‘´OR*¦ÞhHäKæ.œ¸0piþêÃ,½:}}qîïÀˆ¬È÷¨ì”HF™ãOãn»3£‹l…Öú„SçàÓ}Ï~|Ôä$%ü&Í9û ñéÃãÍI§¶ïè1EÖÆ¥C¡Óï×â©œp×#"ó<>1d!YZa܍˜qrT<.¡ÿíùEé=Éšš]¥àmˆ£öOá*sÛ½}w<“Û\šO…4°"þ9£ŽëÎ|µ ñ®˜ƒYu;mÁ©ÇEœ{wP5‰öµ‹{8t{dLÜqÏk(rè¼'k˜ÊGI¥²ºçŽÓm'½¥·„:"ãh½[‰µÇEÈZƒàðeV at i¼¨o)6oéª.ôØ$mÏD[¯¾KÍ.ŧ,VÐ÷´‚˜#*jN¤[Ë1RE#&ѝ—|-X@²Ô`µiRš±ÒœÏu”£çÜ”Éwz^eðûÎÝÔDM9rCûhd1šSšœ;ˆ¬{|«cÛ0H½>ñÂÌÊ•è+Õ£‘)ç( ÈE‰#&Wò|-QæúÀH‚¡¾¬H»HèI¢3¼(nP3†FŒËR-QagmìãYrgÃ[¥Øg°Ï[ërA‘ìn‹ã)+!R`6ÅAäìè1ײ¡§ÉÌK1Y¹`²ƒˆa:»b*õ†P™l¨Ê’6õE_=T?CT*»­äÚcåb³Ðº›ÔlqLÈkØ­2×É%Íwî°E>É«Ü»™Òf=D²bv´k°¼ZÖT¡Ñ»ßèÞ÷|´ÑƬ—Ú"äæS‚ ¿"kÖ_Ø®Ìe\œv™ZQ5^ì#*ÐÜ…óþÀšTSÖ ‰šçÔä®/“ú$³¸ŠÏœ'ËjŽTe'³wíÃŽ‚úGb¶ˆg &·žíb hR_IÊN"›×RëlZ7k{Ål=;ïU`1¬Ø%€\Ú'µ´þ÷:µdÓLbáÚ^}mŠÖl½×ØÚGäµi‘¥†éT1¹´~<roœnã‡áì¤q¶æmþgLï6c¥WPýsÝÏ(”üttz®Óê§8‹C()ƒÈ/2‹¬'‚¬—ƒe ËÐÈ6,Ô|,eú±Ô)ƒ8|ÈÌ€™…ja}¸¤ÂƒïTße]b|’úÔ*dAÔ6÷¿­^ŸZERa¶–¨Ì„òÇ!G‰Åá±g‡I̺Ȑ²æ$ryDƐå4³HÌÛÝSkš}[ø4GùÿÄûO÷jöé5€–èÿl}³õUöýg{ûÙç÷Ÿß­þ(ù.òŒî(ø(Ååc#&W_žYKG˜Éî±×½y8—azàbkóõXxßè}¨$ºXº-JN¨lhNkr¨B#*ªYÔŠVà8SÂ2úöd³èvdÑ2WÕäcc^)sLÏ9V,cÝFQÂÐ`“®zäe•4KÙå[a–…Ÿ9øöõ9:c88zõ}ûâäD¹yˆxB¾<98ŒpˆÊ”J#*Z…§Mœju®.*È•!ÖU‚-A fn"­¢RpìjïEq±2J®ÍEQd¨. at uî)–äZ†Ê Jà씪o¯ÌRÊÈÐàú¿5ýÿê«­œýÇö³Ïôÿ÷úþÙG¹•Gáa¡M¦²* J9`žÎ®Æãv:…½ÌßáÙ1îÒ7篿==Eçh#XÿÓteƒÎ ß\¼¾8:>'5´—{§šUÜUÌ"…ÌxsŽ3æ©­QŠ 	Ÿ¢ò–ºæ"÷ŸAž5´Ûë+áèŒZßõùDpn1hÞª%Ô eUëMŽtÎä±Ý²9•ïC Ž%ïY±®Ñ9U“%RZvú}ç^g—œ#*—YetÙ#7ºcÏ^˜Ñf»ìFùb‡n˜”dÐæt	±°£Lè(âàg=·5L‘¬''×­€É@³Ÿ·ZZ濦é´#ô먪Jžº¯½êÚ}·þñçŸü–~Û)w)…ÚF…mD±eÚ!‹m"…Õ([ÊådãXúlÑÃ#k;aÂÌéf¶³mó®´¬·’\œóÙ0e—CI×i˜·6q¼Ì°/›¦*ÙK=qXCSÜî†xðÆÖá#*cA‰«ž4,IñBÝ€Ìr¶c]æÕFßIkuЍš&jM{Kæ#&#&tQ¬ÊÐødiß룸Ó{æ ¦Ó.L¿“wztzˆéÉd’K"|à*èJ•†„k#•þV«áÄ8d;†´£›Ü'}Íý(ë4{‘dWÕÅ\NLÄ$y;ëM`NéµZ9ʧ0\Ýä;ÞzQvŸ–o„—û⟆Æ [½ŽMÔR¡ž‘®˜÷÷GFðk¿Ûí“÷{g#(ƒ¶²âUUy)~¿úUÇþâ&h1»×xXµÊEɧb9&øyO­9œOi7˜´ªüdNÔ=ƒ5{”~~9]„™3ˆ"¬úëeSÐEX~Ò#YFªq¼ÉGfžVïíÿpptÖ.¥ÙR6C´sEËÚ™ö¦	¢¦®¦*^Uq¬_tÅ«¬+^e]qeoeØ>NâÞõƒ×éí¢OkÚeê°Rf󢿨^éxyÅÀ­’`CÁ…o»ÀëMG9ï÷=,á¥׳¼+ØMÊÜfzCÒ¶AiŸÈ±P‡r2‚<#&%ˆ~¼¬#KÇ]Rr ®aþ›ó fq<lxWË3ù!å¹tMÿµâ3÷¿›nü[룶÷³|üǯ?ßÿ~—÷?ËøŸµ¿?À¸VWM®fŠ![ÉEÚû'/OŽÏòœ1ñ$–u¬ƒ5cè~‰œ|µ ?Xd¹~·[§"ÈAµ5ýÒ-•BvêåVêEFçeöæÑ ¹í“Ó‹£—Gÿ}x ûÏ|'Û²ô?Ùt³^_œíæ·ù*™Ååqè؉,9с.4º=5z?œñØÔ¯ñ²{òY'-Î%öÛ8×.wŽÒ48F&~QrפfWŒÊèêˆÁ¥±»vìã,¢sS¨ýÿ¥sßy÷ÛúÙz¶½•µÿþêÙgûïßý·É?{¬ºMæê:þÂÛœono>ßܼÞÜñè8 öW›ôœ'S¯“b’kE´@\X­WIWµ0R²EV¸k3y}ôxvÕG罤ŽGŽ­<‘Dö4áݏz]oÐé#&kçÄ7[ÀãÞÜùdŸ#*=ü3"j˜Õè'Ûé-ÌC=9H§É ×ô]úÀ‡¿ì¥)*DB‰F!«¶AÑmî7ßPÚ{ª0*tNyTozøª3H¨RŸBÀ^LFA5y5š~‡ïB‡$bÁÙJ4©¸HAöt»¸9ÃY¿)6Ì&¼¯¼¯à8#]ÿ¥3!®Û¼¢¡&›ê€Å©’ŠH,H9lIVŏ“Isã>à.:iXRé#&Ž`Xr™‡âtÀ_SÝиÌSÚ/HÓjB@ÏsºÆ7à¾Õ,&µ7)Œ³–-L€BŸrƒm5(5,|íÃa—n1Œ>%U…4š{:>6“ê#›²tG›!Ú²ly¹×ý"‚òðÙª¨—¿¦ÿÿö΀A¶@zãæíŸRðÂH¶¥ Š'Ðb§PŠL&|?TS#&_iÿ²ûE?äíÍ¿ðsSø„†ÊAÿéӍ§#&¬Žð´\	ÅòI£_ß«Dƒ˜VNNÑTa„óÁ’<°V×kiH˜Úº«Úµ„®mÇ<ÿþþñÞù9E´h™˜„Ùœ#&cl•1è·‘kqë&£hy»è¡W¿Õ;³¬2$½+V$uíë¸‰s]œð¥-æ–Öj´ªh ÿHt»Qs†7AŸÊ_`‹ì®4žÌöÖlÜÙ²SN^_!¯ßtêÎnÜVùÖ»ïÄö®“°\º¶‚#&©Û\´ÜPM¾c¯4õÞîZ{ý¿½ŸööÅÔysñ4Á(d1»Úfãøâöz³`Ì­+Qc&ÛTkecY³ Yæ󡌬.¬¯eÙ—pQ{èu™ŠŠÒ™~à(°ÏQ*)c@²‚È~YJFC=GËiZzåøEÍ´H[›j»	{§7„‚ª@1#*;KkÓ‚ŒlŒyko’FDŠÊ5ñx#*P¦ÎÂþÿö¾´»#Ið³ø+Ê°ù#*% ’²å¶K½4EÛSÇÓáî^]Š$š¸HàÈÚß¾qefd )«=šàÙ"yGFFÆcùnÝ3“ð«÷€[-‘7Úyœ†:ý#*vÇ]ƒU[î$®fõCвô#*°[béøÍÍçzÍp¥øVúi‘U~¦9OUk¤YoN–Jþâw¡Ì Öµ#&•ÜMV6äéíâmaŠƒYmZ©yÓYj_•©ËV)ô±kBTK­ŽAÅ)þWaô8Ù•Ð6X9eLÔ¯J«u9ÈNžúRLÊ5Egg°öMÊl_e×З¨…)d¤L°ãH.&$ölà q{V]÷,ec!¶Í$ñôÐDš¤ÄŸÀ*©f¤žwrv¼ÈGbU¸(-]žuIzþô¸äÍ÷ºÅÞñlMýºŠ®„gêîØ’êƒtψ%$* 4o˜ ÿE¾ûé	ÞVFEZÅv°Í‰t{,d·Â·f("á5õP^Ĭ±?Š©É«Rð’ér´WI 6è{S½Bþ£7÷ŸÉwEk !Çö¹ŠC#->*aÂq-âbó5‹NBt†¦ãŽéÅ{…zX¥á%h	_I§ßh÷iä"~¹ÖŠW1Þ~˜Á}×;o™tbjK+0wäUñ”¶ÈNR´:(‚"KÖopœ/؆·£,õ§=£µJS5ןƒ²ã+¤}*/’]Ìà®Rï5%|ÍWDXs‘³´E%ZdY@àÙ`×ÌÓzáÎÝøÈŠÙéܪ%…(¤$àãBTa«?S7ƺ¥b8ÖÑôBºÒØΝÀ?À؉=%;Ó¨h:é¸FÄ€$1ج–¯ñv…³Y©]²FlõP£[Ì©Pt‚×{b2'ìy­¦ÁÑ9ìe×^†¸ò-ª! ³Î §bE‘¥|ó¢ßƒ‹8h·#µù->K]‹Ñ_½Í¤ƒì2CÁØ"BŸP¨cVÚOÓq–TÒszÜ>KH Õ¦)fûŠ"lµÉË(2aLX™Žé;p¡¼p÷Ÿµ]ÔtÜ'å@E;áq˜CžC˜›^‰›0ø¿áÀ²iŸ¬®SÈÃôŸ 7éxk£äXøîšS݆ûÿx;n7óéoƒÑ(*4a4<»E¦óŽs9‡1…žÈ&Ë1úßÈš‚Ⱥ–°oMñÿÏB#*XœÃI&i?þrœþdz“ô§0&ß‘Ð^úF¤vÛ°{2^âc2%oø	okëw’~EÚrû Qæ•b¶çŸ,à°*´kÃmÓ9eFBÒ±¦•ÀÕ(«|U’î°M' YkƒÂ ê•Üq~²ÛårŸËûÿdI¤æ“>ݤÿ½û°¨ÿýhowãÿÿó|ÿ÷a¶Œ†’cQéŒ'TC¹?™=ÌcB‚ÁW²þrÑ;“¢öñ‘±×À&låZÎQZ›kKa‰- wC%åF³¶ÀoA-H¨ªvµ¦“Ñu€o2£¬5îõ/Q+]?!S8[@AzëÆç¡Œ#*a¬Î‡Xi?#&ñ¢	´³…6«x…sª„8‘-ŠÀS‰æ†FÀm#&{M¥¦gÿÀˆ*èð#&†yo>¬îó–LTê(€8Dî5nÚšŽõèÒ3™NZÄ@Ñ2å°­¸]#*ÊÓ.H@"Tí4´„£¢üځ}røú#J£àºz>%ø%@§9ÈŒQ¼™"ìá©àžò×Öú$zÒ2Ñ4w½É#&Õ Ä@´iÇÀ0,‡G?þxüaër1QQüRQÓó#ê÷àí+x;¬š#&xÍ£ml=PÎ0y=ìo³í„ô$Ô­Ž&Ebì8¶Þ£XÑmATµ®o~§)†ã‚ÅHêÄW«5ÏÞC¤R/#öbIQj(ÆפQùk¾x7#*ÔA©ä"cnøa42¶>„øÚÀt/ÁìïЫ—!“ÑWÅtö3dâ…HäyÔQT¶4„\žÁÀNIÈcüStg<Éѝð àŽÑfHïòåY¾ •Ê¦%o^bãǸ•x}=Ë|o…á8÷Æà@ä–Tm`»–Æ©îQPh¸•uk‘~AgD$±ÃÅ’6Ñyo8B5|L‚jk6£¼™œÄW‹MÅ9æ	k±òÆ4Z®CTa#&¿¿6K/À9×Fðn8³å‚?}N~Ý#**b;TØK’Üà8i‡ƒ‹ëeóÆ`#*èæ€fq	ÄE•l`äðà,.†o³	­(wj«H¨…£Œöp\zòÞº&¨Š Ñ]5g¢î[kÀ×óÐ4CË%Xpz·/ì`6Í«ÿ¤õ  Ù«¼k‡]k"óŸh«2Úƒ‡´mëW#&“‰wàŽ‘n9ØšGøÎœ[þ¥z-¼˜ã)€7¿??þº0#zãÎì|‹Ä qâ	-_ ž›k‰¥r§·sÕÇí¼n7©UÇX÷¨<Ì©m^b0—ÆHo@¸<nîGÿËî°ë+ ®¿ÿ=„Kß^Qÿï›o6úÿâú€By¯Pô⎖l1:gm¿"Í°¿pr΄ǀŒ߬õXÁ®*DgІ¢#&E|á°ý¹“Â;3]ÔgÁ“çv,ä÷–ðT'”l¸**3œ–€U#&Ë´¿õæÕqúúù‹ôôø—ãSa¿“Ýïû¯p?ƒ;šH÷‡æ›1Iì÷ñ}aðÏÿcü'tñàg¾E!=°ˆâpRi…x'ëD¬¡M¸äÕ‚.xL–©l/'Ã>#*kÙ ìn–¬VÒ¯Fñ5DôéàšÁªo¨cÓÙ$¨|zòìõñ©Sð·Ïéºö×—èñc‘\}°ppqDƒSâÑÈuD	ùÏÞ¥i}WÆytSÈI#·&”îëÚÍUèžn(ù`ØŸQã®H1AÐ'#ãã„ˆÕ;b^ GÙjËÄWžãø²%ï(_Šb¾¹¥à…ùóÇû|¸Ê®øÝÙëšøÏôsŸ^u ¿›@ª„™æOðÉs¹6J ¥+òº„몃q”¾HÂ]ÔŠÏö’÷0lÐÈå#*¦ä ¤o°h–(åb²¤ß?̳ìûWO(í¾ŸåJ–-Lò$[˜Ôç°cL2î“ž/'ÿNsú}9ƒêBúCùCø9œ[ž¿zöøGzô·ÿròŒPö¯/Þ#&'”úôÕß^QÚè*¦¼ ø¹ øõèkø#&?îK|±	t at x£L‚£=ŒT(xrírüêuúüUp!O“q:kÕŽ¤,4#&nϧǸÒéJÌiO~¤Ä!‡@Y‘É¡r°ZWŒœ«SôCUÿñ鶌_äû“g?<}„Ùèœ×Á>­ƒÕ¿=J}M£É_i„‡ỤqBO€†=ú=ÎržvÌÓס>%Ñ7Jëf—=J£oœ6sÊ|,ËaÆ ø…RfÓwÙ|Ƹä{iÎöož³£o`Òö‹“&˜ù;ð&«˜ƒ Ü	Qsöë«îtþ94‚Þf(s ­UCk~A½!»QW-GGƝ@ØMšWG»±ûõôäÙó—…´‡¯~¢£3Ü;ò•8Õ%c&>Q…Î8%#&¸ìÌ{ÔßÆÖ=I3?%âiÒ˜g£¬—gd­ª’^¢ÆÃÿʐ|ôæÕëçO“F¸ÇéOO“Ž«'æal±Ä\°[Ž>R˜‚3Sဲ<ŸŠ‚&¹‚ŠQV¬¢„TN¤«J-J’=ßÙ”rÉÏ‹6‘HEtÁGgt”kÃ’‘?ÒÛPº	'Ïh~zE€õ#?Ö†³öl*$@úD¾tÉ¡)‰%¶áÇöüOÁr‚.¯Foáj#&3^e96Gì‡O©ŒŽq.â©‹ÆB¿lD–<Ë&¤’fnå┫ ª÷?gì»6¥Û]>h®"êV69ÐqS0oÿM‚ S×—Ѫ[ùx­‘àQªU¦$ö§Æ!“cñÇÊ8¸æöΠ{½þâ#œ\ËÒ¾Šó©t•–™uŸœ,j8Íû¡p‚¿v®˜©¸‹›l\ ÇŽúáâ&Î)7,êÊm!—Ö®(ŠNŸŒ$ÑŽÄÆ«­}@µjÐÒ~;w/,-´ãw‹k1Û	•›3/w`à9P/ŠéI¤äyƒöâøy:_Þá½ÊB<™}5ó·“åX”Ì!Ót¦ªÃV½wVÃÂÊË!íiEaÃ¥+Û쯎ßH&÷˜õv VË"4êÜ“÷©Žìiô/HvJá@Q6F¯f8KUÈÑ.ü´îð§pÝRF¦`¯èWâBzêÛj€½è”zà¹OˉÜN ?pnÎu1MÙ›CŠ?{γ´ávM_£U4¼Í½<(ü.¿	„îEõRc¥Œ\Dyzò½‡’¯E	³ñÕ{4}>þ+ºnuȝ!ôix^ðU¯Íèšâ­Y5«²tK z!ÔÁ ŠTœV@ToÍ2™Ò–ù‹ÓQ	EÝ8ÖLö†L¢d®CÊ $848Ž†<õî®ç«ÌìW³#*ra¶ ù'yþí7ß”ë }¯g¡žˆ8œe¼÷îÒ8ÏTi}^jÙ Í)Ð¥†k,¶Š³ÑÀf8ëD–W¨Ý÷FI([¬=ÈÇÜeÑ™„¯zA''¶Q:ú*tÝ&T0™;@f£ÅQ¸p]}ŠXë0^¹;…n g8Ÿ)ÒÓÑr‘+3 (ƒ›Ù 5¤÷Žµ•:àõÔ ”é[iu{âòöpæÃ•Ö5EÈØÕ„¨•õŒlW4_DÌ5E%aùNMê‡Yóç¸}IÓXºãXp°Ù¾d>Ç/™Ïûl”a9&*-LÓ=çÉÏÃÞÙ;èFúÞ^gògš¢CëUGŸVŒq, ¡'±¬#*Ù\.\ìšÇĜО?ÞZ–Ì0µÀ–&ÎcÌbÃát˜À°Ó«"¯v/_8>mlôÈriDf%Ÿ‘ü¯Ñ;d¡\1RýxF~P¶ó”"åuF$!Á—™«_ UHðeV¼7é›F¤hŽÁ‚=4&é@Ê8Ž˜ÆêG°4ð„-d ª'”…¢¿ÆpÈR°°$%Ùb¨´ÌÃ<–ê²ýòBÑgë…iŸ—ë–Ì2¥\…Qf½™_åÁFFp¼"`ôFþÌ_¿~$’Z¿£úP0qHë ˜Ï‰Ô•˜L˜c#Ød‡Ü\4Y‹rتŸß©áw{6²sºQq‘¼À\?{æš[„ ÈÇCÕ4E”±ãõ—Ö¢Ò¶=ÞõråÛzˆÊ®kAÓÚàœ]t{ÅÔÛ6ÐøšLèö‚\h”Yúו|¢•k_Û¡¾.Ž³l#*sWº¶ËN(Gy¼ F:ÃoÑ‹©Úcz`W‘EET §‹<ž#&HÈ^ê™]^·0‘fûZØÓŽùÒžÓ«pEý¥®í¦nW±CeÂþêõáë“#¤”±­.2ޏ´Šè˜eìÆÍ·¾½v9Ëkf"VÒdÐQX)†G¥#*#*ûmçºÌ9ÊT1;{]ÉYû8Kæ flÚ Ü xŽ‚s¬‚¡1™±)f¤@oKÙµf<½(¥vã|+ZfÆ`.(ø,f51í¹˜êl¾hîÆoËK3[á»2—¨È¢×gµ­ùuÛ/)Nçºd¯®ª‚ß@ V=2d¡òë6Û…¦n7Ív‰EâVbo8àRsäw΍œ?1JF!ѧFŽ#&xlH¸³Rl@€,€f  £$î\®|±–P×r²¸ˆØå“H•µGŒ•*®Hp$"i‘œ¹…Q2„Нõ‡ÌêŸyº¨ŽÈI³*1þj®4ÅÙ uFˇ‰?T|k™g(ÛÉXųdíMæÞA•XêÙsq«“βKúf¹¬‚Ð…JGdAVLlÔu‡:¨ ÌL™cÈrc…uç³?šùa[©„É9Áƒ…fNÉqdˆóÅúÊ•³ôTYaË+¸¹Ê©Ò¡ÉIa#ÓN°Þœž2*¾:”O$ã#/ö Ó§‡/ɉ  zÃ3Õ2*”ñÓkµi¯ŸÙÌÃj2·‡Lî$Ø*—rcAåJùÅ#(î±;ÇoÑa7Kª¿÷®’NSÏ'`×-W5t+ÚvåYh' ÔH¤¢4r·»¡Á?[¬½cšëG‹±rÄ"qõ]®8q££ª§	âÆØ1«h«n3š0îÍÔ¦‡çVÍô[¥|…¥¾[ž•Bò¬‰Î£*ëM1°â°—’÷x[ÄC1<þjãš÷MÒ‘M)'áðH¢šÛp4¨J¾ô€YËPvÿf^*t|ðfrCoé<)7—ô—òûØÜìÝt~i?¼<|zü—ç/Öéoó¨Ü;™@nç=qbY-Iê/ÒTÜtÐ)ºjP¡ÀÜí®;­=”1å,cºN®;­=9Ÿeèñ•Ž8w¨Õ0;Þ¹îÆC<’’‹ŽgsÝ[Š“3;öî'Ö9ÇÇÖ²—[–%%Ñ®­‘쌄ÁªâÍ·ê$Çb¿…Ýã±ßãÞªgdNp}Ûõ¯xôš) sA(#*$¢$€(yVñÀtWzôVòõ(–6Á«ówý T#ÊS›H9H8yúÂœÚmé†g%ÞƒÐd9^ϧò£%ÛñÕ¹òÕÅÅ0ÈØ™/`EMóá*„¤ªG• zªÅá¸×oMÃè#W ɲü9¾y9¶¹ðjÊ^âõôˆŸ\]$uɐî>ê¢k#&¤{ÌíÃÄÀÀ¥pÔƒÓ€Äa{;—ïÛ¶)‘”Û¿]9ìôkß]¶RtB燋¨)W0ø¯L¯ž£å¬â5’r:=ï×Ë“õñîVú…S¡ª×L‚{oª$ôdÖBa‘ÏœãýãhA·¤_iITÚ§§ý‡ëe-hµÿ2ÚeWt	Gº+‰<u¨Ú"¡¦Éö$w"ˆÜ'»‘S2#*ßV¢l<µH$¢ ýü•59›õò\ÃËh4}í&¦RµHDaÏù«ˆÿ)ƒã÷ÄïÆ݆¡KÂ6½‹‹ç°£¿>Ù\³ܼ̹ÜËÓI–Á]Kû2©TDdMDÔ·@aå,Ê:5‰‹þOü0YƒæbZ­^Þâv„Ú-DÕQ"5âE#&ตAÍÛÊ â¡Sé‹qAïý7àšUàÑKóB×¾ZÈÊ~}$Rj¿nq©gUà7· „÷wpÕ‰d;è^‚ HÕP“×c­ZYþx¡æ5±>â*ÿ"M}U§­‹¾Ž¿Uû“£bŽ” «f§JåËå7*¯ã^¯8¿¾G¦-ÕÓVÑ»¸º–³µí/¯"SR…ëÆ3Öm*•»ë€	Q©Ã…9©…£F”n—‘_Ó$׌¼«rËCuÙŒÃèšEmnTœ5X‹äÆnaç«–‡GÃ|ð›‰Ó§pø\m[]㘡¬š _Û–µusY Á;r7Ž…îèÿgµúÃãÿ|óða)þ÷î·›ø?Ÿkü×X… ²6…@°Æ^‘”¿ï"hµra_V«Š`ʝðbgI4üÛåpAÀWDдÅ=ߤ+”‘Š™s¥µäjEæ’I‘Oˆ7÷3(ÄÊã«UªÄÔÅ%2âJ–çB"çØ<±‘ <û.»^“Ö„12#*‚^ #'@ÇKBŠ#Ø=ð~%ŒÙU[ØHR«CUE6ªlä¿æèåw]î¥NýË(n‘P56Ùо'Ç?œ<;~e`žX¼F€`‹ºbþ#€d?¸†‹%—U>l0ædªâ½À4„¬j®74­à KV²MÃ{þâ½u·žàß®[‹©¥ØÛp{žJ=ö%¦€Dw§[ -aë™	6Ñ5Ÿ}ÿæÙ“SYÀgËÉ€Bu´à»ÔÀƒÇ4M§WË™YkG•Î]ŸÇ½>ãóÇ­-•Ø½Èþ´²yJVŽu»±rÐIjX=|(ôþƒ2‹Ò[3(ž•!QOY#w¾%bT¶à ˜¢+#*)f,æXæò2=—ÈU«Ã®Š‚¬ ‹ëçÉéizü×Ï_Rðè5B3iq6A‡;­Þr1m1ñ£ò0³Aªçº)(Í@iˆ‘åÊÞÜÔÄÞEÖ -UÍdëÒºå°nßqè„áÙp4\\›ƒ2ö(s9GY™—¼fÊÚ'­Óuû”¬ë¶j·’jÕª#*#*X±gzÃÕM;¦‚`œÍ£[P¦ØAÿÙjv¾™r厔ÚfM\œ‡1Ø%Ó\9Ø5©Ý[ØÉ–*IýÐmo”7#zí#*=€pGêïŸGK‰²ö×Ç·ö'Ò	ýÙÌOèÍíï·¡3ÊCeCá¡Ž-úÆy¹—Œw§º(xÈ8Ù¤bÕ…,Ó×e2µ¨ËåMZ—‹³.Ëtxs÷»ûýoÒËÇŸüxÃýo¿ÿoïëÍýï3½ÿÕ»ìYë_G<ëØhÌ[¸ÖÒ|÷·¯Þ?;|õóàßÔk¡_'ÏŽNß 17Ñ[‚ÖT‚Ê„[Ё0œʉÚÈ#&´/þtü“Ïf”óâEØU¯ÉT»§V#*†D DÞBk…?«Í—t´Î8Æõ›_TEa2–P®ZH¹…ÑT­ñ@i­a§þZ¤«7±žÆÑïºÜ18ÖõËÌïxÏÜöB6é0wƒ§¬&@óÉoµ˜HÃ速	QÄ#*.±êDðþ	šhoü4h`Ãt{ОÊCøp°L½ÊçÔ	­3zÒ¥æ©èb‚ˁø*“FCÔÎ+t¢#*KxØš HÒÙI±cDï”èÀ'„Þøa&*XDQ)láÂkü#â–g´³Šò–’ôV‰wmOŠÑØUÔ´3¸9²ÿ›ÏÿѲ÷‡Ëw•ãÿî~½ñÿþyžÿrº¯=êoðžgÜqˆ.I#*„nãì`?ŒçKþÕûÓ7è-wg¾#&áfµ0 „¦u‚ ƒ‹øj5nïøÍ(	#†µ‹™Ò3”¨6¡/ØÅ×^Úl {®›h$¶¼‚FÚ÷1luÔ4õÿ÷ѽÂþïÍ?ýö¿iÿï=fßßÿ_?zôp³ÿÿ¼ÿyÿúžÞÜðú"òð¥eó_ò»Å!…^>Èn_R[Ç\‹áƒþv|zúü/ŠVL5¥`·&ÅHãÞêÓ³<!ý0£Í'沓ޠ‡QÌš/'DÞÍ{3ç%™N«Èv£ò[YAUÜŒ³œÑ@Bæ¢ç#*Ç!ÔÆXmtKºÔ›U:|F•@*Iƒ ^>C#&výú%³•„ó~º×ºÞ¼RBèb)‘Œ‰àm”¢óUç“Øë6 EÐr–ZaI<…æñnîwÓŒSöGÆÿùöQéýÿÑÞ×{úÿ¹ÒçµÙ=ÿWøo~¹ÄЭV1€=8[ÆUü£pGFT$ìd·gñ/gV,øÔhvÝÝÇÜ]<Ä#&¶–«øÜ; *L´*ž¥ù¿ ÄC“}kQVR;ºÑŒ¬ùfù¦àɃÒBüZZ_/SŽ*h•Ü#&0	hô›BD:”\°=ol[Úb·ßƒ3¡Ð,EJGûy‘êOž½>=:<ú	‚=r®í%ÙPLMˆ	]Û‹çÕÝö¬,¤*•1X~X>ˆÑÅÿ“·é!ÍkäFfáÔÈŽÂ02…Ûe§WžBa̦Ð(l€ÙôÓ,ÿz_x|~txzŒI!eÒu±`¦Î©hz—-ÒkØ)$‘+²äX³+(Hfº¤xwÌ9Ö‹éŒ7ì’Ø=”[±÷ÅåBìqî5G0d†€R@ß/#α)C{CŸP [SÈXu„§GéÓãW¯<~šDéäNØ£þF¥ñVyx¾ÌlQm®±SÃPÆË^^Kh¼:x¯¡ÚÀo_…âwPPÈ q€^ItQ;)º9ôœíH=oâv€a‚,*/D:$›/ÄÞéK㚐í$À?ÒÂ8ìÔôpžùl3ì´z­ÿ:lýßôÿ´»;¡1|GŒdv˜M#¸3,ú—4çQѧ×íF®W›£ÐD0×HµÙ¯D#&Q².tCY÷ˆ“	ãÙ÷hʃK*²Ž2ÜÊÊÍn<ÐT)©Ø,ÎúËzû2Ñ_?	ãmv˜½@#*M°ó½0›Ú¸:׍Z‘÷U̾zÿâùÑó§*CžÜ»ÞÕ tôÐ"¡ýüù)â³Dßü 3Èü #Ä>JÉ‹”_;é;'#&ñ^çV¥ñ³)¬È#*q|8Î/ÎÇu™"È¢wŒI` r‰ ½T!é‰ðžeÅR_èK^'¤1¥ScÞ3SÕ“×gó‹L.ŽfðTûœ˜æ›¸næ>IÄ=í›Y6¯¬Ó¥ŠÇ/OCý–…yÊÕyÅ „ïÊÃ4*#*s–Ù«%«b<1,“Ë­¢—¦RÿaSÛ˜ôìvAhyéf«#*Ö·Þ¯(hšßq 3Údo³Qżj_ëvfLô7«ë&G¶ítTÓìITèn×b/DW{)¤ ß±õ_Õ˜Ès=øé‡@:£gm‰ xÇ`ƒ°9tš'‰Ø9Fe"5„ò[­~I90>é'ÌÀ¬ F”݈¬Ù-¿CkKùL–À˜!‡Ÿ$zíÄ’TL #ÏÞµ+I%J%îï–žP?6×Ô¾kCêùÑÓ0rÛ»ÞdÁʸaŒd·-\L¶=	Ɇ`©€q¨3ŒªN	=eMµwmì³`¯‹ãT®ÍŒ¼T•SØœŠpŽëR±EAÅH3Û#&€ÂÒ{¦˜QU]þ”Ù‹J¿0ÞÍSý‡´#*òŸ|9é÷?õÀMú?_?*Ù|½»Ñÿùlå?°ï(ÎceHèØ—o’÷ûÕrå¾øÚe'?HÉ M¾n±'Aø#*¼¤)„'2ÂèßÜ„+í[ Ÿíè›Ç< <puPÑŽñýˆ-ïWØžôµ» ãÁ˜)or8.*t£Ò±Èµ—…Û„º|¯Þª*ÍØ}Ö‡ƒe“iø=Τߗïd÷‚Š¸¶HB—ôogçrT²9úݦ*GÚRåHUŽ¬í@•™Êѯ•ÊÑѬPüSk‰r+”ïïf_r¤”³ž#&û·1/ùñwZ–ÜŪ„¯F	†’7Äa˨FoÉÛÏVqAnáËê8ã/«Ú¼Å4ìOD\xLÊq;Ù¤"¦Âù—±y–ÿ¡ñ?w÷w÷•â~»yÿùœßÿk"wV„ÝüÏåt‘¥ï.‡°—f½~Vùð㔂Q)ð/'Ï^¡Jï).ɾÑ ,”¶¤pT Qµâ™”h¬ýIp*óÅ‹“gú÷‘þIÀ¢‚à¤IœÊjF¸D‡´¦¬mjµG¡Ñíiè91ꄪ†«=8Ÿ†ªH†$yÞ¯‘íÑü.MSF]+“#*ìHûR,¾¡ö€\Ü$¼Ò< ¡L̽÷GOc•lîÖНý„Æyw´,	:ô¿`‡#&ø2&Ήk¯àì c€ƒÎì·-æxjCvÿÉ2{Áヒpœ¿•XSµU Æ[`¯\^ŽæfŠ¢Ù;Jô9Ã/„¡sûñÔp);jÊÊÞhRü¯Õÿ0Ïó þÇÃo0¯ ÿ±ûõ7›óÿ³:ÿ?yüoøFœ…	†—À5Ô„í–¯¬AÂÒ_óÄ#*(V¸§¢|—àݱEôÏ/ÐŒ7yötÑ2F½áã$D_õ½¾NLr¹RIß%¢õÕ³“{t{ÁG…`ŒªÎQð¨òt8îÏþ´uo–4ñÇý¨¹G²Ú»Úú@·D±O(|0Íæv“œR‘l;îGÁn8“ÿ+›Â_4Ò`®ž‡õáÈÉ1#*€äò/­bšÐVñŸÙý»x/_a˜g-ÒÜ•°:«ÎE}žâ×ýQ'AY ¹èįNBý<] ¼‡ê^…/<&KZ:]ØӝkxòQh‡‰æJè£`ÕŒÑÇ4ƒÃ1Ô¡<ýH”µ¶B¬³Å%#*Ðq^VÞKüŽ¼ÄW »v°HWkö¶ Îç„뚪\+×à°N•7B™×ÏÖõõœ4«vá²®C—/ŸbäÖ‡_å_Fõ5ÞϘ|îÏÿi뀮aÙ"çâº<f5&Š~Mz	“~Ö<ǘºúÅïܳó¦Qf¢èxÙšÏÈ,*òhŽoS8þâ¹z×áà¢gW-æ—‚V‹”âòÖbŠ³8]. ‰T$ƒ8ws–¤PR-sZØ#*¤Vè˜K£Z1*=Âç98–IEZµÀœÄŠ‰%êkë*ÿÅЬñtPj‡Ê†[Ì=käÙÊí<p(¶yûW=yF.¹¼—£·à£Üúna<ôÐ8+\õv¾·Ë#W'o†ÛV×<z)²½R/ô…έëýn7½®ÅҏΪªsÍ·=7¬å:êk(â†D·íËD8½*áã$Àx9Qzk²)i êžhàãD6äh*Ûd‹P¼k‰q='mßhí¯“p`TÌa(j#þÁ÷ö»ùp‘á,8Py1Éf+ñiŒa}¼©üÌ“ǘ#&¯H'…øðº‡aÝb€‹’#*HÆ@[ú°ã›%ó‹8«j'maѽí4IùʍÏþû‡?à/"…&QÖ|~ã(p‰bª-9kó’é‹ö­œáWïØ+‰Ìª*˜M`²¬&D³¬Æ­c;ר²È±#&!1‹+"ôûž÷†äÒܪ,Ît‰ŽÞ†îÁ$ãːMÃp[`ÃR'j#ào rvXõ#*–ÅëhXaÓTíšZu{âTj÷u;O|âAýZ1Áˆ½=I³ëÚ]Ùp«R‹š!ôý²÷6K%Á¬‰y”/PÅ¡PkïÅÌ"ž³wU{^˜9ªé¨+TÍ¢ÂÈU«RwbþrüòÕÉógá6oz–/s>Ç_¬ï–WMË÷Èñ’Rwì¡çv»ó&o½ Ø÷$Xã-µ½gΚ¯dÜWÉBXWy׋ÑVÿUkS¶ji½­XTšxQG…ßzkX³FM æÛ=ãе¥KêYC;`2…¦õŨ£˜UPë;âÅÏ?¦GÏŸýpòc*7«`:ÿ·*pîÇ#&Kµ°"q[¡‚£#*U¯Oè#&#ÁÉRL£{sTþg•}/[òS7£ÇaaT’zêtëý“mp}¡‡¶ÅwYÇqõ¦pçüa^‚´í¡ì8ø‚fÅe|ITÔ•Îaº×´Œ“+ëˆGaÇÙžM„XÎ}§Ûi¾‘˜b Ev©ªûM}dÆÆô”uŠêE­¶é6p7ñT@‡Î¦yfb7[³Zc4½éëæx<gƒ F9ãXu–½«ƒ‘/ûè"ÖNµ·¸­+;L‰æ¦–&®àòÔ»¹­¸dáºñ¹QHèºmޟή‰[#,Ù¶´¼yÍ}6Ý	¢6‚…GyÊÁy 71üçû^Ž½<Ï8ÂyWQŽJX![ÉUTHv£QéÏS/èïìƒ6x#&==Ø2¾£tµÈddPÞç#*¥`ۍö­{Øá9:⣇!¾P ¼Ze‡³¢P4#ŠÑQP@ú“’lTvÙ§åy Gk’6ý…Äu•n)¶#&r¨oð·pBJǃÖw¨P¨i'üR| ßmçñF¡â芮;ßÝš™Gô—U®Îé&ͬó´G¤¿`ˆÚ~­1ð©Fmsa"PÜÜî‡;ÍfE媲Ùëâ¹u!ÁR¿¤y%C.õ–œŽ{}8¢p±Uú@òX|S‡]Ydã7ÍWix_òîŠT„±é…6u“à!>¯àeuÁg–ò}gb”w©‘z#*K3ÆÞ*bC#l<ò:¶óö%ôRw,£ÂuŠMÙÒÁt‘^j¢@hàÿÎA‹d×Õ•Ù;Qït |wÀ-ñsÒ@w¢M;|¼D–“>ž…á8_òdy¹Ý»ŠtLqnÏÒ.oZ´nӍߡ÷†¹ûrX–VB¨8ýBa#g‡f†Î—‘hˆÚWµqxX\Ν‡‹Òp,TW«Wdy…„ùb0œ,`Þ4”ûÛïU+ËŸ`hKu%¡!ªløÆƒ1Xa¤×_d¾oÜù“O¦š#&Fw1üb¾¦ç‚M_UÁl<[\ß8Š?f5ŽÐ…ǧ[#Ž–ƒ-1ê>bÙ9Ƶeñ%|÷¾Ù®ƒÐ0/ÂûG4ÏsááZéÐ~t[#*¯Å@#&/ÆÙdQ<w¦ ¸óï/¡ã€p¹²¥»A…äJ7ébÅç~Ã-#&'¦‰aŠ·HËeDq“Ø–RMÜÒ\b˜b²	{k«(Åo/ËfÝpºùÚ†â­Ï"ïj!T©÷UÝ7°Â9ú|¾$vYŸìîê;˾û­¡†Ã\Ž¢ÿªÄwL&PnxÑŸG‹‡ë4ÖˆTà+ip¹XÌ<8ŸgÙ%\ !£=_<ø‹IïâúÁ»ÞùÙtzõ ‡©@S«Åxô¥È3ÑT	 Ó¾<¼OsôL†FZÅ;ô0O¥j4½Q–•âu…׉+ŠBswATM’]Þr•°ê	€­àJ0¹p"di'Wö¦0»N¼–ûeõˆBó(ˆ²kùá‰PJt;Æ¢$c´‚*úÆ{b)­.å®æoPÐ<JxoQN.ËR€õÅÜFò<j~£¢†ìZË‡"òÇ+vL‚&*í›‚$z¶—ŠŸ²ZaÎj¥²¨£«äJE¦ñ‡»¨d„ï|Þj «\Á0Ü3ähÄèJÑB’™Â ®ª–dê%‚°ð{ÎÂQëÁ!›EnäËÏÕW;aî”-!:ØMâ/–Qýa×|9IÑja5­çŽÛ˼þµå[#Ìb_ŽôºA->Èùˆ»ž:AÐÌ’\LÍTqQ h =Oí#&»,>غw…(Y­êê»=Ô<$!yÑÖØør Ëá6&w$Ý O‰è€D}¤ˆ×žpR5Å‹O9ŠªÄbµÅÐPx²5äýèÞÕN²§ƒ¸Ž{W”Ê¥(—<(¼7ŠGje½ÂrÀ†`DŽy¸Í˜TœXײµèaÏåÅVý¬4Æ4¶|†zŠÊbÐ@e+¸¾äM,;&ÍóœdµLà¥šÔâˆâð[»çy?v|I·®O΀û°#&7^X8Ö1E&%Ë6ý䁼ÕHìaØ^‰Ùgœ‚Î? ¥9°àH·x•™ÄÈ‡é˜ ~°É4€PBèÅe²È#k˜Š{ä—Š–H,#=è_¢³*™€›g9Ld“â$ÏûâøDØ>ûÛgýlj—_¦|ñ[ìÄ¡0Sl`Ó”Hüâ1ûvIÔ¬Ä.•%|(Ŧƒ4~˧RñAÊ8yœÆW±#&«îtIòø×	*M|—$¿NÛÞ$ËjÇÎo6ŽäûÞÍIÁ©Ù#*)XME61wW1®KÈ©R‘@­#*$úLÜ€4ãFú˜U³¦£T2-G­×þ3åÅßJbG†S~œë°—	Ô#&©P.é˜:»;~WE“‚v	&Lî½KüÁ¤¦Ñ!€føë$Œl:¢*¦‡N„†–jri>8ªøùî‡ç¡8ó""G}º7»Õªt>U¿‡HqwÊ6=ßa‚®3¶þÍÈÔÃgÌßc#*# ûâ!gg¢¸>)„Œl¡³‘}rê[é¢Mç°2$DýE3Ú*³ËÌ2G- q´®zÕØθ3fófØw¨XÔÙ?híuIn÷¿þÚð_…4*Æ¢ºr#†~j©, û›4â^i…8íyÐzŒÿŽ—9Ù…÷ö¥~8zôÄn7õH[æHYU«d¿8o&œž¹æ\QÍÉ›gød«jlîÞ}ñbc@$û<,ü¶Iß#*J,µ§¨-eÚ!a–œÑå"+ôp&Š?¼ã”»ïéJ „b>E ‡‡@u mמ?g×úŒPeÕÙ@ª2ˆã5¦âk'­žY¬YofÝn3´åFH	ºã ~-?µ#Žè5ꔦ=Mù$øéð—c´+‡-E_·ó0ªUrcO¤:µ"’³ö#%‘?»0Dsüs±ìÍøe1%–ó7#l‰Uø/‡?Í•Ÿ€ƒï§Œ„þE´4 z='‡Ì±šÐžl“cÊ€Fñ¥àüœlÍLRcǯ©ó	ì²ZLv—sf±0B[¡äéUß*ð.,¬\3ŠŸª®*N|çd:Su˜#*™ÌÙõ`Ü|g‰&_üjWßø*âxe,Sf‰Ã÷ïÂkž(øRAŽÁ€C#*ZÁ`Êc9.‚ûøPÕˆ¾žãf%U×/#&å„ïøöÜ´3Ûo‘_žFBÏz«+bö¿ P8úáÇô‡“ÓãW/Pþøj FàKÀS}ÞιÛ®=…+Ù¹åÕnü‰ÛTz:½íM,dy¡ røÈÛ;2„¤˜I¥˜øƒ{Þº?±õ[…-7îpºh#&uMyK˜Ö Ñùr)S	ƒ¤0å·«;Ð*b|2%j îÜžY‘óqƒý*}ÜÌf¾“Œ[u€©æ‡ñsßKŽn ¬àé†KR4›9˜‚³“ÅÞn HT*ò¶è5G¥»(ÁX[‚Ž9ˆÕS^7|÷ôä½+—œðÈÄñ4¾H¢j°/L6a÷â®Co"yÞ#*­ïd^çÓ¤ñéÓ/#&)£0zUh¯ùÀ»®Þª *‹°3“¦È²ØISkÖI’Ò;”£!g Œ²^	‡$8y˜.!ߝ\ËGgÂHšß™°#*üÃ0C^1Z’âX#Ipœ‡$(VAR*ŽtU¸"Ý9„­’ôºÖÉzAªtEùxܬéŒ?2þÓðì“»ÿ¿Áþ{ïÛ‡åøß>Üøù<ý¿°ó—¸Â#&\E€^t§ýþ1™Ÿ4_NŠÜèš  &¶ÔËã_NÐ iì¶÷Ú[çÀÊòE™â ›å	ŸM±óÙIǯ$Q­õðœ3Éœè$vå:9”0šô6žˆ{dÇÊXçËÄñfø³Ùø2€nfsÃvŽhlÝÎ/ùüñÙ›@Z쵿iïý$6gï&	ôûŸa‚“ÒCèµ.	°|d“¾èÛÉrÌ5ø’'*M¸j÷Þƒzê›}ÿ<LfŠì(D’¿ïåcmì“öL©5ƒ»ž	¥—Tœ#&¿ç“¤¿Ô¡jéb·Oÿî± =ºýäÊÌ&‘ºNWÔ•¾J4ÂÈ12º«£ˆ§l:‚£’KÂ%ŠÇ›Œ7¬^?ŽLEmìò€)ßg‚Ö&0’°Ã0Lâ™ë#*GH$‰%žìrM˜Ô»Èðç<{;$Sø.¸³ArÁ$¿DŸ~Àá‘“L¦®ì`„™>Á®´¿ ´4Pµj°5ž·ÛÒ3‚q#* ¶¸pZzì	·½iδkõyø÷fçïIw'J~#&›íûѯáWt±ê'd¯aÄ“‹úƼ!W‡u¾àÍãS²óE<^\.â4ÉgÊ뀱n‰XǸƒÝ„@Ý;•ï2QÞ¶|ñÒßA_E@ “]f\‡‘åð׳ì‹Ä8à#Ãs„w>ž¬ˆÛÊÓ{5 Å#*cƒÄ¤RnaÏ«û¨g<òW¹t¯Š!€]ö«÷<ýhMTU¤, ô°ø#âÙ™vpñ;š,.Ùó?íùB´™á¥Ð~ÃZ6PJq—‰v„Þ$”ûªÊ\âFž!¾çØ–"¤­3M\Þù­GĬÃwÞÄß;!#&ÞÎh‡'‚Ñ‹×~‚%Œý“G$(…²ýr¥LXƒ£ÇðÆ` f÷T‹h1xCi:ô6ò3qT‹y*jK­®ƒr±3o¼nV<r˜è­3ÝD*Âo8zaˆ¶ª†W¤_n¤SË®7bt±n=<ÀÇÑ’°kÆJÇíFƒ¬J¬‹µÙ›•Ÿ#*›™Vtç#lRâTn^ Pñ‘‰1hdà*ÃÁHžu“.ÒT•œ¨ï–jA5”GoZžðN#ì´à ï´¯.º¬öGQC…Ðvøõ¯ÎCrÃru>ìYjb#*é3^çès\§Ïdgc†§±þmeèÎgêÓ^#ø˜ö“Ìq]è×Ä»#}Ùò͆ҔXsYðôÜÓ `ÛÚ9ÜÀðè92‹‚Ëò]TcæÖý¡¿:¢Ëà[nêÎô2lÎ]x9âÝÚ„â“DŸÞ:ðËä@oG¤Þ8‰`/z9J.Gks4‰û›„ô #ʃٵo‹RIú·P;ç$É´qÀßåiDË!x1ÀÊ”Z±	yÎÃÀ(Ü<Ö,±"å–4†ÄNWAŒ\7Ý°{‘nhNöl4Zßnví¹kwea+Ø‘F±#*š«x;ÿÊ$Vë*¢ãöF6_4wãºQnl	‚åڊЧ#*w†•Îb³˜!WœÒÆ#*÷Ýbº$lþå-tp¦—„0Šˆ0„JÀüÂøH…A8cŸÛM!2QÞÞnq¡¿†¨Dù–%%ŒÌþD4Aá|/‰šD¤Åt¿sªP“!?e 0œ›|rÉ0pÛÞ+[á|a1ڝŽÿdJ#*¿êÞb<KªK:”Ɔ2iBCÀ£Ø$à Ûv”»E¾<3xeÑVdXÑo¢kž9Fx0ú㙋éâ2›{Äœy#î×{”ˆážäUß‹g-á-×h7ló©„?nk@#š(¶Dkw‹{ÍèXPþÈ…z©h[Úƒ¦£÷ƒgÙ;$GDbÂBaÚµm£Äž#_¥åví#*R˜×DöÔêÂ/®íŒ)3îÍè.k8[Šv&¸¢Ç»â€Ä&+l$¼17Zö{7oRJä¸ûð«#&¥ÆNùP(¨X¡ž^zõâå*Î5ŒÄLïõÐs’#*»‚åwQÉÓÛ	&ߪöíÍ6C›¢iqzZbDTƒÂj1癇SNž<°Û‡ˆ²1^ÊkÙiu«N¿U£?¸U£[µŠöó?±eh#^3fdîUÙîRÃI(ώƃSTäÀ¦.Q#&]O¾Á/*¸]	3Ô#&^ ãùzún¼Qo+[õÐ…µs>ƒáßoï¶wÃãÿ'£ñÉE,[“éܤŽi¸Þ¸7Ÿ^á­5%ˆž'FÒÝf7£/(µIm†ì%¦bAb³Ñ2Íipô¡†ü|¶ŸeóFÜ#K˜¤A&é8ņXDŒ%G)j°´Åzx›ž'¾ß%¤êHœn*“·­¨ãÐ,.eâè|üýŽm%`356,ó0Sä¥ÖHW {ëÎõ´FµøOËøOïŽÿ´?m¹r’|Çz¨ï¶&1íÀ8ÙŒlÍ…¥nj6~°T2ׂˆTbng¸“QÍ}<,G¤,ÑC#[(nÙáëÓãÃW¯³%[»çöÖÔM‰Y3•]ÛŠÿzxT®V9Ö5•BÒÇwv2#&&Ù;êÅeÏz}#*žþU×Ü4ñàP182›œýä`’(â1O_${¤²H위”ó¶<9¸c,Cy8éOçñ2˜nnÀµD÷\^têQQh͆Oçf«±mÞÈÔaWóÑâ<ñÙuj¿1G¶-pA1?¿°äŒÔuqþ8©Qòô ­€sÝó±z‹ÉáL’j€[`T+Åáû.©Ê®ÃF†—ÍU¤†Ý¼W­"¿6:eg8Z>‹H#&$´® k¸‹5EN+‹œ®+·‹ªbÌ1DúAgˆ¼62Ëiš$ašâÛdš†tJ»C{ËƱ3+°abØég‘h‹¤”&Šf…ÕpkÐ	De@¾ÌÆ£ÿïÒÿ8G—ÝŸ8üßMñv¿)ÇÿÛß´Ñÿø,õ?Œs}V€ïüÊèÞ“*š¹’3)!¯a™wÐõÑK#&·Œÿ"@>êÓÔ¿DGôüœË3ŒçKT¾þêý§ÇÅÐ6d&ب>#&Ú–'øÎÃßѸ'l÷ƒ6ùöâÌב¸2¤M…¾$7…&±Ú0¶¶®Æí¬‹°jÛ%ÁW>ßý?_ž]ÿÑûÿÑ×ßì•öÿ7ý¯Ï5þ—¦6ðé{Ujqùz[üh¹&[¾ Ø×¢!-V@8}£½@6H_ýôääeúòÍ÷û`übŠKVVÇÁýt"Vúƃ§ØŠ"K¼™éÐO«#*N ~É㿾¾Ca„ÖºØé4Ÿ²…GY¢pÑåÈh¹<emGH…Ç%šÃŽÇð&Àø±ÆJ!vKÀ’è±8ÒP²6¶8©‡u:Xe‚Ù@°Ì¢i”	&B$^]ÎbI;¥x©,‡­æuRÄöiðç¦Üä¢àρ|#&Dj=w•ë[g®#j¹©x ÌÇøP‰š[V¨È|[ãN¬ÜÝu Y,g£¬9îÍ0‚¹ñ>¬ä÷Qm;–“|9Ã-’#&¼úÉÔ¹1îc-âägØÄLËæß¹5¡ƒ[1°ÏÁ”ÍÖ´Hò°[V‘u©Èx¢­Êøïˆ-Œ±<G·m+,F\©´Ý±ÊXÊŽfq¨­|4cç•ÏËà|8ÏÚlÁà‘°möfî2Äh±Ô¼F<g¿Y‰þdV.‚ÂÔZE¹)Æùô“…oÅ\^å~Xîóù_ÝC^û Ûõꐋ½˜:›^©ž÷#*àƒ¶CëlÏ»ÆÆÛŠ&sÝ­{½9Ùƒ'ºŠPi/ÌfD%iKÖØ㤹ÿ{¼ËÍÁ5p9˜—pa§óBd|;‰* “;žQ”BÕ´R#ÃeÝ­Ú@÷Äý\†±ñE“HER³”D‘$u¼3ŨŸX<ê`ÂéÑ÷»ÍÏ«ëàwܘº,!Ji­†0+U•6ŽŽžœRvC×[8GP#´îx­}rJ§iú’XÔïÌé“W?¾<~Ú€OìTw }ƒ‚ðßIØ"Õ+FÁ9{]+Tcs‰Ç{ªà^7I³Y¿Q,GÁ¢ÔØ™È5¦ãêw#&ÄŽ?60úþ°Ü¢ f¾ü1åÞ‹ô®ê°”™ôNVÍ¿$k#*ŽØRQo&òá"³»“¦«¦E¼þ<¬Ð¡µíá"ÍÑK­1CÄ³…<™ä(n¥Hª³…zIA×ìø”ÔÂ:[¦31*Õ¡×L´MY"ªQ#*Y¾šÁÅîÎŒ!#*Yaÿï.3td;#&„°DÜ°OÛ6Ç…»®Ò‰ÚF˜|¿#&½pt_Ct¨3ü*dB“¿¶BR‚;Ã3†QS3ÜEAPCÒp…£†H£‘T:c+Ö;óΖ“Àb‘&ž‚¶b¹”}¥¤}âoKÅ*\æ–‹ÍöD> ²?Ó¬q9ò)ÿ²‚ÅÂýØŸõÿèûÿÞþ£òý²7÷ÿÏ7þ·ùåÂpú‚ ë@‡-îÍã‹ÕjÍ¥ŸbnZÓh\„ú^€O1³Qo»{Œ.ѯ/Þ#&'a‘o}™'8bÓ>˜f¬îJ¾³áÆpÄE£‚Éõjå›\“û~LuÆÍlr#&ßK&× V0¹ææ"²Z9_„ˆý46×P&ò˨®q·Žà>rdºÖÄ‘ì™øGSÞÌ}‚Œnïñd°ç¾/ €xØ¸évBÞ½ˆ		´š<‘â%Œb…Ú)ão½ùÌuŠ^¦6y¥„1¬¦ó!°Úf&·|3×-Ï|–⌌p©Ç›ž*ý_>=ù¿‰þïóí·Eú¿ûèá†þÿÑÿ[Ó~X€îÕ¥_A5;!€¤À]ã_r¬Šäó¨êý¥_A	û‘w=&ª–*/=é÷?WÖïFɽŽƒ&³•m¤â|q}rüý›ÑÓaغ0|àÕ}Ž9óù¾ÍM_½<JàW+IyýãkJ@äÞ[SžÛæ‘<âÕk,Ñ:Ùvn·±ÐK)”þáwðè’K•b¢ªWU‰q¥ºUÇiº§&ýÕëÃ×'GU%lNe¹—:õ/£¸5'™Év1ä‰EûW—$KÒOXÿÓ×?¿T©¶eŜޜžr®Êj±CȾH•ý#Ž¶ól¾É8(÷ršVò“‚q½B…Ï_œáÜ>Á¿]U¨äG25Á¿Ùj†¾—¼"ªFø¹·ó©Ôk\ø{XÃbf©|/\ÿB‹$Ò	¸}½„ÞÜþ.í!+×ö\´¨Tç&*2(€l½ãbmŸ7cÏÿ‡óÁ¬7_\?8-‡ƒOÊÜtÿÛƒ<ÿü´ûð›ÍùÿÙêT¾ó’Á ½y‘ík>DíÔšÀ¢Æ,, ¨§ñæäɇ ÕZÓ€´7Š^5 óRröŠ9FµC¬`9Ô/+Ó*#&r…DG8Vëë§à¹Šß}3yô€ý²2ó’3+ló¹WX"î Š %®K¥Œµ°Œ5à JQAØR©€B‹#*h#*ŠºÈåç£ÅU˼I0Gô]HîtÃVËD$AõøÑÞ챺×?—kÛ²+ Æë|FMjâæÊö?âþgéÿÙtŠvIýßûöQIþ÷h÷ÛÍýïs½ÿÑ‹k|1šžÑƒ¹ƒª¼ŠKµ¾7ŒÑTÙ#”óU­DË’üÉ‘ÔÉ}B:äñc•FÀŒ†PäÇ[ÃÉ"@Mæf¼òÅàà 'EðÝwÁ÷ÏŸ;KL \ É£?HÅu$ÚqV÷±|ö{#“0-ü„üùÆ!¯¤'òT.ؤé>F•è°ªDÀl~u·äšðì9Á(Iæž Yß?ýSžM—6éù³Ó¿xÔ7%†¹.zڍOø÷_;)þÿç_÷у€²#*,–ðx! ½³a)³“_\f“îŽAƒ¼v¶(Á5{ýþogÓùœß yú[ÿÝoƒqÿ·Aoþn8ùí²/gèZð·!JJ»º#&W¿½íÿ6¾x÷ÛBn¾œüö¶‡G¬k4¯ôRe³ëÎnëß»ï÷?|%Ä­Þ(iR[6ˆMé©ŽíSBójGàšîp=àÓ$š«@ùÝò%p© 	d$T^1LÄ[{éÃoªß9ŸýÌܦ©YnfU¹édÄTÕDzàづ*Q6c„Ñ/Ȇ’÷œ•‰R€yªûî¡2֐oäPóQÑã>…CÙÝÑÉ{œì¥íw¹9ò;åfÙš EãÞ?¦s£Òõ€ÑBêpâ§nï¹ôÔËÅ£•eó’]ea½=H·í&U@Tô¹Í@%¸X!5>LÏ؃†o‡éÂwàù7zÇeÙ9N²õ¥$ybë™ZFÆCœ ÙnòrH·óÎi÷~¸#& l]„øv<Úø°ÄàŒŸKZÄŒÞL[E‰/qŽšâ"YÛaBÇ<ýp0‚˜Žwr8ÅòXÍ¡'’½X{Ì–XÓ²+läX‡±Øýx<&˜/_nm‰»ÒÚ³ÄF¶`óêr÷:Ê)ÈAJ c˜ÀoòIO¥šåiŽ–1Mü*A¶)ãyL²l#&RÌJÞ‡–j‡ÛR!ÇO@²]þ€4!Ѫ„$@žÑ‰´y&ò˜Øº,ùÝý`xÈ”ÿg/Î=H¼7)Ñqä$«ÜIšŽv!M“b¾ï#*Ñ`ÞI\veX <™¸UUeöÈý¡èŽ3DJßpÏ-'f>ð„ä"ÒDiÓ;ƒÛãÞ¢‰³¸Ò;耼waËé¹®¤šk¯,ŸÔu¥høuÙS»¶&7 ªœ=늙5Â¥dŒL|K5ÂF‡#*£w5üR—n\V¤P¦p¹J{0ÅTኤɪµ6K—á–ÛḄø5#&w„¬*êl#&,®&Cê0*㈙(›8z'G§#&ShVû‘3ê»!fYÊôÑj4kOib´ŠYñ·#&zŽáBLnEt_J¯([[¹¬ÂN:R±Ç…W #*Gm å§î»GâE¢M}ÖŽ þ.×mHd\íß]â1K@² cò“pm-zÓáäiM´S™±×j*4øiå ƒfËì„•#&àåå6~ÜÜۍ[{»Q-,õéF(ӐÍ$ ÖÃÙµ	地 Ãx·*›ï2qábTÉûرã&Ôf÷UZ]¡DGŒCO#£Łño¨Âðš5MÐ{šrÐÿEbLW#*ê˜qñ6#*¿lKR`0‹¦S#*ÂáÔÍ€4¢B^!i‰þ.,†ˆ\zæ—÷¼Ù’¸ïáIÊœ¿¡Z#*ÊXå(*µ® ƒâ‚SÞKÌ~kO©îï2I³Œoy¸˜®cjuy™ƒûÔ`öª±:†š¼³è»J$R…>ÅTÒÚ“³È«˜¸«$ánGÒ4@kyi¡‰â²Î ÷œ¶ðåÐ8½JÅ›•~“xq_ at _	÷8Ñç$~—èƒÈ@*“}=‰í«™NŠêi¸cWHÇwä+©‰ï Mk at bÏÄáä ½$B“ðo„ñ=0’©Z—P/¸®v>'N™¨˜FÖ\.í¢D9Dø÷pÇ+…dÜcm}ŠA.å%¥8(|¡`#*ßüQRF†]JU’„È!6è"‡..U&mTL"²)1Ú$~ƒV») O. ÞÐÈSŒO¹Ñç®Áðë#hòz…cWWTŠw§È±èh‹³1¸K3E¶PÆ/ yw%¢‡@tõ6žÄR¹9{B¦ö}Æßlßÿsôk»}?twè¤INL„ϐD¾Á™uÈGP—(’rì).²™ÈŒUu;'# ò•+n/Qa½Þq·/æÓå¬Éùäo'’mîJ@ØDÈا7M]<¥hLÑq¹.#&úXõH<‡™ŽKe±qê{Ïï¾Æ¢MšH~pÏŠ-n8&•oevQé	;ÅÇ‘NÆâ‘q%[lÈ·–y/2ÅþØøkÄtgv§;œt#*O¬ä¿t-†¥hÓÙ<;®T˜	Åñ2͸“•µ8”	C_úͺqS˜1ç›WîncÕpÒ雺`5hBÊCD§Ã³²÷ªJ”ÇS&HGFÇ5	ÇùÛ>´%dt‘Ù)&W_êÓŽž¹Ï’˜Äé=1ÝwÐÔx9›¡{—®[ÑV#&k„;Ç̓€³ã•Å÷p.¾Ç´a8XÖÒñ&e'¬i	 Ó?Ê¡‹®ºuk<H˜(ly‡?d#*t'T@¨-SÕuZÅ%ÕNôxˆH=¼Àa«Qm3J1<Èp4&Wzâ¶.(Æmj\ìì4"«^P¸Þ-Ez/„/Þ`ˆ48Úå òÂ4窐Ï&1+ëØ¿ªkÊÝÂÊÏÍÉ#*0w¨ùÿž°òоÆÝØgV#-1EôÎò\‘lÕÌYh,ÆÔZö·&É0/·¸`7OMºõm]5mwœ·º‰«›97uÚÃèïœ<‡ªbúê;Đ]ŸQtqênDÅ€i#‰Û¨œc\Ikƒ4A²QYÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóÙ|6ŸÍgóù_ýùÿ‹@˜£  
+#<==


Property changes on: branches/talloc/experimental/buildtools/bin/waf-svn
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/compare_config_h3.sh
===================================================================
--- branches/talloc/experimental/buildtools/compare_config_h3.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/compare_config_h3.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# compare the generated config.h from a waf build with existing samba
+# build
+
+grep ^.define bin/default/source3/include/config.h | sort > waf-config.h
+grep ^.define $HOME/samba_old/source3/include/config.h | sort > old-config.h
+
+comm -23 old-config.h waf-config.h
+
+#echo
+#diff -u old-config.h waf-config.h


Property changes on: branches/talloc/experimental/buildtools/compare_config_h3.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/compare_config_h4.sh
===================================================================
--- branches/talloc/experimental/buildtools/compare_config_h4.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/compare_config_h4.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# compare the generated config.h from a waf build with existing samba
+# build
+
+grep ^.define bin/default/source4/include/config.h | sort > waf-config.h
+grep ^.define $HOME/samba_old/source4/include/config.h | sort > old-config.h
+
+comm -23 old-config.h waf-config.h
+
+#echo
+#diff -u old-config.h waf-config.h


Property changes on: branches/talloc/experimental/buildtools/compare_config_h4.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/compare_generated.sh
===================================================================
--- branches/talloc/experimental/buildtools/compare_generated.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/compare_generated.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# compare the generated files from a waf
+
+old_build=$HOME/samba_old
+
+gen_files=$(cd bin/default && find . -type f -name '*.[ch]')
+
+2>&1
+
+strip_file()
+{
+    in_file=$1
+    out_file=$2
+    cat $in_file |
+                   grep -v 'The following definitions come from' |
+		   grep -v 'Automatically generated at' |
+		   grep -v 'Generated from' |
+                   sed 's|/home/tnagy/samba/source4||g' |
+                   sed 's|/home/tnagy/samba/|../|g' |
+                   sed 's|bin/default/source4/||g' |
+                   sed 's|bin/default/|../|g' |
+                   sed 's/define _____/define ___/g' |
+                   sed 's/define __*/define _/g' |
+                   sed 's/define _DEFAULT_/define _/g' |
+                   sed 's/define _SOURCE4_/define ___/g' |
+                   sed 's/define ___/define _/g' |
+                   sed 's/ifndef ___/ifndef _/g' |
+                   sed 's|endif /* ____|endif /* __|g' |
+		   sed s/__DEFAULT_SOURCE4/__/ |
+                   sed s/__DEFAULT_SOURCE4/__/ |
+		   sed s/__DEFAULT/____/  	   > $out_file
+}
+
+compare_file()
+{
+    f=$f
+    bname=$(basename $f)
+    t1=/tmp/$bname.old.$$
+    t2=/tmp/$bname.new.$$
+    strip_file $old_build/$f $t1
+    strip_file bin/default/$f     $t2
+    diff -u -b $t1 $t2 2>&1
+    rm -f $t1 $t2
+}
+
+for f in $gen_files; do
+    compare_file $f
+done
+


Property changes on: branches/talloc/experimental/buildtools/compare_generated.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/compare_install.sh
===================================================================
--- branches/talloc/experimental/buildtools/compare_install.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/compare_install.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+prefix1="$1"
+prefix2="$2"
+
+(cd $prefix1 && find . ) | sort > p1.txt
+(cd $prefix2 && find . ) | sort > p2.txt
+diff -u p[12].txt


Property changes on: branches/talloc/experimental/buildtools/compare_install.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/mktowscript/mklist.txt
===================================================================
--- branches/talloc/experimental/buildtools/mktowscript/mklist.txt	                        (rev 0)
+++ branches/talloc/experimental/buildtools/mktowscript/mklist.txt	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,86 @@
+source4/main.mk
+source4/lib/basic.mk
+pidl/config.mk
+nsswitch/config.mk
+nsswitch/libwbclient/config.mk
+source4/heimdal_build/internal.mk
+source4/lib/ldb-samba/config.mk
+source4/librpc/config.mk
+source4/utils/config.mk
+source4/utils/net/config.mk
+source4/scripting/python/config.mk
+source4/auth/config.mk
+source4/auth/gensec/config.mk
+source4/auth/kerberos/config.mk
+source4/auth/ntlm/config.mk
+source4/auth/credentials/config.mk
+source4/auth/ntlmssp/config.mk
+source4/libnet/config.mk
+source4/nbt_server/config.mk
+source4/wrepl_server/config.mk
+source4/ntvfs/config.mk
+source4/ntvfs/unixuid/config.mk
+source4/ntvfs/sysdep/config.mk
+source4/ntvfs/common/config.mk
+source4/ntvfs/posix/config.mk
+source4/selftest/config.mk
+source4/cldap_server/config.mk
+source4/smb_server/config.mk
+source4/smb_server/smb2/config.mk
+source4/smb_server/smb/config.mk
+source4/smbd/config.mk source4/smbd/process_model.mk
+source4/kdc/config.mk
+source4/dsdb/config.mk
+source4/dsdb/samdb/ldb_modules/config.mk
+source4/web_server/config.mk
+source4/param/config.mk
+source4/winbind/config.mk
+source4/cluster/config.mk
+source4/client/config.mk
+source4/ntptr/config.mk
+source4/rpc_server/config.mk
+source4/libcli/config.mk
+source4/libcli/smb2/config.mk
+source4/libcli/wbclient/config.mk
+source4/libcli/security/config.mk
+source4/libcli/ldap/config.mk
+source4/ntp_signd/config.mk
+source4/torture/config.mk
+source4/torture/smb2/config.mk
+source4/torture/local/config.mk
+source4/torture/drs/config.mk
+source4/torture/winbind/config.mk
+source4/torture/libsmbclient/config.mk
+source4/torture/libnetapi/config.mk
+source4/lib/messaging/config.mk
+source4/lib/events/config.mk
+source4/lib/stream/config.mk
+source4/lib/cmdline/config.mk
+source4/lib/com/config.mk
+source4/lib/registry/config.mk
+source4/lib/wmi/config.mk
+source4/lib/socket/config.mk
+source4/lib/samba3/config.mk
+source4/ldap_server/config.mk
+libgpo/config.mk
+libcli/cldap/config.mk
+libcli/samsync/config.mk
+libcli/nbt/config.mk
+libcli/auth/config.mk
+libcli/drsuapi/config.mk
+libcli/security/config.mk
+libcli/smb/config.mk
+libcli/named_pipe_auth/config.mk
+libcli/ldap/config.mk
+lib/uid_wrapper/config.mk
+lib/crypto/config.mk
+lib/socket_wrapper/config.mk
+lib/util/config.mk
+lib/util/charset/config.mk
+lib/nss_wrapper/config.mk
+lib/tsocket/config.mk
+lib/popt/config.mk
+lib/async_req/config.mk
+lib/tdr/config.mk
+lib/torture/config.mk
+lib/smbconf/config.mk

Added: branches/talloc/experimental/buildtools/mktowscript/mktowscript.pl
===================================================================
--- branches/talloc/experimental/buildtools/mktowscript/mktowscript.pl	                        (rev 0)
+++ branches/talloc/experimental/buildtools/mktowscript/mktowscript.pl	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,451 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Data::Dumper;
+use File::Basename;
+use List::MoreUtils qw(uniq);
+
+my $globals;
+my $dname;
+
+sub read_file($)
+{
+	my $filename = shift;
+	open(CONFIG_MK, "$filename");
+	my @lines = <CONFIG_MK>;
+	close(CONFIG_MK);
+	return @lines;
+}
+
+sub trim($)
+{
+	my $string = shift;
+	$string =~ s/^\s+//;
+	$string =~ s/\s+$//;
+	return $string;
+}
+
+sub strlist($)
+{
+	my $s = shift;
+	$s =~ s/\$\(SHLIBEXT\)/so/g;
+	$s =~ s/\$\(heimdalsrcdir\)/..\/heimdal/g;
+	$s =~ s/\$\(heimdalbuildsrcdir\)/..\/heimdal_build/g;
+	$s =~ s/\$\(nsswitchsrcdir\)/..\/nsswitch/g;
+	$s =~ s/\$\(param_OBJ_FILES\)/..\/pyparam.c/g;
+	$s =~ s/\$\(libclisrcdir\)\///g;
+	$s =~ s/\$\(socketwrappersrcdir\)\///g;
+	$s =~ s/\$\(libcompressionsrcdir\)\///g;
+	$s =~ s/\$\(\w*srcdir\)\///g;
+	$s =~ s/\$\(libgpodir\)\///g;
+	$s =~ s/\:\.o=\.ho//g;
+	$s =~ s/\:\.o=\.d//g;
+
+	# this one doesn't exist?
+	$s =~ s/\bLDAP_ENCODE\b//g;
+
+	# these need to use the library names
+	$s =~ s/\bLIBLDB\b/ldb/g;
+	$s =~ s/\bLDB\b/ldb/g;
+	$s =~ s/\bLIBTALLOC\b/talloc/g;
+	$s =~ s/\bTALLOC\b/talloc/g;
+	$s =~ s/\bLIBTEVENT\b/tevent/g;
+	$s =~ s/\bTEVENT\b/tevent/g;
+	$s =~ s/\bTSOCKET\b/LIBTSOCKET/g;
+	$s =~ s/\bGENSEC\b/gensec/g;
+	$s =~ s/\bLIBTDB\b/tdb/g;
+	$s =~ s/\bRESOLV\b/resolv/g;
+
+	return trim(join(' ', split(/\s+/, $s)));
+}
+
+sub expand_vars($$)
+{
+	my $vars = shift;
+	my $s = shift;
+	foreach my $v (keys %{$vars}) {
+		if ($s =~ /\$\($v\)/) {
+			$s =~ s/\$\($v\)/$vars->{$v}/g;
+			delete($vars->{$v});
+		}
+	}
+	foreach my $v (keys %{$globals}) {
+		if ($s =~ /\$\($v\)/) {
+			$s =~ s/\$\($v\)/$globals->{$v}/g;
+		}
+	}
+	return $s;
+}
+
+sub find_file($)
+{
+	my $f = shift;
+	my $orig = $f;
+
+	if ($f =~ /\$/) {
+		printf(STDERR "bad variable expansion for file $orig in $dname\n");
+		exit(1);
+	}
+
+	my $b = basename($f);
+	return $b if (-e $b);
+
+	return $f if (-e $f);
+
+	while ($f =~ /\//) {
+		$f =~ s/^[^\/]+\///g;
+		return $f if (-e $f);
+	}
+	my $f2;
+	$f2 = `find . -name "$f" -type f`;
+	return $f2 unless ($f2 eq "");
+	$f2 = `find .. -name "$f" -type f`;
+	return $f2 unless ($f2 eq "");
+	$f2 = `find ../.. -name "$f" -type f`;
+	return $f2 unless ($f2 eq "");
+	$f2 = `find ../../.. -name "$f" -type f`;
+	return $f2 unless ($f2 eq "");
+	printf(STDERR "Failed to find $orig in $dname\n");
+	exit(1);
+	return '';
+}
+
+sub find_files($)
+{
+	my $list = shift;
+	my $ret = '';
+	foreach my $f (split(/\s+/, $list)) {
+		if ($f =~ /\.[0-9]$/) {
+			# a man page
+			my $m = find_file($f . ".xml");
+			die("Unable to find man page $f\n") if ($m eq "");
+			$m =~ s/\.xml$//;
+			return $m;
+		}
+		$f = find_file($f);
+		$f =~ s/^[.]\///;
+		$ret .= ' ' . $f;
+	}
+	$ret = strlist($ret);
+	my @list = split(/\s+/, $ret);
+	@list = uniq(@list);
+	$ret = trim(join(' ', @list));
+	return $ret;
+}
+
+sub read_config_mk($)
+{
+	my $filename = shift;
+	my @lines = read_file($filename);
+	my $prev = "";
+	my $linenum = 1;
+	my $section = "GLOBAL";
+	my $infragment;
+	my $result;
+	my $line = "";
+	my $secnumber = 1;
+
+	$result->{"GLOBAL"}->{SECNUMBER} = $secnumber++;
+
+	foreach (@lines) {
+		$linenum++;
+
+		# lines beginning with '#' are ignored
+		next if (/^\#.*$/);
+
+		if (/^(.*)\\$/) {
+			$prev .= $1;
+			next;
+		} else {
+			$line = "$prev$_";
+			$prev = "";
+		}
+
+		if ($line =~ /^mkinclude.*asn1_deps.pl\s+([^\s]+)\s+([^\s]+)\s+\\\$\\\(\w+\\\)\/([^\s|]+)\s*([^|]*)\|$/) {
+			my $src = $1;
+			$section = $2;
+			my $dir = $3;
+			my $options = $4;
+			$section = "HEIMDAL_" . uc($section);
+			$result->{$section}->{TYPE} = 'ASN1';
+			$result->{$section}->{SECNUMBER} = $secnumber++;
+			if ($options ne '') {
+				$result->{$section}->{OPTIONS} = $options;
+			}
+			$result->{$section}->{DIRECTORY} = $dir;
+			$result->{$section}->{$section . '_OBJ_FILES'} = $src;
+			next;
+		}
+
+		if ($line =~ /^mkinclude.*et_deps.pl\s+([^\s]+)\s+\\\$\\\(\w+\\\)\/([^\s|]+)\|$/) {
+			my $src = $1;
+			my $dir = $2;
+			$section = basename($src);
+			$section =~ s/\./_/g;
+			$section = "HEIMDAL_" . uc($section);
+			$result->{$section}->{TYPE} = 'ERRTABLE';
+			$result->{$section}->{SECNUMBER} = $secnumber++;
+			$result->{$section}->{DIRECTORY} = "$dir";
+			$result->{$section}->{$section . '_OBJ_FILES'} = $src;
+			next;
+		}
+
+		if ($line =~ /^\[(\w+)::([\w-]+)\]/)
+		{
+			my $type = $1;
+			$section = $2;
+			$infragment = 0;
+
+			$result->{$section}->{TYPE} = $type;
+			$result->{$section}->{SECNUMBER} = $secnumber++;
+			next;
+		}
+
+		# include
+		if ($line =~ /^mkinclude (.*)$/) {
+			my $subfile = $1;
+			$result->{$subfile}->{TYPE} = 'SUBCONFIG';
+			$result->{$subfile}->{SECNUMBER} = $secnumber++;
+			next;
+		}
+
+		# empty line
+		if ($line =~ /^[ \t]*$/) {
+			next;
+		}
+
+		# global stuff is considered part of the makefile
+		if ($section eq "GLOBAL") {
+			$infragment = 1;
+			next;
+		}
+
+		# Assignment
+		if ($line =~ /^([a-zA-Z0-9_-]+)[\t ]*=(.*)$/) {
+			$result->{$section}->{$1} = expand_vars($result->{$section}, strlist($2));
+			$globals->{$1} = $result->{$section}->{$1};
+			next;
+		}
+
+		# +=
+		if ($line =~ /^([a-zA-Z0-9_-]+)[\t ]*\+=(.*)$/) {
+			if (!$result->{$section}->{$1}) {
+				$result->{$section}->{$1}="";
+			}
+			$result->{$section}->{$1} .= " " . expand_vars($result->{$section}, strlist($2));
+			$globals->{$1} = $result->{$section}->{$1};
+			next;
+		}
+
+		if ($line =~ /\$\(eval.\$\(call.proto_header_template.*,(.*),.*/) {
+			$result->{$section}->{AUTOPROTO} = $1;
+		}
+		if ($line =~ /^\$\(eval/) {
+			# skip eval lines for now
+			next;
+		}
+
+		printf(STDERR "$linenum: Bad line: $line");
+	}
+
+	return $result;
+}
+
+
+sub process_results($)
+{
+	my $result = shift;
+
+	foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}} keys %{$result}) {
+		next if ($s eq "GLOBAL");
+		my $sec = $result->{$s};
+		if ($sec->{TYPE} eq "SUBCONFIG") {
+			my $d = dirname($s);
+			next if ($d eq ".");
+			printf "bld.BUILD_SUBDIR('%s')\n", dirname($s);
+		} else {
+			printf "\nbld.SAMBA_%s('%s'", $sec->{TYPE}, $s;
+			my $trailer="";
+			my $got_src = 0;
+			my $got_private_deps = 0;
+
+			foreach my $k (keys %{$sec}) {
+				#print "key=$k\n";
+
+				next if ($k eq "SECNUMBER");
+				next if ($k eq "TYPE");
+				if ($k eq "INIT_FUNCTION") {
+					$trailer .= sprintf(",\n\tinit_function='%s'", trim($sec->{$k}));
+					next;
+				}
+				if ($k eq "INIT_FUNCTION_SENTINEL") {
+					$trailer .= sprintf(",\n\tinit_function_sentinal='%s'", trim($sec->{$k}));
+					next;
+				}
+				if ($k eq "_PY_FILES" ||
+				    $k eq "EPYDOC_OPTIONS" ||
+				    $k eq "COV_TARGET" ||
+				    $k eq "GCOV" ||
+				    $k eq "PC_FILES" ||
+				    $k eq "CONFIG4FILE" ||
+				    $k eq "LMHOSTSFILE4") {
+					$trailer .= sprintf(",\n\t# %s='%s'", $k, trim($sec->{$k}));
+					next;
+				}
+				if ($k eq "SUBSYSTEM") {
+					$trailer .= sprintf(",\n\tsubsystem='%s'", trim($sec->{$k}));
+					next;
+				}
+				if ($k eq "PRIVATE_DEPENDENCIES") {
+					$trailer .= sprintf(",\n\tdeps='%s'", strlist($sec->{$k}));
+					$got_private_deps = 1;
+					next;
+				}
+				if ($k eq "PUBLIC_DEPENDENCIES") {
+					$trailer .= sprintf(",\n\tpublic_deps='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "ALIASES") {
+					$trailer .= sprintf(",\n\taliases='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "CFLAGS") {
+					$trailer .= sprintf(",\n\tcflags='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "OPTIONS") {
+					$trailer .= sprintf(",\n\toptions='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "DIRECTORY") {
+					$trailer .= sprintf(",\n\tdirectory='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "LDFLAGS") {
+					$trailer .= sprintf(",\n\tldflags='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "INSTALLDIR") {
+					$trailer .= sprintf(",\n\tinstalldir='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "ASN1C") {
+					$trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "ET_COMPILER") {
+					$trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "ENABLE") {
+					my $v = strlist($sec->{$k});
+					if ($v eq "NO") {
+						$trailer .= sprintf(",\n\tenabled=False");
+						next;
+					}
+					next if ($v eq "YES");
+					die("Unknown ENABLE value $v in $s\n");
+				}
+				if ($k eq "USE_HOSTCC") {
+					my $v = strlist($sec->{$k});
+					if ($v eq "YES") {
+						$trailer .= sprintf(",\n\tuse_hostcc=True");
+						next;
+					}
+					next if ($v eq "NO");
+					die("Unknown HOST_CC value $v in $s\n");
+				}
+				if ($k eq "$s" . "_VERSION") {
+					$trailer .= sprintf(",\n\tvnum='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "$s" . "_SOVERSION") {
+					next;
+				}
+				if ($k eq "LIBRARY_REALNAME") {
+					$trailer .= sprintf(",\n\trealname='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "OUTPUT_TYPE") {
+					$trailer .= sprintf(",\n\toutput_type='%s'", strlist($sec->{$k}));
+					next;
+				}
+				if ($k eq "AUTOPROTO") {
+					my $list = trim(find_files(strlist($sec->{$k})));
+					$trailer .= sprintf(",\n\tautoproto='%s'", $list);
+					next;
+				}
+				if ($k eq "PUBLIC_HEADERS") {
+					my $list = trim(strlist($sec->{$k}));
+					if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
+						$list = trim("$1 $2");
+						$list = find_files($list);
+					} else {
+						$list = trim(find_files(strlist($sec->{$k})));
+					}
+					$trailer .= sprintf(",\n\tpublic_headers='%s'", $list);
+					next;
+				}
+				if ($k eq "MANPAGES") {
+					my $list = trim(find_files(strlist($sec->{$k})));
+					$trailer .= sprintf(",\n\tmanpages='%s'", $list);
+					next;
+				}
+				if ($k eq "$s" . "_OBJ_FILES") {
+					my $list = trim(strlist($sec->{$k}));
+					$list =~ s/\.o/.c/g;
+					$list =~ s/\.ho/.c/g;
+					if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
+						$list = trim("$1 $2");
+						$list = find_files($list);
+						$list = "'$list'";
+					} elsif ($list =~ /\$\(addprefix \$\((\w+)\)(.*),(.*)\)(.*)$/) {
+						my $src = trim($3);
+						my $dir = "$1$2";
+						$dir =~ s/\/$//;
+						my $res = "bld.SUBDIR('$dir', '$src')";
+						if ($4) {
+							$res = "$res + '$4'";
+						}
+						$list = $res;
+					} else {
+						$list = find_files($list);
+						$list="'$list'";
+					}
+					$list =~ s/\$\(\w+srcdir\)\///g;
+					printf(",\n\tsource=%s", $list);
+					$got_src = 1;
+					next;
+				}
+				if ($k eq "HEIMDAL_GSSAPI_KRB5_OBJ_FILES" ||
+				    $k eq "HEIMDAL_GSSAPI_SPNEGO_OBJ_FILES" ||
+				    $k eq "HEIMDAL_HEIM_ASN1_DER_OBJ_FILES" ||
+				    $k eq "HEIMDAL_HX509_OBJH_FILES" ||
+				    $k eq "HEIMDAL_HX509_OBJG_FILES" ||
+				    $k eq "HEIMDAL_ROKEN_OBJ_FILES"
+				    ) {
+					next;
+				}
+				die("Unknown keyword $k in $s\n");
+			}
+			die("No source list in $s\n") unless $got_src or $got_private_deps;
+			if (! $got_src) {
+				printf(",source=''\n\t");
+			}
+			printf("%s\n\t)\n\n", $trailer);
+		}
+	}
+}
+
+for (my $i=0; $i <= $#ARGV; $i++) {
+	my $filename=$ARGV[$i];
+	$dname=dirname($filename);
+	my $result = read_config_mk($filename);
+	if ($i != 0) {
+		print "\n\n\n";
+	}
+	print "# AUTOGENERATED by mktowscript.pl from $filename\n# Please remove this notice if hand editing\n\n";
+	die("Unable to chdir to $dname\n") unless chdir($dname);
+	process_results($result);
+}
+


Property changes on: branches/talloc/experimental/buildtools/mktowscript/mktowscript.pl
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/mktowscript/rebuild_all.sh
===================================================================
--- branches/talloc/experimental/buildtools/mktowscript/rebuild_all.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/mktowscript/rebuild_all.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+cat mklist.txt |
+while read line; do
+    ws=""
+    list=""
+    for f in $line; do
+	echo "Processing $f"
+	f="../../$f"
+	test -f $f || {
+	    echo "$f doesn't exist"
+	    exit 1
+	}
+	ws="$(dirname $f)/wscript_build"
+	if [ -f $ws ]; then
+	    if test -s $ws && ! grep "AUTOGENERATED.by.mktowscript" $ws > /dev/null; then
+		echo "Skipping manually edited file $ws"
+		continue
+	    fi
+	fi
+	list="$list $f"
+    done
+    if [ "$list" = "" ]; then
+	continue
+    fi
+    ./mktowscript.pl $list > wscript_build.$$ || {
+	echo "Failed on $f"
+	rm -f wscript_build.$$
+	exit 1
+    }
+    if cmp wscript_build.$$ $ws > /dev/null 2>&1; then
+	rm -f wscript_build.$$
+    else
+	mv wscript_build.$$ $ws || exit 1
+    fi
+    #exit 1
+done


Property changes on: branches/talloc/experimental/buildtools/mktowscript/rebuild_all.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/scripts/Makefile.waf
===================================================================
--- branches/talloc/experimental/buildtools/scripts/Makefile.waf	                        (rev 0)
+++ branches/talloc/experimental/buildtools/scripts/Makefile.waf	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,60 @@
+# simple makefile wrapper to run waf
+
+WAF=WAF_MAKE=1 BUILDTOOLS/bin/waf
+
+all:
+	$(WAF) build
+
+install:
+	$(WAF) install
+
+uninstall:
+	$(WAF) uninstall
+
+test:
+	$(WAF) test
+
+testenv:
+	$(WAF) test --testenv
+
+quicktest:
+	$(WAF) test --quick
+
+dist:
+	$(WAF) dist
+
+distcheck:
+	$(WAF) distcheck
+
+clean:
+	$(WAF) clean
+
+distclean:
+	$(WAF) distclean
+
+reconfigure: configure
+	$(WAF) reconfigure
+
+# some compatibility make targets
+everything: all
+
+testsuite: all
+
+check: test
+
+torture: all
+
+# this should do an install as well, once install is finished
+installcheck: test
+
+etags:
+	$(WAF) etags
+
+ctags:
+	$(WAF) ctags
+
+configure: autogen-waf.sh BUILDTOOLS/scripts/configure.waf
+	./autogen-waf.sh
+
+Makefile: autogen-waf.sh configure BUILDTOOLS/scripts/Makefile.waf
+	./autogen-waf.sh

Added: branches/talloc/experimental/buildtools/scripts/abi_gen.sh
===================================================================
--- branches/talloc/experimental/buildtools/scripts/abi_gen.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/scripts/abi_gen.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,20 @@
+#!/bin/sh
+# generate a set of ABI signatures from a shared library
+
+SHAREDLIB="$1"
+
+GDBSCRIPT="gdb_syms.$$"
+
+(
+cat <<EOF
+set height 0
+set width 0
+EOF
+nm $SHAREDLIB | cut -d' ' -f2- | egrep '^[BDGTRVW]' | grep -v @ | cut -c3- | sort | while read s; do
+    echo "echo $s: "
+    echo p $s
+done
+) > $GDBSCRIPT
+
+gdb -batch -x $GDBSCRIPT $SHAREDLIB < /dev/null
+rm -f $GDBSCRIPT


Property changes on: branches/talloc/experimental/buildtools/scripts/abi_gen.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/scripts/autogen-waf.sh
===================================================================
--- branches/talloc/experimental/buildtools/scripts/autogen-waf.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/scripts/autogen-waf.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+p=`dirname $0`
+
+echo "Setting up for waf build"
+
+echo "Looking for the buildtools directory"
+
+d="buildtools"
+while test \! -d "$p/$d"; do d="../$d"; done
+
+echo "Found buildtools in $p/$d"
+
+echo "Setting up configure"
+rm -f $p/configure $p/include/config*.h*
+sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure
+chmod +x $p/configure
+
+echo "Setting up Makefile"
+rm -f $p/makefile $p/Makefile
+sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile
+
+echo "done. Now run $p/configure or $p/configure.developer then make."
+if [ $p != "." ]; then
+	echo "Notice: The build invoke path is not 'source4'! Use make with the parameter"
+	echo "-C <'source4' path>. Example: make -C source4 all"
+fi


Property changes on: branches/talloc/experimental/buildtools/scripts/autogen-waf.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/scripts/configure.waf
===================================================================
--- branches/talloc/experimental/buildtools/scripts/configure.waf	                        (rev 0)
+++ branches/talloc/experimental/buildtools/scripts/configure.waf	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+PREVPATH=`dirname $0`
+
+WAF=BUILDTOOLS/bin/waf
+
+# using JOBS=1 gives maximum compatibility with
+# systems like AIX which have broken threading in python
+JOBS=1
+export JOBS
+
+cd BUILDPATH || exit 1
+$WAF configure "$@" || exit 1
+cd $PREVPATH


Property changes on: branches/talloc/experimental/buildtools/scripts/configure.waf
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/testwaf.sh
===================================================================
--- branches/talloc/experimental/buildtools/testwaf.sh	                        (rev 0)
+++ branches/talloc/experimental/buildtools/testwaf.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+set -e
+set -x
+
+d=$(dirname $0)
+
+cd $d/..
+PREFIX=$HOME/testprefix
+
+if [ $# -gt 0 ]; then
+    tests="$*"
+else
+    tests="lib/replace lib/talloc lib/tevent lib/tdb source4/lib/ldb"
+fi
+
+echo "testing in dirs $tests"
+
+for d in $tests; do
+    echo "`date`: testing $d"
+    pushd $d
+    rm -rf bin
+    type waf
+    ./autogen-waf.sh
+    waf dist
+    ./configure -C --enable-developer --prefix=$PREFIX
+    time make
+    make install
+    make distcheck
+    case $d in
+	"source4/lib/ldb")
+	    ldd bin/ldbadd
+	    ;;
+	"lib/replace")
+	    ldd bin/replace_testsuite
+	    ;;
+	"lib/talloc")
+	    ldd bin/talloc_testsuite
+	    ;;
+	"lib/tdb")
+	    ldd bin/tdbtool
+	    ;;
+    esac
+    popd
+done
+
+echo "testing python portability"
+pushd lib/talloc
+versions="python2.4 python2.5 python2.6 python3.0 python3.1"
+for p in $versions; do
+    ret=$(which $p || echo "failed")
+    if [ $ret == "failed" ]; then
+        echo "$p not found, skipping"
+        continue
+    fi
+    echo "Testing $p"
+    $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX
+    $p ../../buildtools/bin/waf build install
+done
+popd
+
+echo "testing cross compiling"
+pushd lib/talloc
+ret=$(which arm-linux-gnueabi-gcc || echo "failed")
+if [ $ret != "failed" ]; then
+    CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX  --cross-compile --cross-execute='runarm'
+    make && make install
+else
+    echo "Cross-compiler not installed, skipping test"
+fi
+popd


Property changes on: branches/talloc/experimental/buildtools/testwaf.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/buildtools/wafsamba/README
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/README	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/README	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,8 @@
+This is a set of waf 'tools' to help make building the Samba
+components easier, by having common functions in one place. This gives
+us a more consistent build, and ensures that our project rules are
+obeyed
+
+
+TODO:
+	see http://wiki.samba.org/index.php/Waf

Added: branches/talloc/experimental/buildtools/wafsamba/gccdeps.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/gccdeps.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/gccdeps.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,128 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2008-2010 (ita)
+
+"""
+Execute the tasks with gcc -MD, read the dependencies from the .d file
+and prepare the dependency calculation for the next run
+"""
+
+import os, re, threading
+import Task, Logs, Utils, preproc
+from TaskGen import before, after, feature
+
+lock = threading.Lock()
+
+preprocessor_flag = '-MD'
+
+ at feature('cc')
+ at before('apply_core')
+def add_mmd_cc(self):
+	if self.env.get_flat('CCFLAGS').find(preprocessor_flag) < 0:
+		self.env.append_value('CCFLAGS', preprocessor_flag)
+
+ at feature('cxx')
+ at before('apply_core')
+def add_mmd_cxx(self):
+	if self.env.get_flat('CXXFLAGS').find(preprocessor_flag) < 0:
+		self.env.append_value('CXXFLAGS', preprocessor_flag)
+
+def scan(self):
+	"the scanner does not do anything initially"
+	nodes = self.generator.bld.node_deps.get(self.unique_id(), [])
+	names = []
+	return (nodes, names)
+
+re_o = re.compile("\.o$")
+re_src = re.compile("^(\.\.)[\\/](.*)$")
+
+def post_run(self):
+	# The following code is executed by threads, it is not safe, so a lock is needed...
+
+	if getattr(self, 'cached', None):
+		return Task.Task.post_run(self)
+
+	name = self.outputs[0].abspath(self.env)
+	name = re_o.sub('.d', name)
+	txt = Utils.readf(name)
+	#os.unlink(name)
+
+	txt = txt.replace('\\\n', '')
+
+	lst = txt.strip().split(':')
+	val = ":".join(lst[1:])
+	val = val.split()
+
+	nodes = []
+	bld = self.generator.bld
+
+	f = re.compile("^("+self.env.variant()+"|\.\.)[\\/](.*)$")
+	for x in val:
+		if os.path.isabs(x):
+
+			if not preproc.go_absolute:
+				continue
+
+			lock.acquire()
+			try:
+				node = bld.root.find_resource(x)
+			finally:
+				lock.release()
+		else:
+			g = re.search(re_src, x)
+			if g:
+				x = g.group(2)
+				lock.acquire()
+				try:
+					node = bld.bldnode.parent.find_resource(x)
+				finally:
+					lock.release()
+			else:
+				g = re.search(f, x)
+				if g:
+					x = g.group(2)
+					lock.acquire()
+					try:
+						node = bld.srcnode.find_resource(x)
+					finally:
+						lock.release()
+
+		if id(node) == id(self.inputs[0]):
+			# ignore the source file, it is already in the dependencies
+			# this way, successful config tests may be retrieved from the cache
+			continue
+
+		if not node:
+			raise ValueError('could not find %r for %r' % (x, self))
+		else:
+			nodes.append(node)
+
+	Logs.debug('deps: real scanner for %s returned %s' % (str(self), str(nodes)))
+
+	bld.node_deps[self.unique_id()] = nodes
+	bld.raw_deps[self.unique_id()] = []
+
+	try:
+		del self.cache_sig
+	except:
+		pass
+
+	Task.Task.post_run(self)
+
+import Constants, Utils
+def sig_implicit_deps(self):
+	try:
+		return Task.Task.sig_implicit_deps(self)
+	except Utils.WafError:
+		return Constants.SIG_NIL
+
+for name in 'cc cxx'.split():
+	try:
+		cls = Task.TaskBase.classes[name]
+	except KeyError:
+		pass
+	else:
+		cls.post_run = post_run
+		cls.scan = scan
+		cls.sig_implicit_deps = sig_implicit_deps
+

Added: branches/talloc/experimental/buildtools/wafsamba/generic_cc.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/generic_cc.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/generic_cc.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,71 @@
+
+# compiler definition for a generic C compiler
+# based on suncc.py from waf
+
+import os, optparse
+import Utils, Options, Configure
+import ccroot, ar
+from Configure import conftest
+
+from compiler_cc import c_compiler
+
+c_compiler['default'] = ['gcc', 'generic_cc']
+c_compiler['hpux'] = ['gcc', 'generic_cc']
+
+ at conftest
+def find_generic_cc(conf):
+	v = conf.env
+	cc = None
+	if v['CC']: cc = v['CC']
+	elif 'CC' in conf.environ: cc = conf.environ['CC']
+	if not cc: cc = conf.find_program('cc', var='CC')
+	if not cc: conf.fatal('generic_cc was not found')
+	cc = conf.cmd_to_list(cc)
+	v['CC']  = cc
+	v['CC_NAME'] = 'generic'
+
+ at conftest
+def generic_cc_common_flags(conf):
+	v = conf.env
+
+	v['CC_SRC_F']            = ''
+	v['CC_TGT_F']            = ['-c', '-o', '']
+	v['CPPPATH_ST']          = '-I%s' # template for adding include paths
+
+	# linker
+	if not v['LINK_CC']: v['LINK_CC'] = v['CC']
+	v['CCLNK_SRC_F']         = ''
+	v['CCLNK_TGT_F']         = ['-o', '']
+
+	v['LIB_ST']              = '-l%s' # template for adding libs
+	v['LIBPATH_ST']          = '-L%s' # template for adding libpaths
+	v['STATICLIB_ST']        = '-l%s'
+	v['STATICLIBPATH_ST']    = '-L%s'
+	v['CCDEFINES_ST']        = '-D%s'
+
+#	v['SONAME_ST']           = '-Wl,-h -Wl,%s'
+#	v['SHLIB_MARKER']        = '-Bdynamic'
+#	v['STATICLIB_MARKER']    = '-Bstatic'
+
+	# program
+	v['program_PATTERN']     = '%s'
+
+	# shared library
+#	v['shlib_CCFLAGS']       = ['-Kpic', '-DPIC']
+#	v['shlib_LINKFLAGS']     = ['-G']
+	v['shlib_PATTERN']       = 'lib%s.so'
+
+	# static lib
+#	v['staticlib_LINKFLAGS'] = ['-Bstatic']
+#	v['staticlib_PATTERN']   = 'lib%s.a'
+
+detect = '''
+find_generic_cc
+find_cpp
+find_ar
+generic_cc_common_flags
+cc_load_tools
+cc_add_flags
+link_add_flags
+'''
+

Added: branches/talloc/experimental/buildtools/wafsamba/irixcc.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/irixcc.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/irixcc.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,77 @@
+
+# compiler definition for irix/MIPSpro cc compiler
+# based on suncc.py from waf
+
+import os, optparse
+import Utils, Options, Configure
+import ccroot, ar
+from Configure import conftest
+
+from compiler_cc import c_compiler
+
+c_compiler['irix'] = ['gcc', 'irixcc']
+
+ at conftest
+def find_irixcc(conf):
+	v = conf.env
+	cc = None
+	if v['CC']: cc = v['CC']
+	elif 'CC' in conf.environ: cc = conf.environ['CC']
+	if not cc: cc = conf.find_program('cc', var='CC')
+	if not cc: conf.fatal('irixcc was not found')
+	cc = conf.cmd_to_list(cc)
+
+	try:
+		if Utils.cmd_output(cc + ['-version']) != '':
+			conf.fatal('irixcc %r was not found' % cc)
+	except ValueError:
+		conf.fatal('irixcc -v could not be executed')
+
+	v['CC']  = cc
+	v['CC_NAME'] = 'irix'
+
+ at conftest
+def irixcc_common_flags(conf):
+	v = conf.env
+
+	v['CC_SRC_F']            = ''
+	v['CC_TGT_F']            = ['-c', '-o', '']
+	v['CPPPATH_ST']          = '-I%s' # template for adding include paths
+
+	# linker
+	if not v['LINK_CC']: v['LINK_CC'] = v['CC']
+	v['CCLNK_SRC_F']         = ''
+	v['CCLNK_TGT_F']         = ['-o', '']
+
+	v['LIB_ST']              = '-l%s' # template for adding libs
+	v['LIBPATH_ST']          = '-L%s' # template for adding libpaths
+	v['STATICLIB_ST']        = '-l%s'
+	v['STATICLIBPATH_ST']    = '-L%s'
+	v['CCDEFINES_ST']        = '-D%s'
+
+#	v['SONAME_ST']           = '-Wl,-h -Wl,%s'
+#	v['SHLIB_MARKER']        = '-Bdynamic'
+#	v['STATICLIB_MARKER']    = '-Bstatic'
+
+	# program
+	v['program_PATTERN']     = '%s'
+
+	# shared library
+#	v['shlib_CCFLAGS']       = ['-Kpic', '-DPIC']
+#	v['shlib_LINKFLAGS']     = ['-G']
+	v['shlib_PATTERN']       = 'lib%s.so'
+
+	# static lib
+#	v['staticlib_LINKFLAGS'] = ['-Bstatic']
+#	v['staticlib_PATTERN']   = 'lib%s.a'
+
+detect = '''
+find_irixcc
+find_cpp
+find_ar
+irixcc_common_flags
+cc_load_tools
+cc_add_flags
+link_add_flags
+'''
+

Added: branches/talloc/experimental/buildtools/wafsamba/nothreads.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/nothreads.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/nothreads.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,219 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2005-2008 (ita)
+
+# this replaces the core of Runner.py in waf with a varient that works
+# on systems with completely broken threading (such as Python 2.5.x on
+# AIX). For simplicity we enable this when JOBS=1, which is triggered
+# by the compatibility makefile used for the waf build. That also ensures
+# this code is tested, as it means it is used in the build farm, and by
+# anyone using 'make' to build Samba with waf
+
+"Execute the tasks"
+
+import sys, random, time, threading, traceback, os
+try: from Queue import Queue
+except ImportError: from queue import Queue
+import Build, Utils, Logs, Options
+from Logs import debug, error
+from Constants import *
+
+GAP = 15
+
+run_old = threading.Thread.run
+def run(*args, **kwargs):
+	try:
+		run_old(*args, **kwargs)
+	except (KeyboardInterrupt, SystemExit):
+		raise
+	except:
+		sys.excepthook(*sys.exc_info())
+threading.Thread.run = run
+
+
+class TaskConsumer(object):
+	consumers = 1
+
+def process(tsk):
+	m = tsk.master
+	if m.stop:
+		m.out.put(tsk)
+		return
+
+	try:
+		tsk.generator.bld.printout(tsk.display())
+		if tsk.__class__.stat: ret = tsk.__class__.stat(tsk)
+		# actual call to task's run() function
+		else: ret = tsk.call_run()
+	except Exception, e:
+		tsk.err_msg = Utils.ex_stack()
+		tsk.hasrun = EXCEPTION
+
+		# TODO cleanup
+		m.error_handler(tsk)
+		m.out.put(tsk)
+		return
+
+	if ret:
+		tsk.err_code = ret
+		tsk.hasrun = CRASHED
+	else:
+		try:
+			tsk.post_run()
+		except Utils.WafError:
+			pass
+		except Exception:
+			tsk.err_msg = Utils.ex_stack()
+			tsk.hasrun = EXCEPTION
+		else:
+			tsk.hasrun = SUCCESS
+	if tsk.hasrun != SUCCESS:
+		m.error_handler(tsk)
+
+	m.out.put(tsk)
+
+class Parallel(object):
+	"""
+	keep the consumer threads busy, and avoid consuming cpu cycles
+	when no more tasks can be added (end of the build, etc)
+	"""
+	def __init__(self, bld, j=2):
+
+		# number of consumers
+		self.numjobs = j
+
+		self.manager = bld.task_manager
+		self.manager.current_group = 0
+
+		self.total = self.manager.total()
+
+		# tasks waiting to be processed - IMPORTANT
+		self.outstanding = []
+		self.maxjobs = MAXJOBS
+
+		# tasks that are awaiting for another task to complete
+		self.frozen = []
+
+		# tasks returned by the consumers
+		self.out = Queue(0)
+
+		self.count = 0 # tasks not in the producer area
+
+		self.processed = 1 # progress indicator
+
+		self.stop = False # error condition to stop the build
+		self.error = False # error flag
+
+	def get_next(self):
+		"override this method to schedule the tasks in a particular order"
+		if not self.outstanding:
+			return None
+		return self.outstanding.pop(0)
+
+	def postpone(self, tsk):
+		"override this method to schedule the tasks in a particular order"
+		# TODO consider using a deque instead
+		if random.randint(0, 1):
+			self.frozen.insert(0, tsk)
+		else:
+			self.frozen.append(tsk)
+
+	def refill_task_list(self):
+		"called to set the next group of tasks"
+
+		while self.count > self.numjobs + GAP or self.count >= self.maxjobs:
+			self.get_out()
+
+		while not self.outstanding:
+			if self.count:
+				self.get_out()
+
+			if self.frozen:
+				self.outstanding += self.frozen
+				self.frozen = []
+			elif not self.count:
+				(jobs, tmp) = self.manager.get_next_set()
+				if jobs != None: self.maxjobs = jobs
+				if tmp: self.outstanding += tmp
+				break
+
+	def get_out(self):
+		"the tasks that are put to execute are all collected using get_out"
+		ret = self.out.get()
+		self.manager.add_finished(ret)
+		if not self.stop and getattr(ret, 'more_tasks', None):
+			self.outstanding += ret.more_tasks
+			self.total += len(ret.more_tasks)
+		self.count -= 1
+
+	def error_handler(self, tsk):
+		"by default, errors make the build stop (not thread safe so be careful)"
+		if not Options.options.keep:
+			self.stop = True
+		self.error = True
+
+	def start(self):
+		"execute the tasks"
+
+		while not self.stop:
+
+			self.refill_task_list()
+
+			# consider the next task
+			tsk = self.get_next()
+			if not tsk:
+				if self.count:
+					# tasks may add new ones after they are run
+					continue
+				else:
+					# no tasks to run, no tasks running, time to exit
+					break
+
+			if tsk.hasrun:
+				# if the task is marked as "run", just skip it
+				self.processed += 1
+				self.manager.add_finished(tsk)
+				continue
+
+			try:
+				st = tsk.runnable_status()
+			except Exception, e:
+				self.processed += 1
+				if self.stop and not Options.options.keep:
+					tsk.hasrun = SKIPPED
+					self.manager.add_finished(tsk)
+					continue
+				self.error_handler(tsk)
+				self.manager.add_finished(tsk)
+				tsk.hasrun = EXCEPTION
+				tsk.err_msg = Utils.ex_stack()
+				continue
+
+			if st == ASK_LATER:
+				self.postpone(tsk)
+			elif st == SKIP_ME:
+				self.processed += 1
+				tsk.hasrun = SKIPPED
+				self.manager.add_finished(tsk)
+			else:
+				# run me: put the task in ready queue
+				tsk.position = (self.processed, self.total)
+				self.count += 1
+				self.processed += 1
+				tsk.master = self
+
+				process(tsk)
+
+		# self.count represents the tasks that have been made available to the consumer threads
+		# collect all the tasks after an error else the message may be incomplete
+		while self.error and self.count:
+			self.get_out()
+
+		#print loop
+		assert (self.count == 0 or self.stop)
+
+
+# enable nothreads
+import Runner
+Runner.process = process
+Runner.Parallel = Parallel

Added: branches/talloc/experimental/buildtools/wafsamba/samba3.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba3.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba3.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,23 @@
+# a waf tool to add autoconf-like macros to the configure section
+# and for SAMBA_ macros for building libraries, binaries etc
+
+import Options
+from optparse import SUPPRESS_HELP
+
+def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
+                      with_name="with", without_name="without"):
+    if help == ():
+        help = ("Build with %s support" % option)
+    if dest is None:
+        dest = "with_%s" % option.replace('-', '_')
+
+    with_val = "--%s-%s" % (with_name, option)
+    without_val = "--%s-%s" % (without_name, option)
+
+    #FIXME: This is broken and will always default to "default" no matter if
+    # --with or --without is chosen.
+    opt.add_option(with_val, help=help, action="store_true", dest=dest,
+                   default=default)
+    opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
+                   dest=dest)
+Options.Handler.SAMBA3_ADD_OPTION = SAMBA3_ADD_OPTION

Added: branches/talloc/experimental/buildtools/wafsamba/samba_abi.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_abi.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_abi.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,134 @@
+# functions for handling ABI checking of libraries
+
+import Options, Utils, os, Logs, samba_utils, sys, Task, fnmatch, re
+from TaskGen import feature, before, after
+
+# these type maps cope with platform specific names for common types
+# please add new type mappings into the list below
+abi_type_maps = {
+    '_Bool' : 'bool',
+    'struct __va_list_tag *' : 'va_list'
+    }
+
+def normalise_signature(sig):
+    '''normalise a signature from gdb'''
+    sig = sig.strip()
+    sig = re.sub('^\$[0-9]+\s=\s\{*', '', sig)
+    sig = re.sub('\}(\s0x[0-9a-f]+\s<\w+>)?$', '', sig)
+    sig = re.sub('0x[0-9a-f]+', '0xXXXX', sig)
+
+    for t in abi_type_maps:
+        # we need to cope with non-word characters in mapped types
+        m = t
+        m = m.replace('*', '\*')
+        if m[-1].isalnum() or m[-1] == '_':
+            m += '\\b'
+        if m[0].isalnum() or m[0] == '_':
+            m = '\\b' + m
+        sig = re.sub(m, abi_type_maps[t], sig)
+    return sig
+
+def normalise_varargs(sig):
+    '''cope with older versions of gdb'''
+    sig = re.sub(',\s\.\.\.', '', sig)
+    return sig
+
+def parse_sigs(sigs, abi_match):
+    '''parse ABI signatures file'''
+    abi_match = samba_utils.TO_LIST(abi_match)
+    ret = {}
+    a = sigs.split('\n')
+    for s in a:
+        if s.find(':') == -1:
+            continue
+        sa = s.split(':')
+        if abi_match:
+            matched = False
+            for p in abi_match:
+                if p[0] == '!' and fnmatch.fnmatch(sa[0], p[1:]):
+                    break
+                elif fnmatch.fnmatch(sa[0], p):
+                    matched = True
+                    break
+            if not matched:
+                continue
+        ret[sa[0]] = normalise_signature(sa[1])
+    return ret
+
+def save_sigs(sig_file, parsed_sigs):
+    '''save ABI signatures to a file'''
+    sigs = ''
+    for s in sorted(parsed_sigs.keys()):
+        sigs += '%s: %s\n' % (s, parsed_sigs[s])
+    return samba_utils.save_file(sig_file, sigs, create_dir=True)
+
+
+def abi_check_task(self):
+    '''check if the ABI has changed'''
+    abi_gen = self.ABI_GEN
+
+    libpath = self.inputs[0].abspath(self.env)
+    libname = os.path.basename(libpath)
+
+    sigs = Utils.cmd_output([abi_gen, libpath])
+    parsed_sigs = parse_sigs(sigs, self.ABI_MATCH)
+
+    sig_file = self.ABI_FILE
+
+    old_sigs = samba_utils.load_file(sig_file)
+    if old_sigs is None or Options.options.ABI_UPDATE:
+        if not save_sigs(sig_file, parsed_sigs):
+            raise Utils.WafError('Failed to save ABI file "%s"' % sig_file)
+        Logs.warn('Generated ABI signatures %s' % sig_file)
+        return
+
+    parsed_old_sigs = parse_sigs(old_sigs, self.ABI_MATCH)
+
+    # check all old sigs
+    got_error = False
+    for s in parsed_old_sigs:
+        if not s in parsed_sigs:
+            Logs.error('%s: symbol %s has been removed - please update major version\n\tsignature: %s' % (
+                libname, s, parsed_old_sigs[s]))
+            got_error = True
+        elif normalise_varargs(parsed_old_sigs[s]) != normalise_varargs(parsed_sigs[s]):
+            Logs.error('%s: symbol %s has changed - please update major version\n\told_signature: %s\n\tnew_signature: %s' % (
+                libname, s, parsed_old_sigs[s], parsed_sigs[s]))
+            got_error = True
+
+    for s in parsed_sigs:
+        if not s in parsed_old_sigs:
+            Logs.error('%s: symbol %s has been added - please mark it _PRIVATE_ or update minor version\n\tsignature: %s' % (
+                libname, s, parsed_sigs[s]))
+            got_error = True
+
+    if got_error:
+        raise Utils.WafError('ABI for %s has changed - please fix library version then build with --abi-update\nSee http://wiki.samba.org/index.php/Waf#ABI_Checking for more information' % libname)
+
+
+t = Task.task_type_from_func('abi_check', abi_check_task, color='BLUE', ext_in='.bin')
+t.quiet = True
+# allow "waf --abi-check" to force re-checking the ABI
+if '--abi-check' in sys.argv:
+    Task.always_run(t)
+
+ at after('apply_link')
+ at feature('abi_check')
+def abi_check(self):
+    '''check that ABI matches saved signatures'''
+    env = self.bld.env
+    if not env.ABI_CHECK or self.abi_file is None:
+        return
+
+    # if the platform doesn't support -fvisibility=hidden then the ABI
+    # checks become fairly meaningless
+    if not env.HAVE_VISIBILITY_ATTR:
+        return
+
+    topsrc = self.bld.srcnode.abspath()
+    abi_gen = os.path.join(topsrc, 'buildtools/scripts/abi_gen.sh')
+
+    tsk = self.create_task('abi_check', self.link_task.outputs[0])
+    tsk.ABI_FILE = self.abi_file
+    tsk.ABI_MATCH = self.abi_match
+    tsk.ABI_GEN = abi_gen

Added: branches/talloc/experimental/buildtools/wafsamba/samba_asn1.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_asn1.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_asn1.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,109 @@
+# samba ASN1 rules
+
+import Build, os
+from samba_utils import *
+from samba_autoconf import *
+
+
+def SAMBA_ASN1(bld, name, source,
+               options='',
+               directory='',
+               option_file=None,
+               includes=''):
+    '''Build a ASN1 file using the asn1 compiler.
+       This will produce 2 output files'''
+    bname = os.path.basename(source)[0:-5];
+    dname = os.path.dirname(source)
+    asn1name = "%s_asn1" % bname
+
+    if not SET_TARGET_TYPE(bld, name, 'ASN1'):
+        return
+
+    # for ASN1 compilation, I always put it in build_source, as it doesn't make
+    # sense elsewhere
+    bld.SET_BUILD_GROUP('build_source')
+
+    out_files = []
+    out_files.append("../heimdal/%s/asn1_%s_asn1.x" % (directory, bname))
+    out_files.append("../heimdal/%s/%s_asn1.hx" % (directory, bname))
+    out_files.append("../heimdal/%s/%s_asn1-priv.hx" % (directory, bname))
+
+    # the ${TGT[0].parent.abspath(env)} expression gives us the parent directory of
+    # the first target in the build directory
+    # SRC[0].abspath(env) gives the absolute path to the source directory for the first
+    # source file. Note that in the case of a option_file, we have more than
+    # one source file
+    cd_rule = 'cd ${TGT[0].parent.abspath(env)}'
+    asn1_rule = cd_rule + ' && ${BLDBIN}/asn1_compile ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file ${SRC[0].abspath(env)} ${ASN1NAME}'
+
+    source = TO_LIST(source)
+    source.append('asn1_compile')
+
+    if option_file is not None:
+        source.append(option_file)
+
+    t = bld(rule=asn1_rule,
+            ext_out = '.x',
+            before = 'cc',
+            on_results = True,
+            shell = True,
+            source = source,
+            target = out_files,
+            name=name + '_ASN1')
+
+    t.env.ASN1NAME     = asn1name
+    t.env.ASN1OPTIONS  = options
+    t.env.BLDBIN       = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..'))
+    if option_file is not None:
+        t.env.OPTION_FILE = "--option-file=%s" % os.path.normpath(os.path.join(bld.curdir, option_file))
+
+    cfile = out_files[0][0:-2] + '.c'
+    hfile = out_files[1][0:-3] + '.h',
+    hpriv = out_files[2][0:-3] + '.h',
+
+    # now generate a .c file from the .x file
+    t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''',
+            source = out_files[0],
+            target = cfile,
+            shell = True,
+            on_results=True,
+	    ext_out = '.c',
+            ext_in = '.x',
+            depends_on = name + '_ASN1',
+            name = name + '_C')
+
+    # and generate a .h file from the .hx file
+    t = bld(rule='cp ${SRC} ${TGT}',
+            source = out_files[1],
+            ext_out = '.c',
+            ext_in = '.x',
+            on_results=True,
+            target = hfile,
+            depends_on = name + '_ASN1',
+            name = name + '_H')
+
+    # and generate a .h file from the .hx file
+    t = bld(rule='cp ${SRC} ${TGT}',
+            source = out_files[2],
+            ext_out = '.c',
+            ext_in = '.x',
+            on_results=True,
+            target = hpriv,
+            depends_on = name + '_ASN1',
+            name = name + '_PRIV_H')
+
+    bld.SET_BUILD_GROUP('main')
+
+    includes = TO_LIST(includes)
+    includes.append(os.path.dirname(out_files[0]))
+
+    t = bld(features       = 'cc',
+            source         = cfile,
+            target         = name,
+            samba_cflags   = CURRENT_CFLAGS(bld, name, ''),
+            depends_on     = '',
+            samba_deps     = TO_LIST('HEIMDAL_ROKEN'),
+            samba_includes = includes,
+            local_include  = True)
+
+Build.BuildContext.SAMBA_ASN1 = SAMBA_ASN1

Added: branches/talloc/experimental/buildtools/wafsamba/samba_autoconf.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_autoconf.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_autoconf.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,656 @@
+# a waf tool to add autoconf-like macros to the configure section
+
+import Build, os, Options, preproc, Logs
+import string
+from Configure import conf
+from samba_utils import *
+import samba_cross
+
+missing_headers = set()
+
+####################################################
+# some autoconf like helpers, to make the transition
+# to waf a bit easier for those used to autoconf
+# m4 files
+
+ at runonce
+ at conf
+def DEFINE(conf, d, v, add_to_cflags=False, quote=False):
+    '''define a config option'''
+    conf.define(d, v, quote=quote)
+    if add_to_cflags:
+        conf.env.append_value('CCDEFINES', d + '=' + str(v))
+
+def hlist_to_string(conf, headers=None):
+    '''convert a headers list to a set of #include lines'''
+    hdrs=''
+    hlist = conf.env.hlist
+    if headers:
+        hlist = hlist[:]
+        hlist.extend(TO_LIST(headers))
+    for h in hlist:
+        hdrs += '#include <%s>\n' % h
+    return hdrs
+
+
+ at conf
+def COMPOUND_START(conf, msg):
+    '''start a compound test'''
+    def null_check_message_1(self,*k,**kw):
+        return
+    def null_check_message_2(self,*k,**kw):
+        return
+
+    v = getattr(conf.env, 'in_compound', [])
+    if v != [] and v != 0:
+        conf.env.in_compound = v + 1
+        return
+    conf.check_message_1(msg)
+    conf.saved_check_message_1 = conf.check_message_1
+    conf.check_message_1 = null_check_message_1
+    conf.saved_check_message_2 = conf.check_message_2
+    conf.check_message_2 = null_check_message_2
+    conf.env.in_compound = 1
+
+
+ at conf
+def COMPOUND_END(conf, result):
+    '''start a compound test'''
+    conf.env.in_compound -= 1
+    if conf.env.in_compound != 0:
+        return
+    conf.check_message_1 = conf.saved_check_message_1
+    conf.check_message_2 = conf.saved_check_message_2
+    p = conf.check_message_2
+    if result == True:
+        p('ok ')
+    elif result == False:
+        p('not found', 'YELLOW')
+    else:
+        p(result)
+
+
+ at feature('nolink')
+def nolink(self):
+    '''using the nolink type in conf.check() allows us to avoid
+       the link stage of a test, thus speeding it up for tests
+       that where linking is not needed'''
+    pass
+
+
+def CHECK_HEADER(conf, h, add_headers=False, lib=None):
+    '''check for a header'''
+    if h in missing_headers:
+        return False
+    d = h.upper().replace('/', '_')
+    d = d.replace('.', '_')
+    d = 'HAVE_%s' % d
+    if CONFIG_SET(conf, d):
+        if add_headers:
+            if not h in conf.env.hlist:
+                conf.env.hlist.append(h)
+        return True
+
+    (ccflags, ldflags) = library_flags(conf, lib)
+
+    hdrs = hlist_to_string(conf, headers=h)
+    ret = conf.check(fragment='%s\nint main(void) { return 0; }' % hdrs,
+                     type='nolink',
+                     execute=0,
+                     ccflags=ccflags,
+                     msg="Checking for header %s" % h)
+    if not ret:
+        missing_headers.add(h)
+        return False
+
+    conf.DEFINE(d, 1)
+    if add_headers and not h in conf.env.hlist:
+        conf.env.hlist.append(h)
+    return ret
+
+
+ at conf
+def CHECK_HEADERS(conf, headers, add_headers=False, together=False, lib=None):
+    '''check for a list of headers
+
+    when together==True, then the headers accumulate within this test.
+    This is useful for interdependent headers
+    '''
+    ret = True
+    if not add_headers and together:
+        saved_hlist = conf.env.hlist[:]
+        set_add_headers = True
+    else:
+        set_add_headers = add_headers
+    for hdr in TO_LIST(headers):
+        if not CHECK_HEADER(conf, hdr, set_add_headers, lib=lib):
+            ret = False
+    if not add_headers and together:
+        conf.env.hlist = saved_hlist
+    return ret
+
+
+def header_list(conf, headers=None, lib=None):
+    '''form a list of headers which exist, as a string'''
+    hlist=[]
+    if headers is not None:
+        for h in TO_LIST(headers):
+            if CHECK_HEADER(conf, h, add_headers=False, lib=lib):
+                hlist.append(h)
+    return hlist_to_string(conf, headers=hlist)
+
+
+ at conf
+def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg=None):
+    '''check for a single type'''
+    if define is None:
+        define = 'HAVE_' + t.upper().replace(' ', '_')
+    if msg is None:
+        msg='Checking for %s' % t
+    ret = CHECK_CODE(conf, '%s _x' % t,
+                     define,
+                     execute=False,
+                     headers=headers,
+                     local_include=False,
+                     msg=msg,
+                     lib=lib,
+                     link=False)
+    if not ret and alternate:
+        conf.DEFINE(t, alternate)
+    return ret
+
+
+ at conf
+def CHECK_TYPES(conf, list, headers=None, define=None, alternate=None, lib=None):
+    '''check for a list of types'''
+    ret = True
+    for t in TO_LIST(list):
+        if not CHECK_TYPE(conf, t, headers=headers,
+                          define=define, alternate=alternate, lib=lib):
+            ret = False
+    return ret
+
+
+ at conf
+def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None):
+    '''check for a single type with a header'''
+    return CHECK_TYPE(conf, t, headers=headers, alternate=alternate, define=define)
+
+
+ at conf
+def CHECK_VARIABLE(conf, v, define=None, always=False,
+                   headers=None, msg=None, lib=None):
+    '''check for a variable declaration (or define)'''
+    if define is None:
+        define = 'HAVE_%s' % v.upper()
+
+    if msg is None:
+        msg="Checking for variable %s" % v
+
+    return CHECK_CODE(conf,
+                      # we need to make sure the compiler doesn't
+                      # optimize it out...
+                      '''
+                      #ifndef %s
+                      void *_x; _x=(void *)&%s; return (int)_x;
+                      #endif
+                      return 0
+                      ''' % (v, v),
+                      execute=False,
+                      link=False,
+                      msg=msg,
+                      local_include=False,
+                      lib=lib,
+                      headers=headers,
+                      define=define,
+                      always=always)
+
+
+ at conf
+def CHECK_DECLS(conf, vars, reverse=False, headers=None, always=False):
+    '''check a list of variable declarations, using the HAVE_DECL_xxx form
+       of define
+
+       When reverse==True then use HAVE_xxx_DECL instead of HAVE_DECL_xxx
+       '''
+    ret = True
+    for v in TO_LIST(vars):
+        if not reverse:
+            define='HAVE_DECL_%s' % v.upper()
+        else:
+            define='HAVE_%s_DECL' % v.upper()
+        if not CHECK_VARIABLE(conf, v,
+                              define=define,
+                              headers=headers,
+                              msg='Checking for declaration of %s' % v,
+                              always=always):
+            ret = False
+    return ret
+
+
+def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
+    '''check for a function'''
+    define='HAVE_%s' % f.upper()
+
+    ret = False
+
+    conf.COMPOUND_START('Checking for %s' % f)
+
+    if link is None or link == True:
+        ret = CHECK_CODE(conf,
+                         # this is based on the autoconf strategy
+                         '''
+                         #define %s __fake__%s
+                         #ifdef HAVE_LIMITS_H
+                         # include <limits.h>
+                         #else
+                         # include <assert.h>
+                         #endif
+                         #undef %s
+                         #if defined __stub_%s || defined __stub___%s
+                         #error "bad glibc stub"
+                         #endif
+                         extern char %s();
+                         int main() { return %s(); }
+                         ''' % (f, f, f, f, f, f, f),
+                         execute=False,
+                         link=True,
+                         addmain=False,
+                         add_headers=False,
+                         define=define,
+                         local_include=False,
+                         lib=lib,
+                         headers=headers,
+                         msg='Checking for %s' % f)
+
+        if not ret:
+            ret = CHECK_CODE(conf,
+                             # it might be a macro
+                             # we need to make sure the compiler doesn't
+                             # optimize it out...
+                             'void *__x = (void *)%s; return (int)__x' % f,
+                             execute=False,
+                             link=True,
+                             addmain=True,
+                             add_headers=True,
+                             define=define,
+                             local_include=False,
+                             lib=lib,
+                             headers=headers,
+                             msg='Checking for macro %s' % f)
+
+    if not ret and (link is None or link == False):
+        ret = CHECK_VARIABLE(conf, f,
+                             define=define,
+                             headers=headers,
+                             msg='Checking for declaration of %s' % f)
+    conf.COMPOUND_END(ret)
+    return ret
+
+
+ at conf
+def CHECK_FUNCS(conf, list, link=True, lib=None, headers=None):
+    '''check for a list of functions'''
+    ret = True
+    for f in TO_LIST(list):
+        if not CHECK_FUNC(conf, f, link=link, lib=lib, headers=headers):
+            ret = False
+    return ret
+
+
+ at conf
+def CHECK_SIZEOF(conf, vars, headers=None, define=None):
+    '''check the size of a type'''
+    ret = True
+    for v in TO_LIST(vars):
+        v_define = define
+        if v_define is None:
+            v_define = 'SIZEOF_%s' % v.upper().replace(' ', '_')
+        if not CHECK_CODE(conf,
+                          'printf("%%u", (unsigned)sizeof(%s))' % v,
+                          define=v_define,
+                          execute=True,
+                          define_ret=True,
+                          quote=False,
+                          headers=headers,
+                          local_include=False,
+                          msg="Checking size of %s" % v):
+            ret = False
+    return ret
+
+
+
+ at conf
+def CHECK_CODE(conf, code, define,
+               always=False, execute=False, addmain=True,
+               add_headers=True, mandatory=False,
+               headers=None, msg=None, cflags='', includes='# .',
+               local_include=True, lib=None, link=True,
+               define_ret=False, quote=False,
+               on_target=True):
+    '''check if some code compiles and/or runs'''
+
+    if CONFIG_SET(conf, define):
+        return True
+
+    if headers is not None:
+        CHECK_HEADERS(conf, headers=headers, lib=lib)
+
+    if add_headers:
+        hdrs = header_list(conf, headers=headers, lib=lib)
+    else:
+        hdrs = ''
+    if execute:
+        execute = 1
+    else:
+        execute = 0
+
+    defs = conf.get_config_header()
+
+    if addmain:
+        fragment='%s\n%s\n int main(void) { %s; return 0; }\n' % (defs, hdrs, code)
+    else:
+        fragment='%s\n%s\n%s\n' % (defs, hdrs, code)
+
+    if msg is None:
+        msg="Checking for %s" % define
+
+    if local_include:
+        cflags += ' -I%s' % conf.curdir
+
+    if not link:
+        type='nolink'
+    else:
+        type='cprogram'
+
+    uselib = TO_LIST(lib)
+
+    (ccflags, ldflags) = library_flags(conf, uselib)
+
+    cflags = TO_LIST(cflags)
+    cflags.extend(ccflags)
+
+    if on_target:
+        exec_args = conf.SAMBA_CROSS_ARGS(msg=msg)
+    else:
+        exec_args = []
+
+    conf.COMPOUND_START(msg)
+
+    ret = conf.check(fragment=fragment,
+                     execute=execute,
+                     define_name = define,
+                     mandatory = mandatory,
+                     ccflags=cflags,
+                     ldflags=ldflags,
+                     includes=includes,
+                     uselib=uselib,
+                     type=type,
+                     msg=msg,
+                     quote=quote,
+                     exec_args=exec_args,
+                     define_ret=define_ret)
+    if not ret and CONFIG_SET(conf, define):
+        # sometimes conf.check() returns false, but it
+        # sets the define. Maybe a waf bug?
+        ret = True
+    if ret:
+        if not define_ret:
+            conf.DEFINE(define, 1)
+            conf.COMPOUND_END(True)
+        else:
+            conf.COMPOUND_END(conf.env[define])
+        return True
+    if always:
+        conf.DEFINE(define, 0)
+    conf.COMPOUND_END(False)
+    return False
+
+
+
+ at conf
+def CHECK_STRUCTURE_MEMBER(conf, structname, member,
+                           always=False, define=None, headers=None):
+    '''check for a structure member'''
+    if define is None:
+        define = 'HAVE_%s' % member.upper()
+    return CHECK_CODE(conf,
+                      '%s s; void *_x; _x=(void *)&s.%s' % (structname, member),
+                      define,
+                      execute=False,
+                      link=False,
+                      always=always,
+                      headers=headers,
+                      local_include=False,
+                      msg="Checking for member %s in %s" % (member, structname))
+
+
+ at conf
+def CHECK_CFLAGS(conf, cflags):
+    '''check if the given cflags are accepted by the compiler
+    '''
+    return conf.check(fragment='int main(void) { return 0; }\n',
+                      execute=0,
+                      type='nolink',
+                      ccflags=cflags,
+                      msg="Checking compiler accepts %s" % cflags)
+
+
+ at conf
+def CONFIG_SET(conf, option):
+    '''return True if a configuration option was found'''
+    return (option in conf.env) and (conf.env[option] != ())
+Build.BuildContext.CONFIG_SET = CONFIG_SET
+
+
+def library_flags(conf, libs):
+    '''work out flags from pkg_config'''
+    ccflags = []
+    ldflags = []
+    for lib in TO_LIST(libs):
+        inc_path = None
+        inc_path = getattr(conf.env, 'CPPPATH_%s' % lib.upper(), [])
+        lib_path = getattr(conf.env, 'LIBPATH_%s' % lib.upper(), [])
+        for i in inc_path:
+            ccflags.append('-I%s' % i)
+        for l in lib_path:
+            ldflags.append('-L%s' % l)
+    return (ccflags, ldflags)
+
+
+ at conf
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True):
+    '''check if a set of libraries exist'''
+
+    liblist  = TO_LIST(libs)
+    ret = True
+    for lib in liblist[:]:
+        if GET_TARGET_TYPE(conf, lib) == 'SYSLIB':
+            continue
+
+        (ccflags, ldflags) = library_flags(conf, lib)
+
+        if not conf.check(lib=lib, uselib_store=lib, ccflags=ccflags, ldflags=ldflags):
+            if mandatory:
+                Logs.error("Mandatory library '%s' not found for functions '%s'" % (lib, list))
+                sys.exit(1)
+            if empty_decl:
+                # if it isn't a mandatory library, then remove it from dependency lists
+                SET_TARGET_TYPE(conf, lib, 'EMPTY')
+            ret = False
+        else:
+            conf.define('HAVE_LIB%s' % lib.upper().replace('-','_'), 1)
+            conf.env['LIB_' + lib.upper()] = lib
+            LOCAL_CACHE_SET(conf, 'TARGET_TYPE', lib, 'SYSLIB')
+
+    return ret
+
+
+
+ at conf
+def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False,
+                   headers=None, link=True, empty_decl=True):
+    """
+    check that the functions in 'list' are available in 'library'
+    if they are, then make that library available as a dependency
+
+    if the library is not available and mandatory==True, then
+    raise an error.
+
+    If the library is not available and mandatory==False, then
+    add the library to the list of dependencies to remove from
+    build rules
+
+    optionally check for the functions first in libc
+    """
+    remaining = TO_LIST(list)
+    liblist   = TO_LIST(library)
+
+    # check if some already found
+    for f in remaining[:]:
+        if CONFIG_SET(conf, 'HAVE_%s' % f.upper()):
+            remaining.remove(f)
+
+    # see if the functions are in libc
+    if checklibc:
+        for f in remaining[:]:
+            if CHECK_FUNC(conf, f, link=True, headers=headers):
+                remaining.remove(f)
+
+    if remaining == []:
+        for lib in liblist:
+            if GET_TARGET_TYPE(conf, lib) != 'SYSLIB' and empty_decl:
+                SET_TARGET_TYPE(conf, lib, 'EMPTY')
+        return True
+
+    conf.CHECK_LIB(liblist, empty_decl=empty_decl)
+    for lib in liblist[:]:
+        if not GET_TARGET_TYPE(conf, lib) == 'SYSLIB':
+            if mandatory:
+                Logs.error("Mandatory library '%s' not found for functions '%s'" % (lib, list))
+                sys.exit(1)
+            # if it isn't a mandatory library, then remove it from dependency lists
+            liblist.remove(lib)
+            continue
+
+    ret = True
+    for f in remaining:
+        if not CHECK_FUNC(conf, f, lib=' '.join(liblist), headers=headers, link=link):
+            ret = False
+
+    return ret
+
+
+ at conf
+def IN_LAUNCH_DIR(conf):
+    '''return True if this rule is being run from the launch directory'''
+    return os.path.realpath(conf.curdir) == os.path.realpath(Options.launch_dir)
+Options.Handler.IN_LAUNCH_DIR = IN_LAUNCH_DIR
+
+
+ at conf
+def SAMBA_CONFIG_H(conf, path=None):
+    '''write out config.h in the right directory'''
+    # we don't want to produce a config.h in places like lib/replace
+    # when we are building projects that depend on lib/replace
+    if not IN_LAUNCH_DIR(conf):
+        return
+
+    if Options.options.developer:
+        # we add these here to ensure that -Wstrict-prototypes is not set during configure
+        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k',
+                        testflags=True)
+
+    if Options.options.picky_developer:
+        conf.ADD_CFLAGS('-Werror', testflags=True)
+
+    if Options.options.fatal_errors:
+        conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
+
+    if Options.options.pedantic:
+        conf.ADD_CFLAGS('-W', testflags=True)
+
+    if path is None:
+        conf.write_config_header('config.h', top=True)
+    else:
+        conf.write_config_header(path)
+    conf.SAMBA_CROSS_CHECK_COMPLETE()
+
+
+ at conf
+def CONFIG_PATH(conf, name, default):
+    '''setup a configurable path'''
+    if not name in conf.env:
+        if default[0] == '/':
+            conf.env[name] = default
+        else:
+            conf.env[name] = conf.env['PREFIX'] + default
+
+ at conf
+def ADD_CFLAGS(conf, flags, testflags=False):
+    '''add some CFLAGS to the command line
+       optionally set testflags to ensure all the flags work
+    '''
+    if testflags:
+        ok_flags=[]
+        for f in flags.split():
+            if CHECK_CFLAGS(conf, f):
+                ok_flags.append(f)
+        flags = ok_flags
+    if not 'EXTRA_CFLAGS' in conf.env:
+        conf.env['EXTRA_CFLAGS'] = []
+    conf.env['EXTRA_CFLAGS'].extend(TO_LIST(flags))
+
+
+
+ at conf
+def ADD_EXTRA_INCLUDES(conf, includes):
+    '''add some extra include directories to all builds'''
+    if not 'EXTRA_INCLUDES' in conf.env:
+        conf.env['EXTRA_INCLUDES'] = []
+    conf.env['EXTRA_INCLUDES'].extend(TO_LIST(includes))
+
+
+
+def CURRENT_CFLAGS(bld, target, cflags, hide_symbols=False):
+    '''work out the current flags. local flags are added first'''
+    if not 'EXTRA_CFLAGS' in bld.env:
+        list = []
+    else:
+        list = bld.env['EXTRA_CFLAGS'];
+    ret = TO_LIST(cflags)
+    ret.extend(list)
+    if hide_symbols and bld.env.HAVE_VISIBILITY_ATTR:
+        ret.append('-fvisibility=hidden')
+    return ret
+
+
+ at conf
+def CHECK_CC_ENV(conf):
+    """trim whitespaces from 'CC'.
+    The build farm sometimes puts a space at the start"""
+    if os.environ.get('CC'):
+        conf.env.CC = TO_LIST(os.environ.get('CC'))
+        if len(conf.env.CC) == 1:
+            # make for nicer logs if just a single command
+            conf.env.CC = conf.env.CC[0]
+
+
+ at conf
+def SETUP_CONFIGURE_CACHE(conf, enable):
+    '''enable/disable cache of configure results'''
+    if enable:
+        # when -C is chosen, we will use a private cache and will
+        # not look into system includes. This roughtly matches what
+        # autoconf does with -C
+        cache_path = os.path.join(conf.blddir, '.confcache')
+        mkdir_p(cache_path)
+        Options.cache_global = os.environ['WAFCACHE'] = cache_path
+    else:
+        # when -C is not chosen we will not cache configure checks
+        # We set the recursion limit low to prevent waf from spending
+        # a lot of time on the signatures of the files.
+        Options.cache_global = os.environ['WAFCACHE'] = ''
+        preproc.recursion_limit = 1
+    # in either case we don't need to scan system includes
+    preproc.go_absolute = False

Added: branches/talloc/experimental/buildtools/wafsamba/samba_autoproto.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_autoproto.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_autoproto.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,46 @@
+# waf build tool for building automatic prototypes from C source
+
+import Build
+from samba_utils import *
+
+def HEIMDAL_AUTOPROTO(bld, header, source, options=None, group='prototypes'):
+    '''rule for heimdal prototype generation'''
+    bld.SET_BUILD_GROUP(group)
+    if options is None:
+        options='-q -P comment -o'
+    SET_TARGET_TYPE(bld, header, 'PROTOTYPE')
+    t = bld(rule='${PERL} ${HEIMDAL}/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}',
+            source=source,
+            target=header,
+            on_results=True,
+            ext_out='.c',
+            before='cc')
+    t.env.HEIMDAL = os.path.join(bld.srcnode.abspath(), 'source4/heimdal')
+    t.env.OPTIONS = options
+Build.BuildContext.HEIMDAL_AUTOPROTO = HEIMDAL_AUTOPROTO
+
+
+def HEIMDAL_AUTOPROTO_PRIVATE(bld, header, source):
+    '''rule for private heimdal prototype generation'''
+    bld.HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p')
+Build.BuildContext.HEIMDAL_AUTOPROTO_PRIVATE = HEIMDAL_AUTOPROTO_PRIVATE
+
+
+def SAMBA_AUTOPROTO(bld, header, source):
+    '''rule for samba prototype generation'''
+    bld.SET_BUILD_GROUP('prototypes')
+    relpath = os_path_relpath(bld.curdir, bld.srcnode.abspath())
+    name = os.path.join(relpath, header)
+    SET_TARGET_TYPE(bld, name, 'PROTOTYPE')
+    t = bld(
+        name = name,
+        source = source,
+        target = header,
+        on_results=True,
+        ext_out='.c',
+        before ='cc',
+        rule = '${PERL} ${SCRIPT}/mkproto.pl --srcdir=.. --builddir=. --public=/dev/null --private=${TGT} ${SRC}'
+        )
+    t.env.SCRIPT = os.path.join(bld.srcnode.abspath(), 'source4/script')
+Build.BuildContext.SAMBA_AUTOPROTO = SAMBA_AUTOPROTO
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_bundled.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_bundled.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_bundled.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,137 @@
+# functions to support bundled libraries
+
+from Configure import conf
+import Logs
+from samba_utils import *
+
+def BUNDLED_NAME(bld, name, bundled_extension):
+    '''possibly rename a library to include a bundled extension'''
+    if bld.env.DISABLE_SHARED or not bundled_extension:
+        return name
+    if name in bld.env.BUNDLED_EXTENSION_EXCEPTION:
+        return name
+    extension = getattr(bld.env, 'BUNDLED_EXTENSION', '')
+    if extension:
+        return name + '-' + extension
+    return name
+
+
+def target_in_list(target, lst, default):
+    for l in lst:
+        if target == l:
+            return True
+        if '!' + target == l:
+            return False
+        if l == 'ALL':
+            return True
+        if l == 'NONE':
+            return False
+    return default
+
+
+def BUILTIN_LIBRARY(bld, name):
+    '''return True if a library should be builtin
+       instead of being built as a shared lib'''
+    if bld.env.DISABLE_SHARED:
+        return True
+    return target_in_list(name, bld.env.BUILTIN_LIBRARIES, False)
+Build.BuildContext.BUILTIN_LIBRARY = BUILTIN_LIBRARY
+
+
+def BUILTIN_DEFAULT(opt, builtins):
+    '''set a comma separated default list of builtin libraries for this package'''
+    if 'BUILTIN_LIBRARIES_DEFAULT' in Options.options:
+        return
+    Options.options['BUILTIN_LIBRARIES_DEFAULT'] = builtins
+Options.Handler.BUILTIN_DEFAULT = BUILTIN_DEFAULT
+
+
+def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''):
+    '''set a default bundled library extension'''
+    if 'BUNDLED_EXTENSION_DEFAULT' in Options.options:
+        return
+    Options.options['BUNDLED_EXTENSION_DEFAULT'] = extension
+    Options.options['BUNDLED_EXTENSION_EXCEPTION'] = noextenion
+Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT
+
+
+def minimum_library_version(conf, libname, default):
+    '''allow override of mininum system library version'''
+
+    minlist = Options.options.MINIMUM_LIBRARY_VERSION
+    if not minlist:
+        return default
+
+    for m in minlist.split(','):
+        a = m.split(':')
+        if len(a) != 2:
+            Logs.error("Bad syntax for --minimum-library-version of %s" % m)
+            sys.exit(1)
+        if a[0] == libname:
+            return a[1]
+    return default
+
+
+ at runonce
+ at conf
+def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
+                         checkfunctions=None, headers=None,
+                         onlyif=None, implied_deps=None,
+                         require_headers=True):
+    '''check if a library is available as a system library.
+    this first tries via pkg-config, then if that fails
+    tries by testing for a specified function in the specified lib
+    '''
+    if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS:
+        return False
+    found = 'FOUND_SYSTEMLIB_%s' % libname
+    if found in conf.env:
+        return conf.env[found]
+
+    # see if the library should only use a system version if another dependent
+    # system version is found. That prevents possible use of mixed library
+    # versions
+    if onlyif:
+        for syslib in TO_LIST(onlyif):
+            f = 'FOUND_SYSTEMLIB_%s' % syslib
+            if not f in conf.env:
+                if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS:
+                    Logs.error('ERROR: Use of system library %s depends on missing system library %s' % (libname, syslib))
+                    sys.exit(1)
+                conf.env[found] = False
+                return False
+
+    minversion = minimum_library_version(conf, libname, minversion)
+
+    # try pkgconfig first
+    if conf.check_cfg(package=libname,
+                      args='"%s >= %s" --cflags --libs' % (libname, minversion),
+                      msg='Checking for system %s >= %s' % (libname, minversion)):
+        conf.SET_TARGET_TYPE(libname, 'SYSLIB')
+        conf.env[found] = True
+        if implied_deps:
+            conf.SET_SYSLIB_DEPS(libname, implied_deps)
+        return True
+    if checkfunctions is not None:
+        headers_ok = True
+        if require_headers and headers and not conf.CHECK_HEADERS(headers):
+            headers_ok = False
+        if headers_ok and conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers, empty_decl=False):
+            conf.env[found] = True
+            if implied_deps:
+                conf.SET_SYSLIB_DEPS(libname, implied_deps)
+            return True
+    conf.env[found] = False
+    if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS:
+        Logs.error('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion))
+        sys.exit(1)
+    return False
+
+def NONSHARED_BINARY(bld, name):
+    '''return True if a binary should be built without non-system shared libs'''
+    if bld.env.DISABLE_SHARED:
+        return True
+    return target_in_list(name, bld.env.NONSHARED_BINARIES, False)
+Build.BuildContext.NONSHARED_BINARY = NONSHARED_BINARY
+
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_conftests.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_conftests.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_conftests.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,305 @@
+# a set of config tests that use the samba_autoconf functions
+# to test for commonly needed configuration options
+
+import os, Build, shutil, Utils, re
+from Configure import conf
+from samba_utils import *
+
+ at conf
+def CHECK_ICONV(conf, define='HAVE_NATIVE_ICONV'):
+    '''check if the iconv library is installed
+       optionally pass a define'''
+    if conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=True, headers='iconv.h'):
+        conf.DEFINE(define, 1)
+        return True
+    return False
+
+
+ at conf
+def CHECK_LARGEFILE(conf, define='HAVE_LARGEFILE'):
+    '''see what we need for largefile support'''
+    if conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
+                       define,
+                       execute=True,
+                       msg='Checking for large file support'):
+        return True
+    if conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
+                       define,
+                       execute=True,
+                       cflags='-D_FILE_OFFSET_BITS=64',
+                       msg='Checking for -D_FILE_OFFSET_BITS=64'):
+        conf.DEFINE('_FILE_OFFSET_BITS', 64)
+        return True
+    return False
+
+
+ at conf
+def CHECK_C_PROTOTYPE(conf, function, prototype, define, headers=None):
+    '''verify that a C prototype matches the one on the current system'''
+    if not conf.CHECK_DECLS(function, headers=headers):
+        return False
+    return conf.CHECK_CODE('%s; void *_x = (void *)%s' % (prototype, function),
+                           define=define,
+                           local_include=False,
+                           headers=headers,
+                           link=False,
+                           execute=False,
+                           msg='Checking C prototype for %s' % function)
+
+
+ at conf
+def CHECK_CHARSET_EXISTS(conf, charset, outcharset='UCS-2LE', headers=None, define=None):
+    '''check that a named charset is able to be used with iconv_open() for conversion
+    to a target charset
+    '''
+    msg = 'Checking if can we convert from %s to %s' % (charset, outcharset)
+    if define is None:
+        define = 'HAVE_CHARSET_%s' % charset.upper().replace('-','_')
+    return conf.CHECK_CODE('''
+                           iconv_t cd = iconv_open("%s", "%s");
+                           if (cd == 0 || cd == (iconv_t)-1) return -1;
+                           ''' % (charset, outcharset),
+                           define=define,
+                           execute=True,
+                           msg=msg,
+                           lib='iconv',
+                           headers=headers)
+
+def find_config_dir(conf):
+    '''find a directory to run tests in'''
+    k = 0
+    while k < 10000:
+        dir = os.path.join(conf.blddir, '.conf_check_%d' % k)
+        try:
+            shutil.rmtree(dir)
+        except OSError:
+            pass
+        try:
+            os.stat(dir)
+        except:
+            break
+        k += 1
+
+    try:
+        os.makedirs(dir)
+    except:
+        conf.fatal('cannot create a configuration test folder %r' % dir)
+
+    try:
+        os.stat(dir)
+    except:
+        conf.fatal('cannot use the configuration test folder %r' % dir)
+    return dir
+
+
+# this one is quite complex, and should probably be broken up
+# into several parts. I'd quite like to create a set of CHECK_COMPOUND()
+# functions that make writing complex compound tests like this much easier
+ at conf
+def CHECK_LIBRARY_SUPPORT(conf, rpath=False, msg=None):
+    '''see if the platform supports building libraries'''
+
+    if msg is None:
+        if rpath:
+            msg = "rpath library support"
+        else:
+            msg = "building library support"
+
+    dir = find_config_dir(conf)
+
+    bdir = os.path.join(dir, 'testbuild')
+    if not os.path.exists(bdir):
+        os.makedirs(bdir)
+
+    env = conf.env
+
+    subdir = os.path.join(dir, "libdir")
+
+    os.makedirs(subdir)
+
+    dest = open(os.path.join(subdir, 'lib1.c'), 'w')
+    dest.write('int lib_func(void) { return 42; }\n')
+    dest.close()
+
+    dest = open(os.path.join(dir, 'main.c'), 'w')
+    dest.write('int main(void) {return !(lib_func() == 42);}\n')
+    dest.close()
+
+    bld = Build.BuildContext()
+    bld.log = conf.log
+    bld.all_envs.update(conf.all_envs)
+    bld.all_envs['default'] = env
+    bld.lst_variants = bld.all_envs.keys()
+    bld.load_dirs(dir, bdir)
+
+    bld.rescan(bld.srcnode)
+
+    bld(features='cc cshlib',
+        source='libdir/lib1.c',
+        target='libdir/lib1',
+        name='lib1')
+
+    o = bld(features='cc cprogram',
+            source='main.c',
+            target='prog1',
+            uselib_local='lib1')
+
+    if rpath:
+        o.rpath=os.path.join(bdir, 'default/libdir')
+
+    # compile the program
+    try:
+        bld.compile()
+    except:
+        conf.check_message(msg, '', False)
+        return False
+
+    # path for execution
+    lastprog = o.link_task.outputs[0].abspath(env)
+
+    if not rpath:
+        if 'LD_LIBRARY_PATH' in os.environ:
+            old_ld_library_path = os.environ['LD_LIBRARY_PATH']
+        else:
+            old_ld_library_path = None
+        ADD_LD_LIBRARY_PATH(os.path.join(bdir, 'default/libdir'))
+
+    # we need to run the program, try to get its result
+    args = conf.SAMBA_CROSS_ARGS(msg=msg)
+    proc = Utils.pproc.Popen([lastprog] + args, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE)
+    (out, err) = proc.communicate()
+    w = conf.log.write
+    w(str(out))
+    w('\n')
+    w(str(err))
+    w('\nreturncode %r\n' % proc.returncode)
+    ret = (proc.returncode == 0)
+
+    if not rpath:
+        os.environ['LD_LIBRARY_PATH'] = old_ld_library_path or ''
+
+    conf.check_message(msg, '', ret)
+    return ret
+
+
+
+ at conf
+def CHECK_PERL_MANPAGE(conf, msg=None, section=None):
+    '''work out what extension perl uses for manpages'''
+
+    if msg is None:
+        if section:
+            msg = "perl man%s extension" % section
+        else:
+            msg = "perl manpage generation"
+
+    conf.check_message_1(msg)
+
+    dir = find_config_dir(conf)
+
+    bdir = os.path.join(dir, 'testbuild')
+    if not os.path.exists(bdir):
+        os.makedirs(bdir)
+
+    dest = open(os.path.join(bdir, 'Makefile.PL'), 'w')
+    dest.write("""
+use ExtUtils::MakeMaker;
+WriteMakefile(
+    'NAME'	=> 'WafTest',
+    'EXE_FILES' => [ 'WafTest' ]
+);
+""")
+    dest.close()
+    back = os.path.abspath('.')
+    os.chdir(bdir)
+    proc = Utils.pproc.Popen(['perl', 'Makefile.PL'],
+                             stdout=Utils.pproc.PIPE,
+                             stderr=Utils.pproc.PIPE)
+    (out, err) = proc.communicate()
+    os.chdir(back)
+
+    ret = (proc.returncode == 0)
+    if not ret:
+        conf.check_message_2('not found', color='YELLOW')
+        return
+
+    if section:
+        f = open(os.path.join(bdir,'Makefile'), 'r')
+        man = f.read()
+        f.close()
+        m = re.search('MAN%sEXT\s+=\s+(\w+)' % section, man)
+        if not m:
+            conf.check_message_2('not found', color='YELLOW')
+            return
+        ext = m.group(1)
+        conf.check_message_2(ext)
+        return ext
+
+    conf.check_message_2('ok')
+    return True
+
+
+ at conf
+def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True):
+    '''run a command and return result'''
+    if msg is None:
+        msg = 'Checking %s' % ' '.join(cmd)
+    conf.COMPOUND_START(msg)
+    cmd = cmd[:]
+    if on_target:
+        cmd.extend(conf.SAMBA_CROSS_ARGS(msg=msg))
+    try:
+        ret = Utils.cmd_output(cmd)
+    except:
+        conf.COMPOUND_END(False)
+        return False
+    ret = ret.strip()
+    conf.COMPOUND_END(ret)
+    if define:
+        conf.DEFINE(define, ret, quote=True)
+    return ret
+
+
+ at conf
+def CHECK_UNAME(conf):
+    '''setup SYSTEM_UNAME_* defines'''
+    ret = True
+    for v in "sysname machine release version".split():
+        if not conf.CHECK_CODE('''
+                               struct utsname n;
+                               if (uname(&n) == -1) return -1;
+                               printf("%%s", n.%s);
+                               ''' % v,
+                               define='SYSTEM_UNAME_%s' % v.upper(),
+                               execute=True,
+                               define_ret=True,
+                               quote=True,
+                               headers='sys/utsname.h',
+                               local_include=False,
+                               msg="Checking uname %s type" % v):
+            ret = False
+    return ret
+
+ at conf
+def CHECK_INLINE(conf):
+    '''check for the right value for inline'''
+    conf.COMPOUND_START('Checking for inline')
+    for i in ['inline', '__inline__', '__inline']:
+        ret = conf.CHECK_CODE('''
+        typedef int foo_t;
+        static %s foo_t static_foo () {return 0; }
+        %s foo_t foo () {return 0; }''' % (i, i),
+                              define='INLINE_MACRO',
+                              addmain=False,
+                              link=False)
+        if ret:
+            if i != 'inline':
+                conf.DEFINE('inline', i, quote=False)
+            break
+    if not ret:
+        conf.COMPOUND_END(ret)
+    else:
+        conf.COMPOUND_END(i)
+    return ret
+
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_cross.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_cross.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_cross.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,134 @@
+# functions for handling cross-compilation
+
+import Utils, Logs, sys, os, Options, re
+from Configure import conf
+
+real_Popen = None
+
+ANSWER_UNKNOWN = (254, "")
+ANSWER_FAIL    = (255, "")
+ANSWER_OK      = (0, "")
+
+cross_answers_incomplete = False
+
+
+def add_answer(ca_file, msg, answer):
+    '''add an answer to a set of cross answers'''
+    try:
+        f = open(ca_file, 'a')
+    except:
+        Logs.error("Unable to open cross-answers file %s" % ca_file)
+        sys.exit(1)
+    if answer == ANSWER_OK:
+        f.write('%s: OK\n' % msg)
+    elif answer == ANSWER_UNKNOWN:
+        f.write('%s: UNKNOWN\n' % msg)
+    elif answer == ANSWER_FAIL:
+        f.write('%s: FAIL\n' % msg)
+    else:
+        (retcode, retstring) = answer
+        f.write('%s: (%d, "%s")' % (msg, retcode, retstring))
+    f.close()
+
+
+def cross_answer(ca_file, msg):
+    '''return a (retcode,retstring) tuple from a answers file'''
+    try:
+        f = open(ca_file, 'r')
+    except:
+        add_answer(ca_file, msg, ANSWER_UNKNOWN)
+        return ANSWER_UNKNOWN
+    for line in f:
+        line = line.strip()
+        if line == '' or line[0] == '#':
+            continue
+        if line.find(':') != -1:
+            a = line.split(':')
+            thismsg = a[0].strip()
+            if thismsg != msg:
+                continue
+            ans = a[1].strip()
+            if ans == "OK" or ans == "YES":
+                f.close()
+                return ANSWER_OK
+            elif ans == "UNKNOWN":
+                f.close()
+                return ANSWER_UNKNOWN
+            elif ans == "FAIL" or ans == "NO":
+                f.close()
+                return ANSWER_FAIL
+            elif ans[0] == '"':
+                return (0, ans.strip('"'))
+            elif ans[0] == "'":
+                return (0, ans.strip("'"))
+            else:
+                m = re.match('\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans)
+                if m:
+                    f.close()
+                    return (int(m.group(1)), m.group(2))
+                else:
+                    raise Utils.WafError("Bad answer format '%s' in %s" % (line, ca_file))
+    f.close()
+    add_answer(ca_file, msg, ANSWER_UNKNOWN)
+    return ANSWER_UNKNOWN
+
+
+class cross_Popen(Utils.pproc.Popen):
+    '''cross-compilation wrapper for Popen'''
+    def __init__(*k, **kw):
+        (obj, args) = k
+
+        if '--cross-execute' in args:
+            # when --cross-execute is set, then change the arguments
+            # to use the cross emulator
+            i = args.index('--cross-execute')
+            newargs = args[i+1].split()
+            newargs.extend(args[0:i])
+            args = newargs
+        elif '--cross-answers' in args:
+            # when --cross-answers is set, then change the arguments
+            # to use the cross answers if available
+            i = args.index('--cross-answers')
+            ca_file = args[i+1]
+            msg     = args[i+2]
+            ans = cross_answer(ca_file, msg)
+            if ans == ANSWER_UNKNOWN:
+                global cross_answers_incomplete
+                cross_answers_incomplete = True
+            (retcode, retstring) = ans
+            args = ['/bin/sh', '-c', "echo -n '%s'; exit %d" % (retstring, retcode)]
+        real_Popen.__init__(*(obj, args), **kw)
+
+
+ at conf
+def SAMBA_CROSS_ARGS(conf, msg=None):
+    '''get exec_args to pass when running cross compiled binaries'''
+    if not conf.env.CROSS_COMPILE:
+        return []
+
+    global real_Popen
+    if real_Popen is None:
+        real_Popen  = Utils.pproc.Popen
+        Utils.pproc.Popen = cross_Popen
+
+    ret = []
+
+    if conf.env.CROSS_EXECUTE:
+        ret.extend(['--cross-execute', conf.env.CROSS_EXECUTE])
+    elif conf.env.CROSS_ANSWERS:
+        if msg is None:
+            raise Utils.WafError("Cannot have NULL msg in cross-answers")
+        ret.extend(['--cross-answers', os.path.join(Options.launch_dir, conf.env.CROSS_ANSWERS), msg])
+
+    if ret == []:
+        raise Utils.WafError("Cannot cross-compile without either --cross-execute or --cross-answers")
+
+    return ret
+
+ at conf
+def SAMBA_CROSS_CHECK_COMPLETE(conf):
+    '''check if we have some unanswered questions'''
+    global cross_answers_incomplete
+    if conf.env.CROSS_COMPILE and cross_answers_incomplete:
+        raise Utils.WafError("Cross answers file %s is incomplete" % conf.env.CROSS_ANSWERS)
+    return True

Added: branches/talloc/experimental/buildtools/wafsamba/samba_deps.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_deps.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_deps.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,982 @@
+# Samba automatic dependency handling and project rules
+
+import Build, os, re, Environment, Logs
+from samba_utils import *
+from samba_autoconf import *
+from samba_bundled import BUILTIN_LIBRARY
+
+ at conf
+def ADD_GLOBAL_DEPENDENCY(ctx, dep):
+    '''add a dependency for all binaries and libraries'''
+    if not 'GLOBAL_DEPENDENCIES' in ctx.env:
+        ctx.env.GLOBAL_DEPENDENCIES = []
+    ctx.env.GLOBAL_DEPENDENCIES.append(dep)
+
+
+def TARGET_ALIAS(bld, target, alias):
+    '''define an alias for a target name'''
+    cache = LOCAL_CACHE(bld, 'TARGET_ALIAS')
+    if alias in cache:
+        Logs.error("Target alias %s already set to %s : newalias %s" % (alias, cache[alias], target))
+        sys.exit(1)
+    cache[alias] = target
+Build.BuildContext.TARGET_ALIAS = TARGET_ALIAS
+
+
+ at conf
+def SET_SYSLIB_DEPS(conf, target, deps):
+    '''setup some implied dependencies for a SYSLIB'''
+    cache = LOCAL_CACHE(conf, 'SYSLIB_DEPS')
+    cache[target] = deps
+
+
+def EXPAND_ALIAS(bld, target):
+    '''expand a target name via an alias'''
+    aliases = LOCAL_CACHE(bld, 'TARGET_ALIAS')
+    if target in aliases:
+        return aliases[target]
+    return target
+Build.BuildContext.EXPAND_ALIAS = EXPAND_ALIAS
+
+
+def expand_subsystem_deps(bld):
+    '''expand the reverse dependencies resulting from subsystem
+       attributes of modules'''
+    subsystems = LOCAL_CACHE(bld, 'INIT_FUNCTIONS')
+    aliases    = LOCAL_CACHE(bld, 'TARGET_ALIAS')
+    targets    = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    for s in subsystems:
+        if s in aliases:
+            s = aliases[s]
+        bld.ASSERT(s in targets, "Subsystem target %s not declared" % s)
+        type = targets[s]
+        if type == 'DISABLED' or type == 'EMPTY':
+            continue
+
+        t = bld.name_to_obj(s, bld.env)
+        bld.ASSERT(t is not None, "Subsystem target %s not found" % s)
+        for d in subsystems[s]:
+            type = targets[d['TARGET']]
+            if type != 'DISABLED' and type != 'EMPTY':
+                t.samba_deps_extended.append(d['TARGET'])
+                t2 = bld.name_to_obj(d['TARGET'], bld.env)
+                t2.samba_includes_extended.extend(t.samba_includes_extended)
+                t2.samba_deps_extended.extend(t.samba_deps_extended)
+        t.samba_deps_extended = unique_list(t.samba_deps_extended)
+
+
+
+def build_dependencies(self):
+    '''This builds the dependency list for a target. It runs after all the targets are declared
+
+    The reason this is not just done in the SAMBA_*() rules is that we have no way of knowing
+    the full dependency list for a target until we have all of the targets declared.
+    '''
+
+    if self.samba_type in ['LIBRARY', 'BINARY', 'PYTHON']:
+        self.uselib        = list(self.final_syslibs)
+        self.uselib_local  = list(self.final_libs)
+        self.add_objects   = list(self.final_objects)
+
+        # extra link flags from pkg_config
+        libs = self.final_syslibs.copy()
+
+        (ccflags, ldflags) = library_flags(self, list(libs))
+        new_ldflags        = getattr(self, 'ldflags', [])
+        new_ldflags.extend(ldflags)
+        self.ldflags       = new_ldflags
+
+        debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
+              self.sname, self.uselib, self.uselib_local, self.add_objects)
+
+    if self.samba_type in ['SUBSYSTEM']:
+        # this is needed for the ccflags of libs that come from pkg_config
+        self.uselib = list(self.direct_syslibs)
+
+    if getattr(self, 'uselib', None):
+        up_list = []
+        for l in self.uselib:
+           up_list.append(l.upper())
+        self.uselib = up_list
+
+def build_includes(self):
+    '''This builds the right set of includes for a target.
+
+    One tricky part of this is that the includes= attribute for a
+    target needs to use paths which are relative to that targets
+    declaration directory (which we can get at via t.path).
+
+    The way this works is the includes list gets added as
+    samba_includes in the main build task declaration. Then this
+    function runs after all of the tasks are declared, and it
+    processes the samba_includes attribute to produce a includes=
+    attribute
+    '''
+
+    if getattr(self, 'samba_includes', None) is None:
+        return
+
+    bld = self.bld
+
+    inc_deps = includes_objects(bld, self, set(), {})
+
+    includes = []
+
+    # maybe add local includes
+    if getattr(self, 'local_include', True) == True and getattr(self, 'local_include_first', True):
+        includes.append('.')
+
+    includes.extend(self.samba_includes_extended)
+
+    if 'EXTRA_INCLUDES' in bld.env:
+        includes.extend(bld.env['EXTRA_INCLUDES'])
+
+    includes.append('#')
+
+    inc_set = set()
+    inc_abs = []
+
+    for d in inc_deps:
+        t = bld.name_to_obj(d, bld.env)
+        bld.ASSERT(t is not None, "Unable to find dependency %s for %s" % (d, self.sname))
+        inclist = getattr(t, 'samba_includes_extended', [])
+        if getattr(t, 'local_include', True) == True:
+            inclist.append('.')
+        if inclist == []:
+            continue
+        tpath = t.samba_abspath
+        for inc in inclist:
+            npath = tpath + '/' + inc
+            if not npath in inc_set:
+                inc_abs.append(npath)
+                inc_set.add(npath)
+
+    mypath = self.path.abspath(bld.env)
+    for inc in inc_abs:
+        relpath = os_path_relpath(inc, mypath)
+        includes.append(relpath)
+
+    if getattr(self, 'local_include', True) == True and not getattr(self, 'local_include_first', True):
+        includes.append('.')
+
+    # now transform the includes list to be relative to the top directory
+    # which is represented by '#' in waf. This allows waf to cache the
+    # includes lists more efficiently
+    includes_top = []
+    for i in includes:
+        if i[0] == '#':
+            # some are already top based
+            includes_top.append(i)
+            continue
+        absinc = os.path.join(self.path.abspath(), i)
+        relinc = os_path_relpath(absinc, self.bld.srcnode.abspath())
+        includes_top.append('#' + relinc)
+
+    self.includes = unique_list(includes_top)
+    debug('deps: includes for target %s: includes=%s',
+          self.sname, self.includes)
+
+
+
+
+def add_init_functions(self):
+    '''This builds the right set of init functions'''
+
+    bld = self.bld
+
+    subsystems = LOCAL_CACHE(bld, 'INIT_FUNCTIONS')
+
+    # cope with the separated object lists from BINARY and LIBRARY targets
+    sname = self.sname
+    if sname.endswith('.objlist'):
+        sname = sname[0:-8]
+
+    modules = []
+    if sname in subsystems:
+        modules.append(sname)
+
+    m = getattr(self, 'samba_modules', None)
+    if m is not None:
+        modules.extend(TO_LIST(m))
+
+    m = getattr(self, 'samba_subsystem', None)
+    if m is not None:
+        modules.append(m)
+
+    if modules == []:
+        return
+
+    sentinal = getattr(self, 'init_function_sentinal', 'NULL')
+
+    targets    = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    cflags = getattr(self, 'samba_cflags', [])[:]
+    for m in modules:
+        bld.ASSERT(m in subsystems,
+                   "No init_function defined for module '%s' in target '%s'" % (m, self.sname))
+        init_fn_list = []
+        for d in subsystems[m]:
+            if targets[d['TARGET']] != 'DISABLED':
+                init_fn_list.append(d['INIT_FUNCTION'])
+        if init_fn_list == []:
+            cflags.append('-DSTATIC_%s_MODULES=%s' % (m, sentinal))
+        else:
+            cflags.append('-DSTATIC_%s_MODULES=%s' % (m, ','.join(init_fn_list) + ',' + sentinal))
+    self.ccflags = cflags
+
+
+
+def check_duplicate_sources(bld, tgt_list):
+    '''see if we are compiling the same source file into multiple
+    subsystem targets for the same library or binary'''
+
+    debug('deps: checking for duplicate sources')
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+    ret = True
+
+    seen = set()
+
+    for t in tgt_list:
+        obj_sources = getattr(t, 'source', '')
+        tpath = os.path.normpath(os_path_relpath(t.path.abspath(bld.env), t.env.BUILD_DIRECTORY + '/default'))
+        obj_sources = bld.SUBDIR(tpath, obj_sources)
+        t.samba_source_set = set(TO_LIST(obj_sources))
+
+    for t in tgt_list:
+        if not targets[t.sname] in [ 'LIBRARY', 'BINARY', 'PYTHON' ]:
+            continue
+
+        sources = []
+        for obj in t.add_objects:
+            t2 = t.bld.name_to_obj(obj, bld.env)
+            source_set = getattr(t2, 'samba_source_set', set())
+            sources.append( { 'dep':obj, 'src':source_set} )
+        for s in sources:
+            for s2 in sources:
+                if s['dep'] == s2['dep']: continue
+                common = s['src'].intersection(s2['src'])
+                if common.difference(seen):
+                    Logs.error("Target %s has duplicate source files in %s and %s : %s" % (t.sname,
+                                                                                      s['dep'], s2['dep'],
+                                                                                      common))
+                    seen = seen.union(common)
+                    ret = False
+    return ret
+
+
+def check_orpaned_targets(bld, tgt_list):
+    '''check if any build targets are orphaned'''
+
+    target_dict = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    debug('deps: checking for orphaned targets')
+
+    for t in tgt_list:
+        if getattr(t, 'samba_used', False) == True:
+            continue
+        type = target_dict[t.sname]
+        if not type in ['BINARY', 'LIBRARY', 'MODULE', 'ET', 'PYTHON']:
+            if re.search('^PIDL_', t.sname) is None:
+                Logs.warn("Target %s of type %s is unused by any other target" % (t.sname, type))
+
+
+def check_group_ordering(bld, tgt_list):
+    '''see if we have any dependencies that violate the group ordering
+
+    It is an error for a target to depend on a target from a later
+    build group
+    '''
+
+    def group_name(g):
+        tm = bld.task_manager
+        return [x for x in tm.groups_names if id(tm.groups_names[x]) == id(g)][0]
+
+    for g in bld.task_manager.groups:
+        gname = group_name(g)
+        for t in g.tasks_gen:
+            t.samba_group = gname
+
+    grp_map = {}
+    idx = 0
+    for g in bld.task_manager.groups:
+        name = group_name(g)
+        grp_map[name] = idx
+        idx += 1
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    ret = True
+    for t in tgt_list:
+        tdeps = getattr(t, 'add_objects', []) + getattr(t, 'uselib_local', [])
+        for d in tdeps:
+            t2 = bld.name_to_obj(d, bld.env)
+            if t2 is None:
+                continue
+            map1 = grp_map[t.samba_group]
+            map2 = grp_map[t2.samba_group]
+
+            if map2 > map1:
+                Logs.error("Target %r in build group %r depends on target %r from later build group %r" % (
+                           t.sname, t.samba_group, t2.sname, t2.samba_group))
+                ret = False
+
+    return ret
+
+
+def show_final_deps(bld, tgt_list):
+    '''show the final dependencies for all targets'''
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    for t in tgt_list:
+        if not targets[t.sname] in ['LIBRARY', 'BINARY', 'PYTHON']:
+            continue
+        debug('deps: final dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
+              t.sname, t.uselib, t.uselib_local, t.add_objects)
+
+
+def add_samba_attributes(bld, tgt_list):
+    '''ensure a target has a the required samba attributes'''
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    for t in tgt_list:
+        if t.name != '':
+            t.sname = t.name
+        else:
+            t.sname = t.target
+        t.samba_type = targets[t.sname]
+        t.samba_abspath = t.path.abspath(bld.env)
+        t.samba_deps_extended = t.samba_deps[:]
+        t.samba_includes_extended = TO_LIST(t.samba_includes)[:]
+        t.ccflags = getattr(t, 'samba_cflags', '')
+
+
+def build_direct_deps(bld, tgt_list):
+    '''build the direct_objects and direct_libs sets for each target'''
+
+    targets  = LOCAL_CACHE(bld, 'TARGET_TYPE')
+    syslib_deps  = LOCAL_CACHE(bld, 'SYSLIB_DEPS')
+    global_deps = bld.env.GLOBAL_DEPENDENCIES
+
+    for t in tgt_list:
+        t.direct_objects = set()
+        t.direct_libs = set()
+        t.direct_syslibs = set()
+        deps = t.samba_deps_extended
+        if getattr(t, 'samba_use_global_deps', False):
+            deps.extend(global_deps)
+        for d in deps:
+            d = EXPAND_ALIAS(bld, d)
+            if d == t.sname: continue
+            if not d in targets:
+                Logs.error("Unknown dependency %s in %s" % (d, t.sname))
+                sys.exit(1)
+            if targets[d] in [ 'EMPTY', 'DISABLED' ]:
+                continue
+            if targets[d] == 'SYSLIB':
+                t.direct_syslibs.add(d)
+                if d in syslib_deps:
+                    for implied in TO_LIST(syslib_deps[d]):
+                        if BUILTIN_LIBRARY(bld, implied):
+                            t.direct_objects.add(implied)
+                        elif targets[implied] == 'SYSLIB':
+                            t.direct_syslibs.add(implied)
+                        elif targets[implied] in ['LIBRARY', 'MODULE']:
+                            t.direct_libs.add(implied)
+                        else:
+                            Logs.error('Implied dependency %s in %s is of type %s' % (
+                                implied, t.sname, targets[implied]))
+                            sys.exit(1)
+                continue
+            t2 = bld.name_to_obj(d, bld.env)
+            if t2 is None:
+                Logs.error("no task %s of type %s in %s" % (d, targets[d], t.sname))
+                sys.exit(1)
+            if t2.samba_type in [ 'LIBRARY', 'MODULE' ]:
+                t.direct_libs.add(d)
+            elif t2.samba_type in [ 'SUBSYSTEM', 'ASN1', 'PYTHON' ]:
+                t.direct_objects.add(d)
+    debug('deps: built direct dependencies')
+
+
+def dependency_loop(loops, t, target):
+    '''add a dependency loop to the loops dictionary'''
+    if t.sname == target:
+        return
+    if not target in loops:
+        loops[target] = set()
+    if not t.sname in loops[target]:
+        loops[target].add(t.sname)
+
+
+def indirect_libs(bld, t, chain, loops):
+    '''recursively calculate the indirect library dependencies for a target
+
+    An indirect library is a library that results from a dependency on
+    a subsystem
+    '''
+
+    ret = getattr(t, 'indirect_libs', None)
+    if ret is not None:
+        return ret
+
+    ret = set()
+    for obj in t.direct_objects:
+        if obj in chain:
+            dependency_loop(loops, t, obj)
+            continue
+        chain.add(obj)
+        t2 = bld.name_to_obj(obj, bld.env)
+        r2 = indirect_libs(bld, t2, chain, loops)
+        chain.remove(obj)
+        ret = ret.union(t2.direct_libs)
+        ret = ret.union(r2)
+
+    for obj in indirect_objects(bld, t, set(), loops):
+        if obj in chain:
+            dependency_loop(loops, t, obj)
+            continue
+        chain.add(obj)
+        t2 = bld.name_to_obj(obj, bld.env)
+        r2 = indirect_libs(bld, t2, chain, loops)
+        chain.remove(obj)
+        ret = ret.union(t2.direct_libs)
+        ret = ret.union(r2)
+
+    t.indirect_libs = ret
+
+    return ret
+
+
+def indirect_objects(bld, t, chain, loops):
+    '''recursively calculate the indirect object dependencies for a target
+
+    indirect objects are the set of objects from expanding the
+    subsystem dependencies
+    '''
+
+    ret = getattr(t, 'indirect_objects', None)
+    if ret is not None: return ret
+
+    ret = set()
+    for lib in t.direct_objects:
+        if lib in chain:
+            dependency_loop(loops, t, lib)
+            continue
+        chain.add(lib)
+        t2 = bld.name_to_obj(lib, bld.env)
+        r2 = indirect_objects(bld, t2, chain, loops)
+        chain.remove(lib)
+        ret = ret.union(t2.direct_objects)
+        ret = ret.union(r2)
+
+    t.indirect_objects = ret
+    return ret
+
+
+def extended_objects(bld, t, chain):
+    '''recursively calculate the extended object dependencies for a target
+
+    extended objects are the union of:
+       - direct objects
+       - indirect objects
+       - direct and indirect objects of all direct and indirect libraries
+    '''
+
+    ret = getattr(t, 'extended_objects', None)
+    if ret is not None: return ret
+
+    ret = set()
+    ret = ret.union(t.final_objects)
+
+    for lib in t.final_libs:
+        if lib in chain:
+            continue
+        t2 = bld.name_to_obj(lib, bld.env)
+        chain.add(lib)
+        r2 = extended_objects(bld, t2, chain)
+        chain.remove(lib)
+        ret = ret.union(t2.final_objects)
+        ret = ret.union(r2)
+
+    t.extended_objects = ret
+    return ret
+
+
+def includes_objects(bld, t, chain, inc_loops):
+    '''recursively calculate the includes object dependencies for a target
+
+    includes dependencies come from either library or object dependencies
+    '''
+    ret = getattr(t, 'includes_objects', None)
+    if ret is not None:
+        return ret
+
+    ret = t.direct_objects.copy()
+    ret = ret.union(t.direct_libs)
+
+    for obj in t.direct_objects:
+        if obj in chain:
+            dependency_loop(inc_loops, t, obj)
+            continue
+        chain.add(obj)
+        t2 = bld.name_to_obj(obj, bld.env)
+        r2 = includes_objects(bld, t2, chain, inc_loops)
+        chain.remove(obj)
+        ret = ret.union(t2.direct_objects)
+        ret = ret.union(r2)
+
+    for lib in t.direct_libs:
+        if lib in chain:
+            dependency_loop(inc_loops, t, lib)
+            continue
+        chain.add(lib)
+        t2 = bld.name_to_obj(lib, bld.env)
+        if t2 is None:
+            targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+            Logs.error('Target %s of type %s not found in direct_libs for %s' % (
+                lib, targets[lib], t.sname))
+            sys.exit(1)
+        r2 = includes_objects(bld, t2, chain, inc_loops)
+        chain.remove(lib)
+        ret = ret.union(t2.direct_objects)
+        ret = ret.union(r2)
+
+    t.includes_objects = ret
+    return ret
+
+
+def break_dependency_loops(bld, tgt_list):
+    '''find and break dependency loops'''
+    loops = {}
+    inc_loops = {}
+
+    # build up the list of loops
+    for t in tgt_list:
+        indirect_objects(bld, t, set(), loops)
+        indirect_libs(bld, t, set(), loops)
+        includes_objects(bld, t, set(), inc_loops)
+
+    # break the loops
+    for t in tgt_list:
+        if t.sname in loops:
+            for attr in ['direct_objects', 'indirect_objects', 'direct_libs', 'indirect_libs']:
+                objs = getattr(t, attr, set())
+                setattr(t, attr, objs.difference(loops[t.sname]))
+
+    for loop in loops:
+        debug('deps: Found dependency loops for target %s : %s', loop, loops[loop])
+
+    for loop in inc_loops:
+        debug('deps: Found include loops for target %s : %s', loop, inc_loops[loop])
+
+    # expand the loops mapping by one level
+    for loop in loops.copy():
+        for tgt in loops[loop]:
+            if tgt in loops:
+                loops[loop] = loops[loop].union(loops[tgt])
+
+    for loop in inc_loops.copy():
+        for tgt in inc_loops[loop]:
+            if tgt in inc_loops:
+                inc_loops[loop] = inc_loops[loop].union(inc_loops[tgt])
+
+
+    # expand indirect subsystem and library loops
+    for loop in loops.copy():
+        t = bld.name_to_obj(loop, bld.env)
+        if t.samba_type in ['SUBSYSTEM']:
+            loops[loop] = loops[loop].union(t.indirect_objects)
+            loops[loop] = loops[loop].union(t.direct_objects)
+        if t.samba_type in ['LIBRARY','PYTHON']:
+            loops[loop] = loops[loop].union(t.indirect_libs)
+            loops[loop] = loops[loop].union(t.direct_libs)
+        if loop in loops[loop]:
+            loops[loop].remove(loop)
+
+    # expand indirect includes loops
+    for loop in inc_loops.copy():
+        t = bld.name_to_obj(loop, bld.env)
+        inc_loops[loop] = inc_loops[loop].union(t.includes_objects)
+        if loop in inc_loops[loop]:
+            inc_loops[loop].remove(loop)
+
+    # add in the replacement dependencies
+    for t in tgt_list:
+        for loop in loops:
+            for attr in ['direct_objects', 'indirect_objects', 'direct_libs', 'indirect_libs']:
+                objs = getattr(t, attr, set())
+                if loop in objs:
+                    diff = loops[loop].difference(objs)
+                    if t.sname in diff:
+                        diff.remove(t.sname)
+                    if diff:
+                        debug('deps: Expanded target %s of type %s from loop %s by %s', t.sname, t.samba_type, loop, diff)
+                        objs = objs.union(diff)
+                setattr(t, attr, objs)
+
+        for loop in inc_loops:
+            objs = getattr(t, 'includes_objects', set())
+            if loop in objs:
+                diff = inc_loops[loop].difference(objs)
+                if t.sname in diff:
+                    diff.remove(t.sname)
+                if diff:
+                    debug('deps: Expanded target %s includes of type %s from loop %s by %s', t.sname, t.samba_type, loop, diff)
+                    objs = objs.union(diff)
+            setattr(t, 'includes_objects', objs)
+
+
+def reduce_objects(bld, tgt_list):
+    '''reduce objects by looking for indirect object dependencies'''
+    rely_on = {}
+
+    for t in tgt_list:
+        t.extended_objects = None
+
+    changed = False
+
+    for type in ['BINARY', 'PYTHON', 'LIBRARY']:
+        for t in tgt_list:
+            if t.samba_type != type: continue
+            # if we will indirectly link to a target then we don't need it
+            new = t.final_objects.copy()
+            for l in t.final_libs:
+                t2 = bld.name_to_obj(l, bld.env)
+                t2_obj = extended_objects(bld, t2, set())
+                dup = new.intersection(t2_obj)
+                if t.sname in rely_on:
+                    dup = dup.difference(rely_on[t.sname])
+                if dup:
+                    debug('deps: removing dups from %s of type %s: %s also in %s %s',
+                          t.sname, t.samba_type, dup, t2.samba_type, l)
+                    new = new.difference(dup)
+                    changed = True
+                    if not l in rely_on:
+                        rely_on[l] = set()
+                    rely_on[l] = rely_on[l].union(dup)
+            t.final_objects = new
+
+    if not changed:
+        return False
+
+    # add back in any objects that were relied upon by the reduction rules
+    for r in rely_on:
+        t = bld.name_to_obj(r, bld.env)
+        t.final_objects = t.final_objects.union(rely_on[r])
+
+    return True
+
+
+def calculate_final_deps(bld, tgt_list, loops):
+    '''calculate the final library and object dependencies'''
+    for t in tgt_list:
+        # start with the maximum possible list
+        t.final_libs    = t.direct_libs.union(indirect_libs(bld, t, set(), loops))
+        t.final_objects = t.direct_objects.union(indirect_objects(bld, t, set(), loops))
+
+    for t in tgt_list:
+        # don't depend on ourselves
+        if t.sname in t.final_libs:
+            t.final_libs.remove(t.sname)
+        if t.sname in t.final_objects:
+            t.final_objects.remove(t.sname)
+
+    # handle any non-shared binaries
+    for t in tgt_list:
+        if t.samba_type == 'BINARY' and bld.NONSHARED_BINARY(t.sname):
+            # replace lib deps with objlist deps
+            for l in t.final_libs:
+                objname = l + '.objlist'
+                t2 = bld.name_to_obj(objname, bld.env)
+                if t2 is None:
+                    Logs.error('ERROR: subsystem %s not found' % objname)
+                    sys.exit(1)
+                t.final_objects.add(objname)
+                t.final_objects = t.final_objects.union(extended_objects(bld, t2, set()))
+            t.final_libs = set()
+
+    # find any library loops
+    for t in tgt_list:
+        if t.samba_type in ['LIBRARY', 'PYTHON']:
+            for l in t.final_libs.copy():
+                t2 = bld.name_to_obj(l, bld.env)
+                if t.sname in t2.final_libs:
+                    # we could break this in either direction. If one of the libraries
+                    # has a version number, and will this be distributed publicly, then
+                    # we should make it the lower level library in the DAG
+                    debug('deps: removing library loop %s from %s', t.sname, t2.sname)
+                    dependency_loop(loops, t, t2.sname)
+                    t2.final_libs.remove(t.sname)
+
+
+    for loop in loops:
+        debug('deps: Found dependency loops for target %s : %s', loop, loops[loop])
+
+    # we now need to make corrections for any library loops we broke up
+    # any target that depended on the target of the loop and doesn't
+    # depend on the source of the loop needs to get the loop source added
+    for type in ['BINARY','PYTHON','LIBRARY','BINARY']:
+        for t in tgt_list:
+            if t.samba_type != type: continue
+            for loop in loops:
+                if loop in t.final_libs:
+                    diff = loops[loop].difference(t.final_libs)
+                    if t.sname in diff:
+                        diff.remove(t.sname)
+                    if t.sname in diff:
+                        diff.remove(t.sname)
+                    # make sure we don't recreate the loop again!
+                    for d in diff.copy():
+                        t2 = bld.name_to_obj(d, bld.env)
+                        if t2.samba_type == 'LIBRARY':
+                            if t.sname in t2.final_libs:
+                                debug('deps: removing expansion %s from %s', d, t.sname)
+                                diff.remove(d)
+                    if diff:
+                        debug('deps: Expanded target %s by loop %s libraries (loop %s) %s', t.sname, loop,
+                              loops[loop], diff)
+                        t.final_libs = t.final_libs.union(diff)
+
+    # remove objects that are also available in linked libs
+    count = 0
+    while reduce_objects(bld, tgt_list):
+        count += 1
+        if count > 100:
+            Logs.warn("WARNING: Unable to remove all inter-target object duplicates")
+            break
+    debug('deps: Object reduction took %u iterations', count)
+
+    # add in any syslib dependencies
+    for t in tgt_list:
+        if not t.samba_type in ['BINARY','PYTHON','LIBRARY']:
+            continue
+        syslibs = set()
+        for d in t.final_objects:
+            t2 = bld.name_to_obj(d, bld.env)
+            syslibs = syslibs.union(t2.direct_syslibs)
+        # this adds the indirect syslibs as well, which may not be needed
+        # depending on the linker flags
+        for d in t.final_libs:
+            t2 = bld.name_to_obj(d, bld.env)
+            syslibs = syslibs.union(t2.direct_syslibs)
+        t.final_syslibs = syslibs
+
+
+    # find any unresolved library loops
+    lib_loop_error = False
+    for t in tgt_list:
+        if t.samba_type in ['LIBRARY', 'PYTHON']:
+            for l in t.final_libs.copy():
+                t2 = bld.name_to_obj(l, bld.env)
+                if t.sname in t2.final_libs:
+                    Logs.error('ERROR: Unresolved library loop %s from %s' % (t.sname, t2.sname))
+                    lib_loop_error = True
+    if lib_loop_error:
+        sys.exit(1)
+
+    debug('deps: removed duplicate dependencies')
+
+
+######################################################################
+# this provides a way to save our dependency calculations between runs
+savedeps_version = 3
+savedeps_inputs  = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags', 'source']
+savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags']
+savedeps_outenv  = ['INC_PATHS']
+savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES']
+savedeps_caches  = ['GLOBAL_DEPENDENCIES', 'TARGET_ALIAS', 'TARGET_TYPE', 'INIT_FUNCTIONS', 'SYSLIB_DEPS']
+savedeps_files   = ['buildtools/wafsamba/samba_deps.py']
+
+def save_samba_deps(bld, tgt_list):
+    '''save the dependency calculations between builds, to make
+       further builds faster'''
+    denv = Environment.Environment()
+
+    denv.version = savedeps_version
+    denv.savedeps_inputs = savedeps_inputs
+    denv.savedeps_outputs = savedeps_outputs
+    denv.input = {}
+    denv.output = {}
+    denv.outenv = {}
+    denv.caches = {}
+    denv.envvar = {}
+    denv.files  = {}
+
+    for f in savedeps_files:
+        denv.files[f] = os.stat(os.path.join(bld.srcnode.abspath(), f)).st_mtime
+
+    for c in savedeps_caches:
+        denv.caches[c] = LOCAL_CACHE(bld, c)
+
+    for e in savedeps_envvars:
+        denv.envvar[e] = bld.env[e]
+
+    for t in tgt_list:
+        # save all the input attributes for each target
+        tdeps = {}
+        for attr in savedeps_inputs:
+            v = getattr(t, attr, None)
+            if v is not None:
+                tdeps[attr] = v
+        if tdeps != {}:
+            denv.input[t.sname] = tdeps
+
+        # save all the output attributes for each target
+        tdeps = {}
+        for attr in savedeps_outputs:
+            v = getattr(t, attr, None)
+            if v is not None:
+                tdeps[attr] = v
+        if tdeps != {}:
+            denv.output[t.sname] = tdeps
+
+        tdeps = {}
+        for attr in savedeps_outenv:
+            if attr in t.env:
+                tdeps[attr] = t.env[attr]
+        if tdeps != {}:
+            denv.outenv[t.sname] = tdeps
+
+    depsfile = os.path.join(bld.bdir, "sambadeps")
+    denv.store(depsfile)
+
+
+
+def load_samba_deps(bld, tgt_list):
+    '''load a previous set of build dependencies if possible'''
+    depsfile = os.path.join(bld.bdir, "sambadeps")
+    denv = Environment.Environment()
+    try:
+        debug('deps: checking saved dependencies')
+        denv.load(depsfile)
+        if (denv.version != savedeps_version or
+            denv.savedeps_inputs != savedeps_inputs or
+            denv.savedeps_outputs != savedeps_outputs):
+            return False
+    except:
+        return False
+
+    # check if critical files have changed
+    for f in savedeps_files:
+        if f not in denv.files:
+            return False
+        if denv.files[f] != os.stat(os.path.join(bld.srcnode.abspath(), f)).st_mtime:
+            return False
+
+    # check if caches are the same
+    for c in savedeps_caches:
+        if c not in denv.caches or denv.caches[c] != LOCAL_CACHE(bld, c):
+            return False
+
+    # check if caches are the same
+    for e in savedeps_envvars:
+        if e not in denv.envvar or denv.envvar[e] != bld.env[e]:
+            return False
+
+    # check inputs are the same
+    for t in tgt_list:
+        tdeps = {}
+        for attr in savedeps_inputs:
+            v = getattr(t, attr, None)
+            if v is not None:
+                tdeps[attr] = v
+        if t.sname in denv.input:
+            olddeps = denv.input[t.sname]
+        else:
+            olddeps = {}
+        if tdeps != olddeps:
+            #print '%s: \ntdeps=%s \nodeps=%s' % (t.sname, tdeps, olddeps)
+            return False
+
+    # put outputs in place
+    for t in tgt_list:
+        if not t.sname in denv.output: continue
+        tdeps = denv.output[t.sname]
+        for a in tdeps:
+            setattr(t, a, tdeps[a])
+
+    # put output env vars in place
+    for t in tgt_list:
+        if not t.sname in denv.outenv: continue
+        tdeps = denv.outenv[t.sname]
+        for a in tdeps:
+            t.env[a] = tdeps[a]
+
+    debug('deps: loaded saved dependencies')
+    return True
+
+
+
+def check_project_rules(bld):
+    '''check the project rules - ensuring the targets are sane'''
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+    loops = {}
+    inc_loops = {}
+
+    # build a list of task generators we are interested in
+    tgt_list = []
+    for tgt in targets:
+        type = targets[tgt]
+        if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']:
+            continue
+        t = bld.name_to_obj(tgt, bld.env)
+        if t is None:
+            Logs.error("Target %s of type %s has no task generator" % (tgt, type))
+            sys.exit(1)
+        tgt_list.append(t)
+
+    add_samba_attributes(bld, tgt_list)
+
+    if load_samba_deps(bld, tgt_list):
+        return
+
+    Logs.info("Checking project rules ...")
+
+    debug('deps: project rules checking started')
+
+    expand_subsystem_deps(bld)
+    build_direct_deps(bld, tgt_list)
+    break_dependency_loops(bld, tgt_list)
+    calculate_final_deps(bld, tgt_list, loops)
+
+    # run the various attribute generators
+    for f in [ build_dependencies, build_includes, add_init_functions ]:
+        debug('deps: project rules checking %s', f)
+        for t in tgt_list: f(t)
+
+    debug('deps: project rules stage1 completed')
+
+    #check_orpaned_targets(bld, tgt_list)
+
+    if not check_duplicate_sources(bld, tgt_list):
+        Logs.error("Duplicate sources present - aborting")
+        sys.exit(1)
+
+    if not check_group_ordering(bld, tgt_list):
+        Logs.error("Bad group ordering - aborting")
+        sys.exit(1)
+
+    show_final_deps(bld, tgt_list)
+
+    debug('deps: project rules checking completed - %u targets checked',
+          len(tgt_list))
+
+    save_samba_deps(bld, tgt_list)
+
+    Logs.info("Project rules pass")
+
+
+def CHECK_PROJECT_RULES(bld):
+    '''enable checking of project targets for sanity'''
+    if bld.env.added_project_rules:
+        return
+    bld.env.added_project_rules = True
+    bld.add_pre_fun(check_project_rules)
+Build.BuildContext.CHECK_PROJECT_RULES = CHECK_PROJECT_RULES
+
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_dist.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_dist.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_dist.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,127 @@
+# customised version of 'waf dist' for Samba tools
+# uses git ls-files to get file lists
+
+import Utils, os, sys, tarfile, stat, Scripting, Logs
+from samba_utils import *
+
+dist_dirs = None
+
+def add_symlink(tar, fname, abspath, basedir):
+    '''handle symlinks to directories that may move during packaging'''
+    if not os.path.islink(abspath):
+        return False
+    tinfo = tar.gettarinfo(name=abspath, arcname=fname)
+    tgt = os.readlink(abspath)
+
+    if dist_dirs:
+        # we need to find the target relative to the main directory
+        # this is here to cope with symlinks into the buildtools
+        # directory from within the standalone libraries in Samba. For example,
+        # a symlink to ../../builtools/scripts/autogen-waf.sh needs
+        # to be rewritten as a symlink to buildtools/scripts/autogen-waf.sh
+        # when the tarball for talloc is built
+
+        # the filename without the appname-version
+        rel_fname = '/'.join(fname.split('/')[1:])
+
+        # join this with the symlink target
+        tgt_full = os.path.join(os.path.dirname(rel_fname), tgt)
+
+        # join with the base directory
+        tgt_base = os.path.normpath(os.path.join(basedir, tgt_full))
+
+        # see if this is inside one of our dist_dirs
+        for dir in dist_dirs.split():
+            if dir.find(':') != -1:
+                destdir=dir.split(':')[1]
+                dir=dir.split(':')[0]
+            else:
+                destdir = '.'
+            if dir == basedir:
+                # internal links don't get rewritten
+                continue
+            if dir == tgt_base[0:len(dir)] and tgt_base[len(dir)] == '/':
+                new_tgt = destdir + tgt_base[len(dir):]
+                tinfo.linkname = new_tgt
+                break
+
+    tinfo.uid   = 0
+    tinfo.gid   = 0
+    tinfo.uname = 'root'
+    tinfo.gname = 'root'
+    tar.addfile(tinfo)
+    return True
+
+def add_tarfile(tar, fname, abspath, basedir):
+    '''add a file to the tarball'''
+    if add_symlink(tar, fname, abspath, basedir):
+        return
+    try:
+        tinfo = tar.gettarinfo(name=abspath, arcname=fname)
+    except OSError:
+        Logs.error('Unable to find file %s - missing from git checkout?' % abspath)
+        sys.exit(1)
+    tinfo.uid   = 0
+    tinfo.gid   = 0
+    tinfo.uname = 'root'
+    tinfo.gname = 'root'
+    fh = open(abspath)
+    tar.addfile(tinfo, fileobj=fh)
+    fh.close()
+
+
+def dist(appname='',version=''):
+    if not isinstance(appname, str) or not appname:
+        # this copes with a mismatch in the calling arguments for dist()
+        appname = Utils.g_module.APPNAME
+        version = Utils.g_module.VERSION
+    if not version:
+        version = Utils.g_module.VERSION
+
+    srcdir = os.path.normpath(os.path.join(os.path.dirname(Utils.g_module.root_path), Utils.g_module.srcdir))
+
+    if not dist_dirs:
+        Logs.error('You must use samba_dist.DIST_DIRS() to set which directories to package')
+        sys.exit(1)
+
+    dist_base = '%s-%s' % (appname, version)
+    dist_name = '%s.tar.gz' % (dist_base)
+
+    tar = tarfile.open(dist_name, 'w:gz')
+
+    for dir in dist_dirs.split():
+        if dir.find(':') != -1:
+            destdir=dir.split(':')[1]
+            dir=dir.split(':')[0]
+        else:
+            destdir = '.'
+        absdir = os.path.join(srcdir, dir)
+        git_cmd = [ 'git', 'ls-files', '--full-name', absdir ]
+        try:
+            files = Utils.cmd_output(git_cmd).split()
+        except:
+            Logs.error('git command failed: %s' % ' '.join(git_cmd))
+            sys.exit(1)
+        for f in files:
+            abspath = os.path.join(srcdir, f)
+            if dir != '.':
+                f = f[len(dir)+1:]
+            if destdir != '.':
+                f = destdir + '/' + f
+            fname = dist_base + '/' + f
+            add_tarfile(tar, fname, abspath, dir)
+
+    tar.close()
+
+    Logs.info('Created %s' % dist_name)
+    return dist_name
+
+
+ at conf
+def DIST_DIRS(dirs):
+    '''set the directories to package, relative to top srcdir'''
+    global dist_dirs
+    if not dist_dirs:
+        dist_dirs = dirs
+
+Scripting.dist = dist

Added: branches/talloc/experimental/buildtools/wafsamba/samba_errtable.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_errtable.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_errtable.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,27 @@
+# waf build tool for building .et files with compile_et
+import Build
+from samba_utils import *
+
+def SAMBA_ERRTABLE(bld, name, source):
+    '''Build a heimdal errtable from a .et file'''
+
+    bname = source[0:-3]; # strip off the .et suffix
+
+    if not SET_TARGET_TYPE(bld, name, 'ET'):
+        return
+
+    bld.SET_BUILD_GROUP('build_source')
+
+    out_files = []
+    out_files.append('%s.c' % bname)
+    out_files.append('%s.h' % bname)
+
+    t = bld(rule='${SRC[1].abspath(env)} . ${TGT[0].parent.abspath(env)} default/source4/heimdal_build/compile_et ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
+            ext_out = '.c',
+            before  = 'cc',
+            on_results = True,
+            shell   = True,
+            source  = [source, 'et_compile_wrapper.sh', 'compile_et'],
+            target  = out_files,
+            name    = name)
+Build.BuildContext.SAMBA_ERRTABLE = SAMBA_ERRTABLE

Added: branches/talloc/experimental/buildtools/wafsamba/samba_install.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_install.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_install.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,170 @@
+###########################
+# this handles the magic we need to do for installing
+# with all the configure options that affect rpath and shared
+# library use
+
+import Options
+from TaskGen import feature, before, after
+from samba_utils import *
+
+O755 = 493
+
+ at feature('install_bin')
+ at after('apply_core')
+ at before('apply_link', 'apply_obj_vars')
+def install_binary(self):
+    '''install a binary, taking account of the different rpath varients'''
+    bld = self.bld
+
+    # get the ldflags we will use for install and build
+    install_ldflags = install_rpath(bld)
+    build_ldflags   = build_rpath(bld)
+
+    if not Options.is_install or not self.samba_install:
+        # just need to set rpath if we are not installing
+        self.env.RPATH = build_ldflags
+        return
+
+    # work out the install path, expanding variables
+    install_path = self.samba_inst_path or '${BINDIR}'
+    install_path = bld.EXPAND_VARIABLES(install_path)
+
+    orig_target = os.path.basename(self.target)
+
+    if install_ldflags != build_ldflags:
+        # we will be creating a new target name, and using that for the
+        # install link. That stops us from overwriting the existing build
+        # target, which has different ldflags
+        self.target += '.inst'
+
+    # setup the right rpath link flags for the install
+    self.env.RPATH = install_ldflags
+
+    # tell waf to install the right binary
+    bld.install_as(os.path.join(install_path, orig_target),
+                   os.path.join(self.path.abspath(bld.env), self.target),
+                   chmod=O755)
+
+
+
+ at feature('install_lib')
+ at after('apply_core')
+ at before('apply_link', 'apply_obj_vars')
+def install_library(self):
+    '''install a library, taking account of the different rpath varients'''
+    if getattr(self, 'done_install_library', False):
+        return
+
+    bld = self.bld
+
+    install_ldflags = install_rpath(bld)
+    build_ldflags   = build_rpath(bld)
+
+    if not Options.is_install or not self.samba_install:
+        # just need to set the build rpath if we are not installing
+        self.env.RPATH = build_ldflags
+        return
+
+    # setup the install path, expanding variables
+    install_path = self.samba_inst_path or '${LIBDIR}'
+    install_path = bld.EXPAND_VARIABLES(install_path)
+
+    if install_ldflags != build_ldflags:
+        # we will be creating a new target name, and using that for the
+        # install link. That stops us from overwriting the existing build
+        # target, which has different ldflags
+        self.done_install_library = True
+        t = self.clone('default')
+        t.posted = False
+        t.target += '.inst'
+        self.env.RPATH = build_ldflags
+    else:
+        t = self
+
+    t.env.RPATH = install_ldflags
+
+    dev_link     = None
+
+    if self.samba_realname:
+        install_name = self.samba_realname
+        install_link = None
+        if getattr(self, 'samba_type', None) == 'PYTHON':
+            inst_name    = '%s.so' % t.target
+        else:
+            inst_name    = 'lib%s.so' % t.target
+    elif self.vnum:
+        vnum_base    = self.vnum.split('.')[0]
+        install_name = 'lib%s.so.%s' % (self.target, self.vnum)
+        install_link = 'lib%s.so.%s' % (self.target, vnum_base)
+        inst_name    = 'lib%s.so' % t.target
+        if self.target == self.name:
+            # only generate the dev link for non-bundled libs
+            dev_link     = 'lib%s.so' % self.target
+    else:
+        install_name = 'lib%s.so' % self.target
+        install_link = None
+        inst_name    = 'lib%s.so' % t.target
+
+    # tell waf to install the library
+    bld.install_as(os.path.join(install_path, install_name),
+                   os.path.join(self.path.abspath(bld.env), inst_name))
+    if install_link:
+        # and the symlink if needed
+        bld.symlink_as(os.path.join(install_path, install_link),
+                       install_name)
+    if dev_link:
+        bld.symlink_as(os.path.join(install_path, dev_link),
+                       install_name)
+
+
+
+##############################
+# handle the creation of links for libraries and binaries in the build tree
+
+ at feature('symlink_lib')
+ at after('apply_link')
+def symlink_lib(self):
+    '''symlink a shared lib'''
+
+    if self.target.endswith('.inst'):
+        return
+
+    blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env))
+    libpath = self.link_task.outputs[0].abspath(self.env)
+
+    # calculat the link target and put it in the environment
+    soext=""
+    vnum = getattr(self, 'vnum', None)
+    if vnum is not None:
+        soext = '.' + vnum.split('.')[0]
+
+    link_target = getattr(self, 'link_name', '')
+    if link_target == '':
+        link_target = '%s/lib%s.so%s' % (LIB_PATH, self.target, soext)
+
+    link_target = os.path.join(blddir, link_target)
+
+    if os.path.lexists(link_target):
+        if os.path.islink(link_target) and os.readlink(link_target) == libpath:
+            return
+        os.unlink(link_target)
+    os.symlink(libpath, link_target)
+
+
+ at feature('symlink_bin')
+ at after('apply_link')
+def symlink_bin(self):
+    '''symlink a binary into the build directory'''
+
+    if self.target.endswith('.inst'):
+        return
+
+    blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env))
+    binpath = self.link_task.outputs[0].abspath(self.env)
+    bldpath = os.path.join(self.bld.env.BUILD_DIRECTORY, self.link_task.outputs[0].name)
+
+    if os.path.lexists(bldpath):
+        if os.path.islink(bldpath) and os.readlink(bldpath) == binpath:
+            return
+        os.unlink(bldpath)
+    os.symlink(binpath, bldpath)

Added: branches/talloc/experimental/buildtools/wafsamba/samba_optimisation.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_optimisation.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_optimisation.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,150 @@
+# This file contains waf optimisations for Samba
+
+# most of these optimisations are possible because of the restricted build environment
+# that Samba has. For example, Samba doesn't attempt to cope with Win32 paths during the
+# build, and Samba doesn't need build varients
+
+# overall this makes some build tasks quite a bit faster
+
+from TaskGen import feature, after
+import preproc
+
+ at feature('cc', 'cxx')
+ at after('apply_type_vars', 'apply_lib_vars', 'apply_core')
+def apply_incpaths(self):
+	lst = []
+
+	try:
+		kak = self.bld.kak
+	except AttributeError:
+		kak = self.bld.kak = {}
+
+	# TODO move the uselib processing out of here
+	for lib in self.to_list(self.uselib):
+		for path in self.env['CPPPATH_' + lib]:
+			if not path in lst:
+				lst.append(path)
+	if preproc.go_absolute:
+		for path in preproc.standard_includes:
+			if not path in lst:
+				lst.append(path)
+
+	for path in self.to_list(self.includes):
+		if not path in lst:
+			if preproc.go_absolute or path[0] != '/': #os.path.isabs(path):
+				lst.append(path)
+			else:
+				self.env.prepend_value('CPPPATH', path)
+
+	for path in lst:
+		node = None
+		if path[0] == '/': # os.path.isabs(path):
+			if preproc.go_absolute:
+				node = self.bld.root.find_dir(path)
+		elif path[0] == '#':
+			node = self.bld.srcnode
+			if len(path) > 1:
+				try:
+					node = kak[path]
+				except KeyError:
+					kak[path] = node = node.find_dir(path[1:])
+		else:
+			try:
+				node = kak[(self.path.id, path)]
+			except KeyError:
+				kak[(self.path.id, path)] = node = self.path.find_dir(path)
+
+		if node:
+			self.env.append_value('INC_PATHS', node)
+
+ at feature('cc')
+ at after('apply_incpaths')
+def apply_obj_vars_cc(self):
+    """after apply_incpaths for INC_PATHS"""
+    env = self.env
+    app = env.append_unique
+    cpppath_st = env['CPPPATH_ST']
+
+    lss = env['_CCINCFLAGS']
+
+    try:
+         cac = self.bld.cac
+    except AttributeError:
+         cac = self.bld.cac = {}
+
+    # local flags come first
+    # set the user-defined includes paths
+    for i in env['INC_PATHS']:
+
+        try:
+            lss.extend(cac[i.id])
+        except KeyError:
+
+            cac[i.id] = [cpppath_st % i.bldpath(env), cpppath_st % i.srcpath(env)]
+            lss.extend(cac[i.id])
+
+    env['_CCINCFLAGS'] = lss
+    # set the library include paths
+    for i in env['CPPPATH']:
+        app('_CCINCFLAGS', cpppath_st % i)
+
+import Node, Environment
+
+def vari(self):
+	return "default"
+Environment.Environment.variant = vari
+
+def variant(self, env):
+	if not env: return 0
+	elif self.id & 3 == Node.FILE: return 0
+	else: return "default"
+Node.Node.variant = variant
+
+
+import TaskGen, Task
+
+def create_task(self, name, src=None, tgt=None):
+    task = Task.TaskBase.classes[name](self.env, generator=self)
+    if src:
+        task.set_inputs(src)
+    if tgt:
+        task.set_outputs(tgt)
+    return task
+TaskGen.task_gen.create_task = create_task
+
+def hash_constraints(self):
+	a = self.attr
+	sum = hash((str(a('before', '')),
+            str(a('after', '')),
+            str(a('ext_in', '')),
+            str(a('ext_out', '')),
+            self.__class__.maxjobs))
+	return sum
+Task.TaskBase.hash_constraints = hash_constraints
+
+
+# import cc
+# from TaskGen import extension
+# import Utils
+
+# @extension(cc.EXT_CC)
+# def c_hook(self, node):
+# 	task = self.create_task('cc', node, node.change_ext('.o'))
+# 	try:
+# 		self.compiled_tasks.append(task)
+# 	except AttributeError:
+# 		raise Utils.WafError('Have you forgotten to set the feature "cc" on %s?' % str(self))
+
+# 	bld = self.bld
+# 	try:
+# 		dc = bld.dc
+# 	except AttributeError:
+# 		dc = bld.dc = {}
+
+# 	if task.outputs[0].id in dc:
+# 		raise Utils.WafError('Samba, you are doing it wrong %r %s %s' % (task.outputs, task.generator, dc[task.outputs[0].id].generator))
+# 	else:
+# 		dc[task.outputs[0].id] = task
+
+# 	return task
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_patterns.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_patterns.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_patterns.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,17 @@
+# a waf tool to add extension based build patterns for Samba
+
+import Task
+from TaskGen import extension
+from samba_utils import *
+
+def SAMBA_MKVERSION(bld, target):
+    '''generate the version.h header for Samba'''
+    bld.SET_BUILD_GROUP('setup')
+    t = bld(rule="cd .. && ${SRC[0].abspath(env)} VERSION ${TGT[0].abspath(env)}",
+            source= [ "script/mkversion.sh", 'VERSION' ],
+            target=target,
+            shell=True,
+            on_results=True,
+            before="cc")
+Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_pidl.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_pidl.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_pidl.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,142 @@
+# waf build tool for building IDL files with pidl
+
+from TaskGen import before
+import Build, os
+from samba_utils import *
+
+def SAMBA_PIDL(bld, pname, source,
+               options='',
+               output_dir='.',
+               symlink=False,
+               generate_tables=True):
+    '''Build a IDL file using pidl.
+       This will produce up to 13 output files depending on the options used'''
+
+    bname = source[0:-4]; # strip off the .idl suffix
+    bname = os.path.basename(bname)
+    name = "%s_%s" % (pname, bname.upper())
+
+    if not SET_TARGET_TYPE(bld, name, 'PIDL'):
+        return
+
+    bld.SET_BUILD_GROUP('build_source')
+
+    # the output files depend on the options used. Use this dictionary
+    # to map between the options and the resulting file names
+    options_map = { '--header'            : '%s.h',
+                    '--ndr-parser'        : 'ndr_%s.c ndr_%s.h',
+                    '--samba3-ndr-server' : 'srv_%s.c srv_%s.h',
+                    '--samba3-ndr-client' : 'cli_%s.c cli_%s.h',
+                    '--server'            : 'ndr_%s_s.c',
+                    '--client'            : 'ndr_%s_c.c ndr_%s_c.h',
+                    '--python'            : 'py_%s.c',
+                    '--tdr-parser'        : 'tdr_%s.c tdr_%s.h',
+                    '--dcom-proxy'	  : '%s_p.c',
+                    '--com-header'	  : 'com_%s.h'
+                    }
+
+    table_header_idx = None
+    out_files = []
+    options_list = TO_LIST(options)
+
+    for o in options_list:
+        if o in options_map:
+            ofiles = TO_LIST(options_map[o])
+            for f in ofiles:
+                out_files.append(os.path.join(output_dir, f % bname))
+                if f == 'ndr_%s.h':
+                    # remember this one for the tables generation
+                    table_header_idx = len(out_files) - 1
+
+    # depend on the full pidl sources
+    source = TO_LIST(source)
+    try:
+        pidl_src_nodes = bld.pidl_files_cache
+    except AttributeError:
+        bld.pidl_files_cache = bld.srcnode.ant_glob('pidl/lib/Parse/**/*.pm', flat=False)
+        bld.pidl_files_cache.extend(bld.srcnode.ant_glob('pidl', flat=False))
+        pidl_src_nodes = bld.pidl_files_cache
+
+    # the cd .. is needed because pidl currently is sensitive to the directory it is run in
+    t = bld(rule='cd .. && ${PERL} ${PIDL} --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- ${SRC[0].abspath(env)}',
+            ext_out    = '.c',
+            before     = 'cc',
+            on_results = True,
+            shell      = True,
+            source     = source,
+            target     = out_files,
+            name       = name,
+            samba_type = 'PIDL')
+
+    # prime the list of nodes we are dependent on with the cached pidl sources
+    t.allnodes = pidl_src_nodes
+
+    t.env.PIDL = os.path.join(bld.srcnode.abspath(), 'pidl/pidl')
+    t.env.OPTIONS = TO_LIST(options)
+
+    # this rather convoluted set of path calculations is to cope with the possibility
+    # that gen_ndr is a symlink into the source tree. By doing this for the source3
+    # gen_ndr directory we end up generating identical output in gen_ndr for the old
+    # build system and the new one. That makes keeping things in sync much easier.
+    # eventually we should drop the gen_ndr files in git, but in the meanwhile this works
+    outdir = bld.path.find_dir(output_dir).abspath(t.env)
+
+    if symlink and not os.path.lexists(outdir):
+        link_source = os.path.normpath(os.path.join(bld.curdir,output_dir))
+        os.symlink(link_source, outdir)
+
+    real_outputdir = os.path.realpath(outdir)
+    t.env.OUTPUTDIR = os_path_relpath(real_outputdir, os.path.dirname(bld.env.BUILD_DIRECTORY))
+
+    if generate_tables and table_header_idx is not None:
+        pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS')
+        pidl_headers[name] = [bld.path.find_or_declare(out_files[table_header_idx])]
+
+    t.more_includes = '#' + bld.path.relpath_gen(bld.srcnode)
+Build.BuildContext.SAMBA_PIDL = SAMBA_PIDL
+
+
+def SAMBA_PIDL_LIST(bld, name, source,
+                    options='',
+                    output_dir='.',
+                    symlink=False,
+                    generate_tables=True):
+    '''A wrapper for building a set of IDL files'''
+    for p in TO_LIST(source):
+        bld.SAMBA_PIDL(name, p, options=options, output_dir=output_dir, symlink=symlink, generate_tables=generate_tables)
+Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST
+
+
+#################################################################
+# the rule for generating the NDR tables
+from TaskGen import feature, before
+ at feature('collect')
+ at before('exec_rule')
+def collect(self):
+    pidl_headers = LOCAL_CACHE(self.bld, 'PIDL_HEADERS')
+    for (name, hd) in pidl_headers.items():
+        y = self.bld.name_to_obj(name, self.env)
+        self.bld.ASSERT(y is not None, 'Failed to find PIDL header %s' % name)
+        y.post()
+        for node in hd:
+            self.bld.ASSERT(node is not None, 'Got None as build node generating PIDL table for %s' % name)
+            self.source += " " + node.relpath_gen(self.path)
+
+
+def SAMBA_PIDL_TABLES(bld, name, target):
+    '''generate the pidl NDR tables file'''
+    headers = bld.env.PIDL_HEADERS
+    bld.SET_BUILD_GROUP('main')
+    t = bld(
+            features = 'collect',
+            rule     = '${PERL} ${SRC} --output ${TGT} | sed "s|default/||" > ${TGT}',
+            ext_out  = '.c',
+            before   = 'cc',
+            on_results = True,
+            shell    = True,
+            source   = '../../librpc/tables.pl',
+            target   = target,
+            name     = name)
+    t.env.LIBRPC = os.path.join(bld.srcnode.abspath(), 'librpc')
+Build.BuildContext.SAMBA_PIDL_TABLES = SAMBA_PIDL_TABLES
+

Added: branches/talloc/experimental/buildtools/wafsamba/samba_python.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_python.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_python.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,60 @@
+# waf build tool for building IDL files with pidl
+
+import Build
+from samba_utils import *
+from samba_autoconf import *
+
+
+def SAMBA_PYTHON(bld, name,
+                 source='',
+                 deps='',
+                 public_deps='',
+                 realname=None,
+                 cflags='',
+                 includes='',
+                 init_function_sentinal=None,
+                 local_include=True,
+                 vars=None,
+                 enabled=True):
+    '''build a python extension for Samba'''
+
+    # when we support static python modules we'll need to gather
+    # the list from all the SAMBA_PYTHON() targets
+    if init_function_sentinal is not None:
+        cflags += '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinal
+
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+
+    if realname is None:
+        # a SAMBA_PYTHON target without a realname is just a
+        # library with needs_python=True
+        bld.SAMBA_LIBRARY(name,
+                          source=source,
+                          deps=deps,
+                          public_deps=public_deps,
+                          includes=includes,
+                          cflags=cflags,
+                          local_include=local_include,
+                          vars=vars,
+                          needs_python=True,
+                          enabled=enabled)
+        return
+
+    link_name = 'python/%s' % realname
+
+    bld.SAMBA_LIBRARY(name,
+                      source=source,
+                      deps=deps,
+                      public_deps=public_deps,
+                      includes=includes,
+                      cflags=cflags,
+                      realname=realname,
+                      local_include=local_include,
+                      vars=vars,
+                      link_name=link_name,
+                      needs_python=True,
+                      target_type='PYTHON',
+                      install_path='${PYTHONDIR}',
+                      enabled=enabled)
+
+Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON

Added: branches/talloc/experimental/buildtools/wafsamba/samba_utils.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_utils.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_utils.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,522 @@
+# a waf tool to add autoconf-like macros to the configure section
+# and for SAMBA_ macros for building libraries, binaries etc
+
+import Build, os, sys, Options, Utils, Task, re, fnmatch, Logs
+from TaskGen import feature, before
+from Configure import conf
+from Logs import debug
+import shlex
+
+# TODO: make this a --option
+LIB_PATH="shared"
+
+
+ at conf
+def SET_TARGET_TYPE(ctx, target, value):
+    '''set the target type of a target'''
+    cache = LOCAL_CACHE(ctx, 'TARGET_TYPE')
+    if target in cache and cache[target] != 'EMPTY':
+        Logs.error("ERROR: Target '%s' in directory %s re-defined as %s - was %s" % (target,
+                                                                                     ctx.curdir,
+                                                                                     value, cache[target]))
+        sys.exit(1)
+    LOCAL_CACHE_SET(ctx, 'TARGET_TYPE', target, value)
+    debug("task_gen: Target '%s' created of type '%s' in %s" % (target, value, ctx.curdir))
+    return True
+
+
+def GET_TARGET_TYPE(ctx, target):
+    '''get target type from cache'''
+    cache = LOCAL_CACHE(ctx, 'TARGET_TYPE')
+    if not target in cache:
+        return None
+    return cache[target]
+
+
+######################################################
+# this is used as a decorator to make functions only
+# run once. Based on the idea from
+# http://stackoverflow.com/questions/815110/is-there-a-decorator-to-simply-cache-function-return-values
+runonce_ret = {}
+def runonce(function):
+    def runonce_wrapper(*args):
+        if args in runonce_ret:
+            return runonce_ret[args]
+        else:
+            ret = function(*args)
+            runonce_ret[args] = ret
+            return ret
+    return runonce_wrapper
+
+
+def ADD_LD_LIBRARY_PATH(path):
+    '''add something to LD_LIBRARY_PATH'''
+    if 'LD_LIBRARY_PATH' in os.environ:
+        oldpath = os.environ['LD_LIBRARY_PATH']
+    else:
+        oldpath = ''
+    newpath = oldpath.split(':')
+    if not path in newpath:
+        newpath.append(path)
+        os.environ['LD_LIBRARY_PATH'] = ':'.join(newpath)
+
+
+def install_rpath(bld):
+    '''the rpath value for installation'''
+    bld.env['RPATH'] = []
+    if bld.env.RPATH_ON_INSTALL:
+        return ['%s/lib' % bld.env.PREFIX]
+    return []
+
+
+def build_rpath(bld):
+    '''the rpath value for build'''
+    rpath = os.path.normpath('%s/%s' % (bld.env.BUILD_DIRECTORY, LIB_PATH))
+    bld.env['RPATH'] = []
+    if bld.env.RPATH_ON_BUILD:
+        return [rpath]
+    ADD_LD_LIBRARY_PATH(rpath)
+    return []
+
+
+ at conf
+def LOCAL_CACHE(ctx, name):
+    '''return a named build cache dictionary, used to store
+       state inside other functions'''
+    if name in ctx.env:
+        return ctx.env[name]
+    ctx.env[name] = {}
+    return ctx.env[name]
+
+
+ at conf
+def LOCAL_CACHE_SET(ctx, cachename, key, value):
+    '''set a value in a local cache'''
+    cache = LOCAL_CACHE(ctx, cachename)
+    cache[key] = value
+
+
+ at conf
+def ASSERT(ctx, expression, msg):
+    '''a build assert call'''
+    if not expression:
+        Logs.error("ERROR: %s\n" % msg)
+        raise AssertionError
+Build.BuildContext.ASSERT = ASSERT
+
+
+def SUBDIR(bld, subdir, list):
+    '''create a list of files by pre-pending each with a subdir name'''
+    ret = ''
+    for l in TO_LIST(list):
+        ret = ret + os.path.normpath(os.path.join(subdir, l)) + ' '
+    return ret
+Build.BuildContext.SUBDIR = SUBDIR
+
+
+def dict_concat(d1, d2):
+    '''concatenate two dictionaries d1 += d2'''
+    for t in d2:
+        if t not in d1:
+            d1[t] = d2[t]
+
+
+def exec_command(self, cmd, **kw):
+    '''this overrides the 'waf -v' debug output to be in a nice
+    unix like format instead of a python list.
+    Thanks to ita on #waf for this'''
+    import Utils, Logs
+    _cmd = cmd
+    if isinstance(cmd, list):
+        _cmd = ' '.join(cmd)
+    debug('runner: %s' % _cmd)
+    if self.log:
+        self.log.write('%s\n' % cmd)
+        kw['log'] = self.log
+    try:
+        if not kw.get('cwd', None):
+            kw['cwd'] = self.cwd
+    except AttributeError:
+        self.cwd = kw['cwd'] = self.bldnode.abspath()
+    return Utils.exec_command(cmd, **kw)
+Build.BuildContext.exec_command = exec_command
+
+
+def ADD_COMMAND(opt, name, function):
+    '''add a new top level command to waf'''
+    Utils.g_module.__dict__[name] = function
+    opt.name = function
+Options.Handler.ADD_COMMAND = ADD_COMMAND
+
+
+ at feature('cc', 'cshlib', 'cprogram')
+ at before('apply_core','exec_rule')
+def process_depends_on(self):
+    '''The new depends_on attribute for build rules
+       allow us to specify a dependency on output from
+       a source generation rule'''
+    if getattr(self , 'depends_on', None):
+        lst = self.to_list(self.depends_on)
+        for x in lst:
+            y = self.bld.name_to_obj(x, self.env)
+            self.bld.ASSERT(y is not None, "Failed to find dependency %s of %s" % (x, self.name))
+            y.post()
+            if getattr(y, 'more_includes', None):
+                  self.includes += " " + y.more_includes
+
+
+os_path_relpath = getattr(os.path, 'relpath', None)
+if os_path_relpath is None:
+    # Python < 2.6 does not have os.path.relpath, provide a replacement
+    # (imported from Python2.6.5~rc2)
+    def os_path_relpath(path, start):
+        """Return a relative version of a path"""
+        start_list = os.path.abspath(start).split("/")
+        path_list = os.path.abspath(path).split("/")
+
+        # Work out how much of the filepath is shared by start and path.
+        i = len(os.path.commonprefix([start_list, path_list]))
+
+        rel_list = ['..'] * (len(start_list)-i) + path_list[i:]
+        if not rel_list:
+            return start
+        return os.path.join(*rel_list)
+
+
+def unique_list(seq):
+    '''return a uniquified list in the same order as the existing list'''
+    seen = {}
+    result = []
+    for item in seq:
+        if item in seen: continue
+        seen[item] = True
+        result.append(item)
+    return result
+
+
+def TO_LIST(str):
+    '''Split a list, preserving quoted strings and existing lists'''
+    if str is None:
+        return []
+    if isinstance(str, list):
+        return str
+    lst = str.split()
+    # the string may have had quotes in it, now we
+    # check if we did have quotes, and use the slower shlex
+    # if we need to
+    for e in lst:
+        if e[0] == '"':
+            return shlex.split(str)
+    return lst
+
+
+def subst_vars_error(string, env):
+    '''substitute vars, throw an error if a variable is not defined'''
+    lst = re.split('(\$\{\w+\})', string)
+    out = []
+    for v in lst:
+        if re.match('\$\{\w+\}', v):
+            vname = v[2:-1]
+            if not vname in env:
+                Logs.error("Failed to find variable %s in %s" % (vname, string))
+                sys.exit(1)
+            v = env[vname]
+        out.append(v)
+    return ''.join(out)
+
+
+ at conf
+def SUBST_ENV_VAR(ctx, varname):
+    '''Substitute an environment variable for any embedded variables'''
+    return subst_vars_error(ctx.env[varname], ctx.env)
+Build.BuildContext.SUBST_ENV_VAR = SUBST_ENV_VAR
+
+
+def ENFORCE_GROUP_ORDERING(bld):
+    '''enforce group ordering for the project. This
+       makes the group ordering apply only when you specify
+       a target with --target'''
+    if Options.options.compile_targets:
+        @feature('*')
+        @before('exec_rule', 'apply_core', 'collect')
+        def force_previous_groups(self):
+            if getattr(self.bld, 'enforced_group_ordering', False) == True:
+                return
+            self.bld.enforced_group_ordering = True
+
+            def group_name(g):
+                tm = self.bld.task_manager
+                return [x for x in tm.groups_names if id(tm.groups_names[x]) == id(g)][0]
+
+            my_id = id(self)
+            bld = self.bld
+            stop = None
+            for g in bld.task_manager.groups:
+                for t in g.tasks_gen:
+                    if id(t) == my_id:
+                        stop = id(g)
+                        debug('group: Forcing up to group %s for target %s',
+                              group_name(g), self.name or self.target)
+                        break
+                if stop != None:
+                    break
+            if stop is None:
+                return
+
+            for i in xrange(len(bld.task_manager.groups)):
+                g = bld.task_manager.groups[i]
+                bld.task_manager.current_group = i
+                if id(g) == stop:
+                    break
+                debug('group: Forcing group %s', group_name(g))
+                for t in g.tasks_gen:
+                    if not getattr(t, 'forced_groups', False):
+                        debug('group: Posting %s', t.name or t.target)
+                        t.forced_groups = True
+                        t.post()
+Build.BuildContext.ENFORCE_GROUP_ORDERING = ENFORCE_GROUP_ORDERING
+
+
+def recursive_dirlist(dir, relbase, pattern=None):
+    '''recursive directory list'''
+    ret = []
+    for f in os.listdir(dir):
+        f2 = dir + '/' + f
+        if os.path.isdir(f2):
+            ret.extend(recursive_dirlist(f2, relbase))
+        else:
+            if pattern and not fnmatch.fnmatch(f, pattern):
+                continue
+            ret.append(os_path_relpath(f2, relbase))
+    return ret
+
+
+def mkdir_p(dir):
+    '''like mkdir -p'''
+    if os.path.isdir(dir):
+        return
+    mkdir_p(os.path.dirname(dir))
+    os.mkdir(dir)
+
+
+def SUBST_VARS_RECURSIVE(string, env):
+    '''recursively expand variables'''
+    if string is None:
+        return string
+    limit=100
+    while (string.find('${') != -1 and limit > 0):
+        string = subst_vars_error(string, env)
+        limit -= 1
+    return string
+
+
+ at conf
+def EXPAND_VARIABLES(ctx, varstr, vars=None):
+    '''expand variables from a user supplied dictionary
+
+    This is most useful when you pass vars=locals() to expand
+    all your local variables in strings
+    '''
+
+    if isinstance(varstr, list):
+        ret = []
+        for s in varstr:
+            ret.append(EXPAND_VARIABLES(ctx, s, vars=vars))
+        return ret
+
+    import Environment
+    env = Environment.Environment()
+    ret = varstr
+    # substitute on user supplied dict if avaiilable
+    if vars is not None:
+        for v in vars.keys():
+            env[v] = vars[v]
+        ret = SUBST_VARS_RECURSIVE(ret, env)
+
+    # if anything left, subst on the environment as well
+    if ret.find('${') != -1:
+        ret = SUBST_VARS_RECURSIVE(ret, ctx.env)
+    # make sure there is nothing left. Also check for the common
+    # typo of $( instead of ${
+    if ret.find('${') != -1 or ret.find('$(') != -1:
+        Logs.error('Failed to substitute all variables in varstr=%s' % ret)
+        sys.exit(1)
+    return ret
+Build.BuildContext.EXPAND_VARIABLES = EXPAND_VARIABLES
+
+
+def RUN_COMMAND(cmd,
+                env=None,
+                shell=False):
+    '''run a external command, return exit code or signal'''
+    if env:
+        cmd = SUBST_VARS_RECURSIVE(cmd, env)
+
+    status = os.system(cmd)
+    if os.WIFEXITED(status):
+        return os.WEXITSTATUS(status)
+    if os.WIFSIGNALED(status):
+        return - os.WTERMSIG(status)
+    Logs.error("Unknown exit reason %d for command: %s" (status, cmd))
+    return -1
+
+
+# make sure we have md5. some systems don't have it
+try:
+    from hashlib import md5
+except:
+    try:
+        import md5
+    except:
+        import Constants
+        Constants.SIG_NIL = hash('abcd')
+        class replace_md5(object):
+            def __init__(self):
+                self.val = None
+            def update(self, val):
+                self.val = hash((self.val, val))
+            def digest(self):
+                return str(self.val)
+            def hexdigest(self):
+                return self.digest().encode('hex')
+        def replace_h_file(filename):
+            f = open(filename, 'rb')
+            m = replace_md5()
+            while (filename):
+                filename = f.read(100000)
+                m.update(filename)
+            f.close()
+            return m.digest()
+        Utils.md5 = replace_md5
+        Task.md5 = replace_md5
+        Utils.h_file = replace_h_file
+
+
+def LOAD_ENVIRONMENT():
+    '''load the configuration environment, allowing access to env vars
+       from new commands'''
+    import Environment
+    env = Environment.Environment()
+    env.load('.lock-wscript')
+    env.load(env.blddir + '/c4che/default.cache.py')
+    return env
+
+
+def IS_NEWER(bld, file1, file2):
+    '''return True if file1 is newer than file2'''
+    t1 = os.stat(os.path.join(bld.curdir, file1)).st_mtime
+    t2 = os.stat(os.path.join(bld.curdir, file2)).st_mtime
+    return t1 > t2
+Build.BuildContext.IS_NEWER = IS_NEWER
+
+
+ at conf
+def RECURSE(ctx, directory):
+    '''recurse into a directory, relative to the curdir or top level'''
+    try:
+        visited_dirs = ctx.visited_dirs
+    except:
+        visited_dirs = ctx.visited_dirs = set()
+    d = os.path.join(ctx.curdir, directory)
+    if os.path.exists(d):
+        abspath = os.path.abspath(d)
+    else:
+        abspath = os.path.abspath(os.path.join(Utils.g_module.srcdir, directory))
+    ctxclass = ctx.__class__.__name__
+    key = ctxclass + ':' + abspath
+    if key in visited_dirs:
+        # already done it
+        return
+    visited_dirs.add(key)
+    relpath = os_path_relpath(abspath, ctx.curdir)
+    if ctxclass == 'Handler':
+        return ctx.sub_options(relpath)
+    if ctxclass == 'ConfigurationContext':
+        return ctx.sub_config(relpath)
+    if ctxclass == 'BuildContext':
+        return ctx.add_subdirs(relpath)
+    Logs.error('Unknown RECURSE context class', ctxclass)
+    raise
+Options.Handler.RECURSE = RECURSE
+Build.BuildContext.RECURSE = RECURSE
+
+
+def CHECK_MAKEFLAGS(bld):
+    '''check for MAKEFLAGS environment variable in case we are being
+    called from a Makefile try to honor a few make command line flags'''
+    if not 'WAF_MAKE' in os.environ:
+        return
+    makeflags = os.environ.get('MAKEFLAGS')
+    jobs_set = False
+    for opt in makeflags.split():
+        # options can come either as -x or as x
+        if opt[0:2] == 'V=':
+            Options.options.verbose = Logs.verbose = int(opt[2:])
+            if Logs.verbose > 0:
+                Logs.zones = ['runner']
+            if Logs.verbose > 2:
+                Logs.zones = ['*']
+        elif opt[0].isupper() and opt.find('=') != -1:
+            loc = opt.find('=')
+            setattr(Options.options, opt[0:loc], opt[loc+1:])
+        elif opt[0] != '-':
+            for v in opt:
+                if v == 'j':
+                    jobs_set = True
+                elif v == 'k':
+                    Options.options.keep = True                
+        elif opt == '-j':
+            jobs_set = True
+        elif opt == '-k':
+            Options.options.keep = True                
+    if not jobs_set:
+        # default to one job
+        Options.options.jobs = 1
+            
+Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
+
+option_groups = {}
+
+def option_group(opt, name):
+    '''find or create an option group'''
+    global option_groups
+    if name in option_groups:
+        return option_groups[name]
+    gr = opt.add_option_group(name)
+    option_groups[name] = gr
+    return gr
+Options.Handler.option_group = option_group
+
+
+def save_file(filename, contents, create_dir=False):
+    '''save data to a file'''
+    if create_dir:
+        mkdir_p(os.path.dirname(filename))
+    try:
+        f = open(filename, 'w')
+        f.write(contents)
+        f.close()
+    except:
+        return False
+    return True
+
+
+def load_file(filename):
+    '''return contents of a file'''
+    try:
+        f = open(filename, 'r')
+        r = f.read()
+        f.close()
+    except:
+        return None
+    return r
+
+
+def reconfigure(ctx):
+    '''rerun configure if necessary'''
+    import Configure, samba_wildcard, Scripting
+    if not os.path.exists(".lock-wscript"):
+        raise Utils.WafError('configure has not been run')
+    bld = samba_wildcard.fake_build_environment()
+    Configure.autoconfig = True
+    Scripting.check_configured(bld)

Added: branches/talloc/experimental/buildtools/wafsamba/samba_wildcard.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/samba_wildcard.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/samba_wildcard.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,114 @@
+#! /usr/bin/env python
+
+# based on playground/evil in the waf svn tree
+
+import os, datetime
+import Scripting, Utils, Options, Logs, Environment, fnmatch
+from Constants import *
+
+def run_task(t, k):
+	'''run a single build task'''
+	ret = t.run()
+	if ret:
+		raise Utils.WafError("Failed to build %s: %u" % (k, ret))
+
+
+def run_named_build_task(cmd):
+	'''run a named build task, matching the cmd name using fnmatch
+	wildcards against inputs and outputs of all build tasks'''
+	bld = fake_build_environment()
+	found = False
+	cwd_node = bld.root.find_dir(os.getcwd())
+	cmd = os.path.normpath(cmd)
+	for g in bld.task_manager.groups:
+		for attr in ['outputs', 'inputs']:
+			for t in g.tasks:
+				s = getattr(t, attr, [])
+				for k in s:
+					relpath = k.relpath_gen(cwd_node)
+					if fnmatch.fnmatch(relpath, cmd):
+						t.position= [0,0]
+						print(t.display())
+						run_task(t, k)
+						return
+
+	if not found:
+		raise Utils.WafError("Unable to find build target matching %s" % cmd)
+
+
+
+def wildcard_main(missing_cmd_fn):
+	'''this replaces main from Scripting, allowing us to override the
+	   behaviour for unknown commands
+
+	   If a unknown command is found, then missing_cmd_fn() is called with
+	   the name of the requested command
+	   '''
+	Scripting.commands = Options.arg_line[:]
+
+	while Scripting.commands:
+		x = Scripting.commands.pop(0)
+
+		ini = datetime.datetime.now()
+		if x == 'configure':
+			fun = Scripting.configure
+		elif x == 'build':
+			fun = Scripting.build
+		else:
+			fun = getattr(Utils.g_module, x, None)
+
+		# this is the new addition on top of main from Scripting.py
+		if not fun:
+			missing_cmd_fn(x)
+			break
+
+		ctx = getattr(Utils.g_module, x + '_context', Utils.Context)()
+
+		if x in ['init', 'shutdown', 'dist', 'distclean', 'distcheck']:
+			try:
+				fun(ctx)
+			except TypeError:
+				fun()
+		else:
+			fun(ctx)
+
+		ela = ''
+		if not Options.options.progress_bar:
+			ela = ' (%s)' % Utils.get_elapsed_time(ini)
+
+		if x != 'init' and x != 'shutdown':
+			Logs.info('%r finished successfully%s' % (x, ela))
+
+		if not Scripting.commands and x != 'shutdown':
+			Scripting.commands.append('shutdown')
+
+
+
+
+def fake_build_environment():
+	"""create all the tasks for the project, but do not run the build
+	return the build context in use"""
+	bld = getattr(Utils.g_module, 'build_context', Utils.Context)()
+	bld = Scripting.check_configured(bld)
+
+	Options.commands['install'] = False
+	Options.commands['uninstall'] = False
+	Options.is_install = False
+
+	bld.is_install = 0 # False
+
+	try:
+		proj = Environment.Environment(Options.lockfile)
+	except IOError:
+		raise Utils.WafError("Project not configured (run 'waf configure' first)")
+
+	bld.load_dirs(proj[SRCDIR], proj[BLDDIR])
+	bld.load_envs()
+
+	Logs.info("Waf: Entering directory `%s'" % bld.bldnode.abspath())
+	bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]])
+
+	bld.pre_build()
+	bld.flush()
+	return bld
+

Added: branches/talloc/experimental/buildtools/wafsamba/tru64cc.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/tru64cc.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/tru64cc.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,77 @@
+
+# compiler definition for tru64/OSF1 cc compiler
+# based on suncc.py from waf
+
+import os, optparse
+import Utils, Options, Configure
+import ccroot, ar
+from Configure import conftest
+
+from compiler_cc import c_compiler
+
+c_compiler['osf1V'] = ['gcc', 'tru64cc']
+
+ at conftest
+def find_tru64cc(conf):
+	v = conf.env
+	cc = None
+	if v['CC']: cc = v['CC']
+	elif 'CC' in conf.environ: cc = conf.environ['CC']
+	if not cc: cc = conf.find_program('cc', var='CC')
+	if not cc: conf.fatal('tru64cc was not found')
+	cc = conf.cmd_to_list(cc)
+
+	try:
+		if not Utils.cmd_output(cc + ['-V']):
+			conf.fatal('tru64cc %r was not found' % cc)
+	except ValueError:
+		conf.fatal('tru64cc -V could not be executed')
+
+	v['CC']  = cc
+	v['CC_NAME'] = 'tru64'
+
+ at conftest
+def tru64cc_common_flags(conf):
+	v = conf.env
+
+	v['CC_SRC_F']            = ''
+	v['CC_TGT_F']            = ['-c', '-o', '']
+	v['CPPPATH_ST']          = '-I%s' # template for adding include paths
+
+	# linker
+	if not v['LINK_CC']: v['LINK_CC'] = v['CC']
+	v['CCLNK_SRC_F']         = ''
+	v['CCLNK_TGT_F']         = ['-o', '']
+
+	v['LIB_ST']              = '-l%s' # template for adding libs
+	v['LIBPATH_ST']          = '-L%s' # template for adding libpaths
+	v['STATICLIB_ST']        = '-l%s'
+	v['STATICLIBPATH_ST']    = '-L%s'
+	v['CCDEFINES_ST']        = '-D%s'
+
+#	v['SONAME_ST']           = '-Wl,-h -Wl,%s'
+#	v['SHLIB_MARKER']        = '-Bdynamic'
+#	v['STATICLIB_MARKER']    = '-Bstatic'
+
+	# program
+	v['program_PATTERN']     = '%s'
+
+	# shared library
+#	v['shlib_CCFLAGS']       = ['-Kpic', '-DPIC']
+#	v['shlib_LINKFLAGS']     = ['-G']
+	v['shlib_PATTERN']       = 'lib%s.so'
+
+	# static lib
+#	v['staticlib_LINKFLAGS'] = ['-Bstatic']
+#	v['staticlib_PATTERN']   = 'lib%s.a'
+
+detect = '''
+find_tru64cc
+find_cpp
+find_ar
+tru64cc_common_flags
+cc_load_tools
+cc_add_flags
+link_add_flags
+'''
+

Added: branches/talloc/experimental/buildtools/wafsamba/wafsamba.py
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/wafsamba.py	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/wafsamba.py	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,838 @@
+# a waf tool to add autoconf-like macros to the configure section
+# and for SAMBA_ macros for building libraries, binaries etc
+
+import Build, os, Options, Task, Utils, cc, TaskGen, fnmatch, re, shutil, Logs, Constants
+from Configure import conf
+from Logs import debug
+from samba_utils import SUBST_VARS_RECURSIVE
+
+# bring in the other samba modules
+from samba_optimisation import *
+from samba_utils import *
+from samba_autoconf import *
+from samba_patterns import *
+from samba_pidl import *
+from samba_errtable import *
+from samba_asn1 import *
+from samba_autoproto import *
+from samba_python import *
+from samba_deps import *
+from samba_bundled import *
+import samba_install
+import samba_conftests
+import samba_abi
+import tru64cc
+import irixcc
+import generic_cc
+import samba_dist
+import samba_wildcard
+
+O644 = 420
+
+# some systems have broken threading in python
+if os.environ.get('WAF_NOTHREADS') == '1':
+    import nothreads
+
+LIB_PATH="shared"
+
+os.putenv('PYTHONUNBUFFERED', '1')
+
+
+if Constants.HEXVERSION < 0x105016:
+    Logs.error('''
+Please use the version of waf that comes with Samba, not
+a system installed version. See http://wiki.samba.org/index.php/Waf
+for details.
+
+Alternatively, please use ./autogen-waf.sh, and then
+run ./configure and make as usual. That will call the right version of waf.
+''')
+    sys.exit(1)
+
+
+ at conf
+def SAMBA_BUILD_ENV(conf):
+    '''create the samba build environment'''
+    conf.env.BUILD_DIRECTORY = conf.blddir
+    mkdir_p(os.path.join(conf.blddir, LIB_PATH))
+    mkdir_p(os.path.join(conf.blddir, 'python/samba/dcerpc'))
+    # this allows all of the bin/shared and bin/python targets
+    # to be expressed in terms of build directory paths
+    mkdir_p(os.path.join(conf.blddir, 'default'))
+    for p in ['python','shared']:
+        link_target = os.path.join(conf.blddir, 'default/' + p)
+        if not os.path.lexists(link_target):
+            os.symlink('../' + p, link_target)
+
+    # get perl to put the blib files in the build directory
+    blib_bld = os.path.join(conf.blddir, 'default/pidl/blib')
+    blib_src = os.path.join(conf.srcdir, 'pidl/blib')
+    mkdir_p(blib_bld + '/man1')
+    mkdir_p(blib_bld + '/man3')
+    if os.path.islink(blib_src):
+        os.unlink(blib_src)
+    elif os.path.exists(blib_src):
+        shutil.rmtree(blib_src)
+
+
+def ADD_INIT_FUNCTION(bld, subsystem, target, init_function):
+    '''add an init_function to the list for a subsystem'''
+    if init_function is None:
+        return
+    bld.ASSERT(subsystem is not None, "You must specify a subsystem for init_function '%s'" % init_function)
+    cache = LOCAL_CACHE(bld, 'INIT_FUNCTIONS')
+    if not subsystem in cache:
+        cache[subsystem] = []
+    cache[subsystem].append( { 'TARGET':target, 'INIT_FUNCTION':init_function } )
+Build.BuildContext.ADD_INIT_FUNCTION = ADD_INIT_FUNCTION
+
+
+
+#################################################################
+def SAMBA_LIBRARY(bld, libname, source,
+                  deps='',
+                  public_deps='',
+                  includes='',
+                  public_headers=None,
+                  header_path=None,
+                  pc_files=None,
+                  vnum=None,
+                  cflags='',
+                  external_library=False,
+                  realname=None,
+                  autoproto=None,
+                  group='main',
+                  depends_on='',
+                  local_include=True,
+                  vars=None,
+                  install_path=None,
+                  install=True,
+                  needs_python=False,
+                  target_type='LIBRARY',
+                  bundled_extension=True,
+                  link_name=None,
+                  abi_file=None,
+                  abi_match=None,
+                  hide_symbols=False,
+                  enabled=True):
+    '''define a Samba library'''
+
+    if not enabled:
+        SET_TARGET_TYPE(bld, libname, 'DISABLED')
+        return
+
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+
+    # remember empty libraries, so we can strip the dependencies
+    if ((source == '') or (source == [])) and deps == '' and public_deps == '':
+        SET_TARGET_TYPE(bld, libname, 'EMPTY')
+        return
+
+    if target_type != 'PYTHON' and BUILTIN_LIBRARY(bld, libname):
+        obj_target = libname
+    else:
+        obj_target = libname + '.objlist'
+
+    # first create a target for building the object files for this library
+    # by separating in this way, we avoid recompiling the C files
+    # separately for the install library and the build library
+    bld.SAMBA_SUBSYSTEM(obj_target,
+                        source         = source,
+                        deps           = deps,
+                        public_deps    = public_deps,
+                        includes       = includes,
+                        public_headers = public_headers,
+                        header_path    = header_path,
+                        cflags         = cflags,
+                        group          = group,
+                        autoproto      = autoproto,
+                        depends_on     = depends_on,
+                        needs_python   = needs_python,
+                        hide_symbols   = hide_symbols,
+                        local_include  = local_include)
+
+    if libname == obj_target:
+        return
+
+    if not SET_TARGET_TYPE(bld, libname, target_type):
+        return
+
+    # the library itself will depend on that object target
+    deps += ' ' + public_deps
+    deps = TO_LIST(deps)
+    deps.append(obj_target)
+
+    if target_type == 'PYTHON' or realname:
+        bundled_name = libname
+    else:
+        bundled_name = BUNDLED_NAME(bld, libname, bundled_extension)
+
+    features = 'cc cshlib symlink_lib install_lib'
+    if target_type == 'PYTHON':
+        features += ' pyext'
+    elif needs_python:
+        features += ' pyembed'
+    if abi_file:
+        features += ' abi_check'
+
+    if abi_file:
+        abi_file = os.path.join(bld.curdir, abi_file)
+
+    bld.SET_BUILD_GROUP(group)
+    t = bld(
+        features        = features,
+        source          = [],
+        target          = bundled_name,
+        samba_cflags    = CURRENT_CFLAGS(bld, libname, cflags),
+        depends_on      = depends_on,
+        samba_deps      = deps,
+        samba_includes  = includes,
+        local_include   = local_include,
+        vnum            = vnum,
+        install_path    = None,
+        samba_inst_path = install_path,
+        name	        = libname,
+        samba_realname  = realname,
+        samba_install   = install,
+        abi_file        = abi_file,
+        abi_match       = abi_match
+        )
+
+    if realname and not link_name:
+        link_name = 'shared/%s' % realname
+
+    if link_name:
+        t.link_name = link_name
+
+    if pc_files is not None:
+        bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
+
+Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY
+
+
+#################################################################
+def SAMBA_BINARY(bld, binname, source,
+                 deps='',
+                 includes='',
+                 public_headers=None,
+                 header_path=None,
+                 modules=None,
+                 ldflags=None,
+                 cflags='',
+                 autoproto=None,
+                 use_hostcc=False,
+                 use_global_deps=True,
+                 compiler=None,
+                 group='binaries',
+                 manpages=None,
+                 local_include=True,
+                 subsystem_name=None,
+                 needs_python=False,
+                 vars=None,
+                 install=True,
+                 install_path=None,
+                 enabled=True):
+    '''define a Samba binary'''
+
+    if not enabled:
+        SET_TARGET_TYPE(bld, binname, 'DISABLED')
+        return
+
+    if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
+        return
+
+    features = 'cc cprogram symlink_bin install_bin'
+    if needs_python:
+        features += ' pyembed'
+
+    obj_target = binname + '.objlist'
+
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+    source = unique_list(TO_LIST(source))
+
+    # first create a target for building the object files for this binary
+    # by separating in this way, we avoid recompiling the C files
+    # separately for the install binary and the build binary
+    bld.SAMBA_SUBSYSTEM(obj_target,
+                        source         = source,
+                        deps           = deps,
+                        includes       = includes,
+                        cflags         = cflags,
+                        group          = group,
+                        autoproto      = autoproto,
+                        subsystem_name = subsystem_name,
+                        needs_python   = needs_python,
+                        local_include  = local_include,
+                        use_hostcc     = use_hostcc,
+                        use_global_deps= use_global_deps)
+
+    bld.SET_BUILD_GROUP(group)
+
+    # the binary itself will depend on that object target
+    deps = TO_LIST(deps)
+    deps.append(obj_target)
+
+    t = bld(
+        features       = features,
+        source         = [],
+        target         = binname,
+        samba_cflags   = CURRENT_CFLAGS(bld, binname, cflags),
+        samba_deps     = deps,
+        samba_includes = includes,
+        local_include  = local_include,
+        samba_modules  = modules,
+        top            = True,
+        samba_subsystem= subsystem_name,
+        install_path   = None,
+        samba_inst_path= install_path,
+        samba_install  = install
+        )
+
+    # setup the subsystem_name as an alias for the real
+    # binary name, so it can be found when expanding
+    # subsystem dependencies
+    if subsystem_name is not None:
+        bld.TARGET_ALIAS(subsystem_name, binname)
+
+Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY
+
+
+#################################################################
+def SAMBA_MODULE(bld, modname, source,
+                 deps='',
+                 includes='',
+                 subsystem=None,
+                 init_function=None,
+                 autoproto=None,
+                 autoproto_extra_source='',
+                 aliases=None,
+                 cflags='',
+                 internal_module=True,
+                 local_include=True,
+                 vars=None,
+                 enabled=True):
+    '''define a Samba module.'''
+
+    # we add the init function regardless of whether the module
+    # is enabled or not, as we need to generate a null list if
+    # all disabled
+    bld.ADD_INIT_FUNCTION(subsystem, modname, init_function)
+
+    if internal_module or BUILTIN_LIBRARY(bld, modname):
+        # treat internal modules as subsystems for now
+        SAMBA_SUBSYSTEM(bld, modname, source,
+                        deps=deps,
+                        includes=includes,
+                        autoproto=autoproto,
+                        autoproto_extra_source=autoproto_extra_source,
+                        cflags=cflags,
+                        local_include=local_include,
+                        enabled=enabled)
+        return
+
+    if not enabled:
+        SET_TARGET_TYPE(bld, modname, 'DISABLED')
+        return
+
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+    source = unique_list(TO_LIST(source))
+
+    # remember empty modules, so we can strip the dependencies
+    if ((source == '') or (source == [])) and deps == '' and public_deps == '':
+        SET_TARGET_TYPE(bld, modname, 'EMPTY')
+        return
+
+    if not SET_TARGET_TYPE(bld, modname, 'MODULE'):
+        return
+
+    if subsystem is not None:
+        deps += ' ' + subsystem
+
+    bld.SET_BUILD_GROUP('main')
+    bld(
+        features       = 'cc',
+        source         = source,
+        target         = modname,
+        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags),
+        samba_includes = includes,
+        local_include  = local_include,
+        samba_deps     = TO_LIST(deps)
+        )
+
+    if autoproto is not None:
+        bld.SAMBA_AUTOPROTO(autoproto, source + TO_LIST(autoproto_extra_source))
+
+Build.BuildContext.SAMBA_MODULE = SAMBA_MODULE
+
+
+#################################################################
+def SAMBA_SUBSYSTEM(bld, modname, source,
+                    deps='',
+                    public_deps='',
+                    includes='',
+                    public_headers=None,
+                    header_path=None,
+                    cflags='',
+                    cflags_end=None,
+                    group='main',
+                    init_function_sentinal=None,
+                    heimdal_autoproto=None,
+                    heimdal_autoproto_options=None,
+                    heimdal_autoproto_private=None,
+                    autoproto=None,
+                    autoproto_extra_source='',
+                    depends_on='',
+                    local_include=True,
+                    local_include_first=True,
+                    subsystem_name=None,
+                    enabled=True,
+                    use_hostcc=False,
+                    use_global_deps=True,
+                    vars=None,
+                    hide_symbols=False,
+                    needs_python=False):
+    '''define a Samba subsystem'''
+
+    if not enabled:
+        SET_TARGET_TYPE(bld, modname, 'DISABLED')
+        return
+
+    # remember empty subsystems, so we can strip the dependencies
+    if ((source == '') or (source == [])) and deps == '' and public_deps == '':
+        SET_TARGET_TYPE(bld, modname, 'EMPTY')
+        return
+
+    if not SET_TARGET_TYPE(bld, modname, 'SUBSYSTEM'):
+        return
+
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+    source = unique_list(TO_LIST(source))
+
+    deps += ' ' + public_deps
+
+    bld.SET_BUILD_GROUP(group)
+
+    features = 'cc'
+    if needs_python:
+        features += ' pyext'
+
+    t = bld(
+        features       = features,
+        source         = source,
+        target         = modname,
+        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags, hide_symbols=hide_symbols),
+        depends_on     = depends_on,
+        samba_deps     = TO_LIST(deps),
+        samba_includes = includes,
+        local_include  = local_include,
+        local_include_first  = local_include_first,
+        samba_subsystem= subsystem_name,
+        samba_use_hostcc = use_hostcc,
+        samba_use_global_deps = use_global_deps
+        )
+
+    if cflags_end is not None:
+        t.samba_cflags.extend(TO_LIST(cflags_end))
+
+    if heimdal_autoproto is not None:
+        bld.HEIMDAL_AUTOPROTO(heimdal_autoproto, source, options=heimdal_autoproto_options)
+    if heimdal_autoproto_private is not None:
+        bld.HEIMDAL_AUTOPROTO_PRIVATE(heimdal_autoproto_private, source)
+    if autoproto is not None:
+        bld.SAMBA_AUTOPROTO(autoproto, source + TO_LIST(autoproto_extra_source))
+    if public_headers is not None:
+        bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
+    return t
+
+
+Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
+
+
+def SAMBA_GENERATOR(bld, name, rule, source='', target='',
+                    group='generators', enabled=True,
+                    public_headers=None,
+                    header_path=None,
+                    vars=None):
+    '''A generic source generator target'''
+
+    if not SET_TARGET_TYPE(bld, name, 'GENERATOR'):
+        return
+
+    if not enabled:
+        return
+
+    bld.SET_BUILD_GROUP(group)
+    t = bld(
+        rule=rule,
+        source=bld.EXPAND_VARIABLES(source, vars=vars),
+        target=target,
+        shell=isinstance(rule, str),
+        on_results=True,
+        before='cc',
+        ext_out='.c',
+        name=name)
+
+    if public_headers is not None:
+        bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
+    return t
+Build.BuildContext.SAMBA_GENERATOR = SAMBA_GENERATOR
+
+
+
+ at runonce
+def SETUP_BUILD_GROUPS(bld):
+    '''setup build groups used to ensure that the different build
+    phases happen consecutively'''
+    bld.p_ln = bld.srcnode # we do want to see all targets!
+    bld.env['USING_BUILD_GROUPS'] = True
+    bld.add_group('setup')
+    bld.add_group('build_compiler_source')
+    bld.add_group('base_libraries')
+    bld.add_group('generators')
+    bld.add_group('compiler_prototypes')
+    bld.add_group('compiler_libraries')
+    bld.add_group('build_compilers')
+    bld.add_group('build_source')
+    bld.add_group('prototypes')
+    bld.add_group('main')
+    bld.add_group('binaries')
+    bld.add_group('final')
+Build.BuildContext.SETUP_BUILD_GROUPS = SETUP_BUILD_GROUPS
+
+
+def SET_BUILD_GROUP(bld, group):
+    '''set the current build group'''
+    if not 'USING_BUILD_GROUPS' in bld.env:
+        return
+    bld.set_group(group)
+Build.BuildContext.SET_BUILD_GROUP = SET_BUILD_GROUP
+
+
+
+ at conf
+def ENABLE_TIMESTAMP_DEPENDENCIES(conf):
+    """use timestamps instead of file contents for deps
+    this currently doesn't work"""
+    def h_file(filename):
+        import stat
+        st = os.stat(filename)
+        if stat.S_ISDIR(st[stat.ST_MODE]): raise IOError('not a file')
+        m = Utils.md5()
+        m.update(str(st.st_mtime))
+        m.update(str(st.st_size))
+        m.update(filename)
+        return m.digest()
+    Utils.h_file = h_file
+
+
+
+t = Task.simple_task_type('copy_script', 'rm -f ${LINK_TARGET} && ln -s ${SRC[0].abspath(env)} ${LINK_TARGET}',
+                          shell=True, color='PINK', ext_in='.bin')
+t.quiet = True
+
+ at feature('copy_script')
+ at before('apply_link')
+def copy_script(self):
+    tsk = self.create_task('copy_script', self.allnodes[0])
+    tsk.env.TARGET = self.target
+
+def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
+    '''used to copy scripts from the source tree into the build directory
+       for use by selftest'''
+
+    source = bld.path.ant_glob(pattern)
+
+    bld.SET_BUILD_GROUP('build_source')
+    for s in TO_LIST(source):
+        iname = s
+        if installname != None:
+            iname = installname
+        target = os.path.join(installdir, iname)
+        tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target))
+        mkdir_p(tgtdir)
+        t = bld(features='copy_script',
+                source       = s,
+                target       = target,
+                always       = True,
+                install_path = None)
+        t.env.LINK_TARGET = target
+
+Build.BuildContext.SAMBA_SCRIPT = SAMBA_SCRIPT
+
+
+def install_file(bld, destdir, file, chmod=O644, flat=False,
+                 python_fixup=False, destname=None, base_name=None):
+    '''install a file'''
+    destdir = bld.EXPAND_VARIABLES(destdir)
+    if not destname:
+        destname = file
+        if flat:
+            destname = os.path.basename(destname)
+    dest = os.path.join(destdir, destname)
+    if python_fixup:
+        # fixup the python path it will use to find Samba modules
+        inst_file = file + '.inst'
+        bld.SAMBA_GENERATOR('python_%s' % destname,
+                            rule="sed 's|\(sys.path.insert.*\)bin/python\(.*\)$|\\1${PYTHONDIR}\\2|g' < ${SRC} > ${TGT}",
+                            source=file,
+                            target=inst_file)
+        file = inst_file
+    if base_name:
+        file = os.path.join(base_name, file)
+    bld.install_as(dest, file, chmod=chmod)
+
+
+def INSTALL_FILES(bld, destdir, files, chmod=O644, flat=False,
+                  python_fixup=False, destname=None, base_name=None):
+    '''install a set of files'''
+    for f in TO_LIST(files):
+        install_file(bld, destdir, f, chmod=chmod, flat=flat,
+                     python_fixup=python_fixup, destname=destname,
+                     base_name=base_name)
+Build.BuildContext.INSTALL_FILES = INSTALL_FILES
+
+
+def INSTALL_WILDCARD(bld, destdir, pattern, chmod=O644, flat=False,
+                     python_fixup=False, exclude=None, trim_path=None):
+    '''install a set of files matching a wildcard pattern'''
+    files=TO_LIST(bld.path.ant_glob(pattern))
+    if trim_path:
+        files2 = []
+        for f in files:
+            files2.append(os_path_relpath(f, trim_path))
+        files = files2
+
+    if exclude:
+        for f in files[:]:
+            if fnmatch.fnmatch(f, exclude):
+                files.remove(f)
+    INSTALL_FILES(bld, destdir, files, chmod=chmod, flat=flat,
+                  python_fixup=python_fixup, base_name=trim_path)
+Build.BuildContext.INSTALL_WILDCARD = INSTALL_WILDCARD
+
+
+def INSTALL_DIRS(bld, destdir, dirs):
+    '''install a set of directories'''
+    destdir = bld.EXPAND_VARIABLES(destdir)
+    dirs = bld.EXPAND_VARIABLES(dirs)
+    for d in TO_LIST(dirs):
+        bld.install_dir(os.path.join(destdir, d))
+Build.BuildContext.INSTALL_DIRS = INSTALL_DIRS
+
+
+re_header = re.compile('#include[ \t]*"([^"]+)"', re.I | re.M)
+class header_task(Task.Task):
+    name = 'header'
+    color = 'PINK'
+    vars = ['INCLUDEDIR', 'HEADER_DEPS']
+    def run(self):
+        txt = self.inputs[0].read(self.env)
+
+        txt = txt.replace('#if _SAMBA_BUILD_ == 4', '#if 1\n')
+
+        themap = self.generator.bld.subst_table
+        def repl(m):
+            if m.group(1):
+                s = m.group(1)
+                return "#include <%s>" % themap.get(s, s)
+            return ''
+
+        txt = re_header.sub(repl, txt)
+
+        f = None
+        try:
+            f = open(self.outputs[0].abspath(self.env), 'w')
+            f.write(txt)
+        finally:
+            if f:
+                f.close()
+
+def init_subst(bld):
+    """
+    initialize the header substitution table
+    for now use the file headermap.txt but in the future we will compute the paths properly
+    """
+
+    if getattr(bld, 'subst_table', None):
+        return bld.subst_table_h
+
+    node = bld.srcnode.find_resource("source4/headermap.txt")
+    if not node:
+        return {}
+    lines = node.read(None)
+    bld.subst_table_h = hash(lines)
+    lines = [x.strip().split(': ') for x in lines.split('\n') if x.rfind(': ') > -1]
+    bld.subst_table = dict(lines)
+    return bld.subst_table_h
+
+ at TaskGen.feature('pubh')
+def make_public_headers(self):
+    if not self.bld.is_install:
+        # install time only (lazy)
+        return
+
+    self.env['HEADER_DEPS'] = init_subst(self.bld)
+    # adds a dependency and trigger a rebuild if the dict changes
+
+    header_path = getattr(self, 'header_path', None) or ''
+
+    for x in self.to_list(self.headers):
+
+        # too complicated, but what was the original idea?
+        if isinstance(header_path, list):
+            add_dir = ''
+            for (p1, dir) in header_path:
+                lst = self.to_list(p1)
+                for p2 in lst:
+                    if fnmatch.fnmatch(x, p2):
+                        add_dir = dir
+                        break
+                else:
+                    continue
+                break
+            inst_path = add_dir
+        else:
+            inst_path = header_path
+
+        dest = ''
+        name = x
+        if x.find(':') != -1:
+            s = x.split(':')
+            name = s[0]
+            dest = s[1]
+
+        inn = self.path.find_resource(name)
+        if not inn:
+            raise ValueError("could not find the public header %r in %r" % (name, self.path))
+        out = inn.change_ext('.inst.h')
+        self.create_task('header', inn, out)
+
+        if not dest:
+            dest = inn.name
+
+        if inst_path:
+            inst_path = inst_path + '/'
+        inst_path = inst_path + dest
+
+        #print("going to install the headers", inst_path, out)
+        self.bld.install_as('${INCLUDEDIR}/%s' % inst_path, out, self.env)
+
+def PUBLIC_HEADERS(bld, public_headers, header_path=None):
+    '''install some headers
+
+    header_path may either be a string that is added to the INCLUDEDIR,
+    or it can be a dictionary of wildcard patterns which map to destination
+    directories relative to INCLUDEDIR
+    '''
+    bld.SET_BUILD_GROUP('final')
+    ret = bld(features=['pubh'], headers=public_headers, header_path=header_path)
+    return ret
+Build.BuildContext.PUBLIC_HEADERS = PUBLIC_HEADERS
+
+
+def subst_at_vars(task):
+    '''substiture @VAR@ style variables in a file'''
+    src = task.inputs[0].srcpath(task.env)
+    tgt = task.outputs[0].bldpath(task.env)
+
+    f = open(src, 'r')
+    s = f.read()
+    f.close()
+    # split on the vars
+    a = re.split('(@\w+@)', s)
+    out = []
+    done_var = {}
+    back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
+    for v in a:
+        if re.match('@\w+@', v):
+            vname = v[1:-1]
+            if not vname in task.env and vname.upper() in task.env:
+                vname = vname.upper()
+            if not vname in task.env:
+                Logs.error("Unknown substitution %s in %s" % (v, task.name))
+                sys.exit(1)
+            v = SUBST_VARS_RECURSIVE(task.env[vname], task.env)
+            # now we back substitute the allowed pc vars
+            for (b, m) in back_sub:
+                s = task.env[b]
+                if s == v[0:len(s)]:
+                    if not b in done_var:
+                        # we don't want to substitute the first usage
+                        done_var[b] = True
+                    else:
+                        v = m + v[len(s):]
+                    break
+        out.append(v)
+    contents = ''.join(out)
+    f = open(tgt, 'w')
+    s = f.write(contents)
+    f.close()
+    return 0
+
+
+
+def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
+    '''install some pkg_config pc files'''
+    dest = '${PKGCONFIGDIR}'
+    dest = bld.EXPAND_VARIABLES(dest)
+    for f in TO_LIST(pc_files):
+        base=os.path.basename(f)
+        t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
+                                rule=subst_at_vars,
+                                source=f+'.in',
+                                target=f)
+        if vnum:
+            t.env.PACKAGE_VERSION = vnum
+        INSTALL_FILES(bld, dest, f, flat=True, destname=base)
+Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
+
+
+
+#############################################################
+# give a nicer display when building different types of files
+def progress_display(self, msg, fname):
+    col1 = Logs.colors(self.color)
+    col2 = Logs.colors.NORMAL
+    total = self.position[1]
+    n = len(str(total))
+    fs = '[%%%dd/%%%dd] %s %%s%%s%%s\n' % (n, n, msg)
+    return fs % (self.position[0], self.position[1], col1, fname, col2)
+
+def link_display(self):
+    if Options.options.progress_bar != 0:
+        return Task.Task.old_display(self)
+    fname = self.outputs[0].bldpath(self.env)
+    return progress_display(self, 'Linking', fname)
+Task.TaskBase.classes['cc_link'].display = link_display
+
+def samba_display(self):
+    if Options.options.progress_bar != 0:
+        return Task.Task.old_display(self)
+
+    targets    = LOCAL_CACHE(self, 'TARGET_TYPE')
+    if self.name in targets:
+        target_type = targets[self.name]
+        type_map = { 'GENERATOR' : 'Generating',
+                     'PROTOTYPE' : 'Generating'
+                     }
+        if target_type in type_map:
+            return progress_display(self, type_map[target_type], self.name)
+
+    fname = self.inputs[0].bldpath(self.env)
+    if fname[0:3] == '../':
+        fname = fname[3:]
+    ext_loc = fname.rfind('.')
+    if ext_loc == -1:
+        return Task.Task.old_display(self)
+    ext = fname[ext_loc:]
+
+    ext_map = { '.idl' : 'Compiling IDL',
+                '.et'  : 'Compiling ERRTABLE',
+                '.asn1': 'Compiling ASN1',
+                '.c'   : 'Compiling' }
+    if ext in ext_map:
+        return progress_display(self, ext_map[ext], fname)
+    return Task.Task.old_display(self)
+
+Task.TaskBase.classes['Task'].old_display = Task.TaskBase.classes['Task'].display
+Task.TaskBase.classes['Task'].display = samba_display

Added: branches/talloc/experimental/buildtools/wafsamba/wscript
===================================================================
--- branches/talloc/experimental/buildtools/wafsamba/wscript	                        (rev 0)
+++ branches/talloc/experimental/buildtools/wafsamba/wscript	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,295 @@
+#!/usr/bin/env python
+
+# this is a base set of waf rules that everything else pulls in first
+
+import sys, wafsamba, Configure
+import Options, os, preproc
+from samba_utils import *
+from optparse import SUPPRESS_HELP
+
+# this forces configure to be re-run if any of the configure
+# sections of the build scripts change. We have to check
+# for this in sys.argv as options have not yet been parsed when
+# we need to set this. This is off by default until some issues
+# are resolved related to WAFCACHE. It will need a lot of testing
+# before it is enabled by default.
+if '--enable-auto-reconfigure' in sys.argv:
+    Configure.autoconfig = True
+
+def set_options(opt):
+    opt.tool_options('compiler_cc')
+
+    opt.tool_options('gnu_dirs')
+
+    gr = opt.option_group('library handling options')
+
+    gr.add_option('--bundled-libraries',
+                   help=("comma separated list of bundled libraries. May include !LIBNAME to disable bundling a library. Can be 'NONE' or 'ALL' [auto]"),
+                   action="store", dest='BUNDLED_LIBS', default='')
+
+    extension_default = Options.options['BUNDLED_EXTENSION_DEFAULT']
+    gr.add_option('--bundled-library-extension',
+                   help=("name extension for bundled libraries [%s]" % extension_default),
+                   action="store", dest='BUNDLED_EXTENSION', default=extension_default)
+
+    extension_exception = Options.options['BUNDLED_EXTENSION_EXCEPTION']
+    gr.add_option('--bundled-extension-exception',
+                   help=("comman separated list of libraries to not apply extension to [%s]" % extension_exception),
+                   action="store", dest='BUNDLED_EXTENSION_EXCEPTION', default=extension_exception)
+
+    builtin_defauilt = Options.options['BUILTIN_LIBRARIES_DEFAULT']
+    gr.add_option('--builtin-libraries',
+                   help=("command separated list of libraries to build directly into binaries [%s]" % builtin_defauilt),
+                   action="store", dest='BUILTIN_LIBRARIES', default=builtin_defauilt)
+
+    gr.add_option('--minimum-library-version',
+                   help=("list of minimum system library versions (LIBNAME1:version,LIBNAME2:version)"),
+                   action="store", dest='MINIMUM_LIBRARY_VERSION', default='')
+
+    gr.add_option('--disable-shared',
+                   help=("Disable all use of shared libraries"),
+                   action="store_true", dest='disable_shared', default=False)
+    gr.add_option('--disable-rpath',
+                   help=("Disable use of rpath for build binaries"),
+                   action="store_true", dest='disable_rpath_build', default=False)
+    gr.add_option('--disable-rpath-install',
+                   help=("Disable use of rpath for installed binaries"),
+                   action="store_true", dest='disable_rpath_install', default=False)
+    gr.add_option('--nonshared-binary',
+                   help=("Disable use of shared libs for the listed binaries"),
+                   action="store", dest='NONSHARED_BINARIES', default='')
+
+    opt.add_option('--with-modulesdir',
+                   help=("modules directory [PREFIX/modules]"),
+                   action="store", dest='MODULESDIR', default='${PREFIX}/modules')
+
+    gr = opt.option_group('developer options')
+
+    gr.add_option('-C',
+                   help='enable configure cacheing',
+                   action='store_true', dest='enable_configure_cache')
+    gr.add_option('--enable-auto-reconfigure',
+                   help='enable automatic reconfigure on build',
+                   action='store_true', dest='enable_auto_reconfigure')
+    gr.add_option('--enable-developer',
+                   help=("Turn on developer warnings and debugging"),
+                   action="store_true", dest='developer', default=False)
+    gr.add_option('--picky-developer',
+                   help=("Treat all warnings as errors (enable -Werror)"),
+                   action="store_true", dest='picky_developer', default=False)
+    gr.add_option('--fatal-errors',
+                   help=("Stop compilation on first error (enable -Wfatal-errors)"),
+                   action="store_true", dest='fatal_errors', default=False)
+    gr.add_option('--enable-gccdeps',
+                   help=("Enable use of gcc -MD dependency module"),
+                   action="store_true", dest='enable_gccdeps', default=False)
+    gr.add_option('--timestamp-dependencies',
+                   help=("use file timestamps instead of content for build dependencies (BROKEN)"),
+                   action="store_true", dest='timestamp_dependencies', default=False)
+    gr.add_option('--pedantic',
+		   help=("Enable even more compiler warnings"),
+		   action='store_true', dest='pedantic', default=False)
+
+    gr.add_option('--abi-check',
+		   help=("Check ABI signatures for libraries"),
+		   action='store_true', dest='ABI_CHECK', default=False)
+    gr.add_option('--abi-check-disable',
+		   help=("Disable ABI checking (used with --enable-developer)"),
+		   action='store_true', dest='ABI_CHECK_DISABLE', default=False)
+    gr.add_option('--abi-update',
+		   help=("Update ABI signature files for libraries"),
+		   action='store_true', dest='ABI_UPDATE', default=False)
+
+    gr = opt.add_option_group('cross compilation options')
+
+    gr.add_option('--cross-compile',
+		   help=("configure for cross-compilation"),
+		   action='store_true', dest='CROSS_COMPILE', default=False)
+    gr.add_option('--cross-execute',
+		   help=("command prefix to use for cross-execution in configure"),
+		   action='store', dest='CROSS_EXECUTE', default='')
+    gr.add_option('--cross-answers',
+		   help=("answers to cross-compilation configuration (auto modified)"),
+		   action='store', dest='CROSS_ANSWERS', default='')
+    gr.add_option('--hostcc',
+		   help=("set host compiler when cross compiling"),
+		   action='store', dest='HOSTCC', default=False)
+
+    # we use SUPPRESS_HELP for these, as they are ignored, and are there only
+    # to allow existing RPM spec files to work
+    opt.add_option('--build',
+		   help=SUPPRESS_HELP,
+		   action='store', dest='AUTOCONF_BUILD', default='')
+    opt.add_option('--host',
+		   help=SUPPRESS_HELP,
+		   action='store', dest='AUTOCONF_HOST', default='')
+    opt.add_option('--program-prefix',
+		   help=SUPPRESS_HELP,
+		   action='store', dest='AUTOCONF_PROGRAM_PREFIX', default='')
+    opt.add_option('--disable-dependency-tracking',
+		   help=SUPPRESS_HELP,
+		   action='store_true', dest='AUTOCONF_DISABLE_DEPENDENCY_TRACKING', default=False)
+
+
+ at wafsamba.runonce
+def configure(conf):
+    conf.env.hlist = []
+    conf.env.srcdir = conf.srcdir
+
+    if Options.options.timestamp_dependencies:
+        conf.ENABLE_TIMESTAMP_DEPENDENCIES()
+
+    conf.SETUP_CONFIGURE_CACHE(Options.options.enable_configure_cache)
+
+    # load our local waf extensions
+    conf.check_tool('gnu_dirs')
+    conf.check_tool('wafsamba')
+
+    conf.CHECK_CC_ENV()
+
+    conf.check_tool('compiler_cc')
+
+    # we need git for 'waf dist'
+    conf.find_program('git', var='GIT')
+
+    if Options.options.enable_gccdeps:
+        # don't enable gccdeps by default as it needs a very recent version gcc
+        conf.check_tool('gccdeps', tooldir=conf.srcdir + "/buildtools/wafsamba")
+
+    # make the install paths available in environment
+    conf.env.LIBDIR = Options.options.LIBDIR or '${PREFIX}/lib'
+    conf.env.BINDIR = Options.options.BINDIR or '${PREFIX}/bin'
+    conf.env.SBINDIR = Options.options.SBINDIR or '${PREFIX}/sbin'
+    conf.env.MODULESDIR = Options.options.MODULESDIR
+    conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',')
+    conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',')
+    conf.env.DISABLE_SHARED = Options.options.disable_shared
+    conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',')
+
+    conf.env.BUNDLED_EXTENSION = Options.options.BUNDLED_EXTENSION
+    conf.env.BUNDLED_EXTENSION_EXCEPTION = Options.options.BUNDLED_EXTENSION_EXCEPTION.split(',')
+
+    conf.env.CROSS_COMPILE = Options.options.CROSS_COMPILE
+    conf.env.CROSS_EXECUTE = Options.options.CROSS_EXECUTE
+    conf.env.CROSS_ANSWERS = Options.options.CROSS_ANSWERS
+    conf.env.HOSTCC        = Options.options.HOSTCC
+
+    conf.env.AUTOCONF_BUILD = Options.options.AUTOCONF_BUILD
+    conf.env.AUTOCONF_HOST  = Options.options.AUTOCONF_HOST
+    conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
+
+    if (conf.env.AUTOCONF_HOST and
+        conf.env.AUTOCONF_BUILD and
+        conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST):
+        Logs.error('ERROR: Mismatch between --build and --host. Please use --cross-compile instead')
+        sys.exit(1)
+    if conf.env.AUTOCONF_PROGRAM_PREFIX:
+        Logs.error('ERROR: --program-prefix not supported')
+        sys.exit(1)
+
+    # enable ABI checking for developers
+    conf.env.ABI_CHECK = Options.options.ABI_CHECK or Options.options.developer
+    if Options.options.ABI_CHECK_DISABLE:
+        conf.env.ABI_CHECK = False
+    try:
+        conf.find_program('gdb', mandatory=True)
+    except:
+        conf.env.ABI_CHECK = False
+
+    conf.CHECK_COMMAND(['uname', '-a'],
+                       msg='Checking build system',
+                       define='BUILD_SYSTEM',
+                       on_target=False)
+    conf.CHECK_UNAME()
+
+    # see if we can compile and run a simple C program
+    conf.CHECK_CODE('printf("hello world")',
+                    define='HAVE_SIMPLE_C_PROG',
+                    mandatory=True,
+                    execute=True,
+                    headers='stdio.h',
+                    msg='Checking simple C program')
+
+    # see if we can build shared libs
+    if not conf.CHECK_LIBRARY_SUPPORT():
+        conf.env.DISABLE_SHARED = True
+
+    # check for rpath
+    if not conf.env.DISABLE_SHARED and conf.CHECK_LIBRARY_SUPPORT(rpath=True):
+        conf.env.RPATH_ON_BUILD   = not Options.options.disable_rpath_build
+        conf.env.RPATH_ON_INSTALL = (conf.env.RPATH_ON_BUILD and
+                                     not Options.options.disable_rpath_install)
+    else:
+        conf.env.RPATH_ON_INSTALL = False
+        conf.env.RPATH_ON_BUILD   = False
+
+    # we should use the PIC options in waf instead
+    conf.ADD_CFLAGS('-fPIC', testflags=True)
+
+    conf.CHECK_INLINE()
+
+    # check for pkgconfig
+    conf.check_cfg(atleast_pkgconfig_version='0.0.0')
+
+    conf.DEFINE('_GNU_SOURCE', 1, add_to_cflags=True)
+    conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
+
+    # get the base headers we'll use for the rest of the tests
+    conf.CHECK_HEADERS('stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h',
+                       add_headers=True)
+    conf.CHECK_HEADERS('strings.h inttypes.h stdint.h unistd.h minix/config.h', add_headers=True)
+    conf.CHECK_HEADERS('ctype.h standards.h stdbool.h stdint.h stdarg.h vararg.h', add_headers=True)
+    conf.CHECK_HEADERS('limits.h assert.h')
+
+    # see if we need special largefile flags
+    conf.CHECK_LARGEFILE()
+
+    if 'HAVE_STDDEF_H' in conf.env and 'HAVE_STDLIB_H' in conf.env:
+        conf.DEFINE('STDC_HEADERS', 1)
+
+    conf.CHECK_HEADERS('sys/time.h time.h', together=True)
+
+    if 'HAVE_SYS_TIME_H' in conf.env and 'HAVE_TIME_H' in conf.env:
+        conf.DEFINE('TIME_WITH_SYS_TIME', 1)
+
+    conf.define('SHLIBEXT', "so", quote=True)
+
+    conf.CHECK_CODE('long one = 1; return ((char *)(&one))[0]',
+                    execute=True,
+                    define='WORDS_BIGENDIAN')
+
+    # check if signal() takes a void function
+    if conf.CHECK_CODE('return *(signal (0, 0)) (0) == 1',
+                       define='RETSIGTYPE_INT',
+                       execute=False,
+                       headers='signal.h',
+                       msg='Checking if signal handlers return int'):
+        conf.DEFINE('RETSIGTYPE', 'int')
+    else:
+        conf.DEFINE('RETSIGTYPE', 'void')
+
+    conf.CHECK_VARIABLE('__FUNCTION__', define='HAVE_FUNCTION_MACRO')
+
+    conf.CHECK_CODE('va_list ap1,ap2; va_copy(ap1,ap2)',
+                    define="HAVE_VA_COPY",
+                    msg="Checking for va_copy")
+
+    conf.CHECK_CODE('''
+                    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
+                    eprintf("bla", "bar")
+                    ''', define='HAVE__VA_ARGS__MACRO')
+
+    conf.SAMBA_BUILD_ENV()
+
+
+def build(bld):
+    # give a more useful message if the source directory has moved
+    relpath = os_path_relpath(bld.curdir, bld.srcnode.abspath())
+    if relpath.find('../') != -1:
+        Logs.error('bld.curdir %s is not a child of %s' % (bld.curdir, bld.srcnode.abspath()))
+        raise Utils.WafError('''The top source directory has moved. Please run distclean and reconfigure''')
+
+    bld.CHECK_MAKEFLAGS()
+    bld.SETUP_BUILD_GROUPS()
+    bld.ENFORCE_GROUP_ORDERING()
+    bld.CHECK_PROJECT_RULES()

Added: branches/talloc/experimental/lib/replace/.checker_innocent
===================================================================
--- branches/talloc/experimental/lib/replace/.checker_innocent	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/.checker_innocent	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,4 @@
+>>>MISTAKE21_create_files_6a9e68ada99a97cb
+>>>MISTAKE21_os2_delete_9b2bfa7f38711d09
+>>>MISTAKE21_os2_delete_2fcc29aaa99a97cb
+>>>SECURITY2_os2_delete_9b2bfa7f1c9396ca

Added: branches/talloc/experimental/lib/replace/Makefile.in
===================================================================
--- branches/talloc/experimental/lib/replace/Makefile.in	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/Makefile.in	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,70 @@
+#!gmake
+#
+CC = @CC@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+includedir = @includedir@
+libdir = @libdir@
+VPATH = @libreplacedir@
+srcdir = @srcdir@
+builddir = @builddir@
+sharedbuilddir = @sharedbuilddir@
+INSTALLCMD = @INSTALL@
+LIBS = @LIBS@
+
+.PHONY: test all showflags install installcheck clean distclean realdistclean
+
+CFLAGS=-I. @CFLAGS@
+LDFLAGS=@LDFLAGS@
+
+OBJS = @LIBREPLACEOBJ@
+
+all: showflags libreplace.a testsuite
+
+showflags:
+	@echo 'libreplace will be compiled with flags:'
+	@echo '  CC     = $(CC)'
+	@echo '  CFLAGS = $(CFLAGS)'
+	@echo '  LDFLAGS= $(LDFLAGS)'
+	@echo '  LIBS   = $(LIBS)'
+
+install: all
+	${INSTALLCMD} -d $(libdir)
+	${INSTALLCMD} -m 644 libreplace.a $(libdir)
+
+shared-build: all
+	${INSTALLCMD} -d $(sharedbuilddir)/include
+	${INSTALLCMD} -m 644 replace.h $(sharedbuilddir)/include
+	${INSTALLCMD} -d $(sharedbuilddir)/lib
+	${INSTALLCMD} -m 644 libreplace.a $(sharedbuilddir)/lib
+
+libreplace.a: $(OBJS)
+	ar -rcsv $@ $(OBJS)
+
+test: all
+	./testsuite
+
+installcheck: install test
+
+TEST_OBJS = test/main.o test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
+
+testsuite: libreplace.a $(TEST_OBJS)
+	$(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS)
+
+.c.o:
+	@echo Compiling $*.c
+	@mkdir -p `dirname $@`
+	@$(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+	rm -f *.o test/*.o *.a testsuite
+	rm -f testfile.dat
+
+distclean: clean
+	rm -f *~ */*~
+	rm -f config.log config.status config.h config.cache
+	rm -f Makefile
+
+realdistclean: distclean
+	rm -f configure config.h.in

Added: branches/talloc/experimental/lib/replace/README
===================================================================
--- branches/talloc/experimental/lib/replace/README	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/README	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,123 @@
+This subsystem ensures that we can always use a certain core set of 
+functions and types, that are either provided by the OS or by replacement 
+functions / definitions in this subsystem. The aim is to try to stick 
+to POSIX functions in here as much as possible. Convenience functions 
+that are available on no platform at all belong in other subsystems
+(such as LIBUTIL).
+
+The following functions are guaranteed:
+
+ftruncate
+strlcpy
+strlcat
+mktime
+rename
+initgroups
+memmove
+strdup
+setlinebuf
+vsyslog
+timegm
+setenv
+unsetenv
+strndup
+strnlen
+waitpid
+seteuid
+setegid
+asprintf
+snprintf
+vasprintf
+vsnprintf
+opendir
+readdir
+telldir
+seekdir
+closedir
+dlopen
+dlclose
+dlsym
+dlerror
+chroot
+bzero
+strerror
+errno
+mkdtemp
+mkstemp (a secure one!)
+pread
+pwrite
+chown
+lchown
+getpass
+readline (the library)
+inet_ntoa
+inet_ntop
+inet_pton
+inet_aton
+strtoll
+strtoull
+socketpair
+strptime
+getaddrinfo
+freeaddrinfo
+getnameinfo
+gai_strerror
+getifaddrs
+freeifaddrs
+utime
+utimes
+dup2
+link
+readlink
+symlink
+realpath
+
+Types:
+bool
+socklen_t
+uint{8,16,32,64}_t
+int{8,16,32,64}_t
+intptr_t
+sig_atomic_t
+
+Constants:
+PATH_NAME_MAX
+UINT{16,32,64}_MAX
+INT32_MAX
+RTLD_LAZY
+HOST_NAME_MAX
+UINT16_MAX
+UINT32_MAX
+UINT64_MAX
+CHAR_BIT
+
+Macros:
+va_copy
+__FUNCTION__
+__FILE__
+__LINE__
+__LINESTR__
+__location__
+__STRING
+__STRINGSTRING
+MIN
+MAX
+QSORT_CAST
+ZERO_STRUCT
+ZERO_STRUCTP
+ZERO_STRUCTPN
+ZERO_ARRAY
+ARRAY_SIZE
+PTR_DIFF
+
+Headers:
+stdint.h
+stdbool.h
+
+Optional C keywords:
+volatile
+
+Prerequisites:
+memset (for bzero)
+syslog (for vsyslog)
+mktemp (for mkstemp and mkdtemp)

Added: branches/talloc/experimental/lib/replace/aclocal.m4
===================================================================
--- branches/talloc/experimental/lib/replace/aclocal.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/aclocal.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1 @@
+m4_include(libreplace.m4)

Added: branches/talloc/experimental/lib/replace/autoconf-2.60.m4
===================================================================
--- branches/talloc/experimental/lib/replace/autoconf-2.60.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/autoconf-2.60.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,236 @@
+# AC_GNU_SOURCE
+# --------------
+AC_DEFUN([AC_GNU_SOURCE],
+[AH_VERBATIM([_GNU_SOURCE],
+[/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AC_DEFINE([_GNU_SOURCE])
+])
+
+# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
+#		ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
+# --------------------------------------------------------------
+# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99')
+# by trying to compile a program of TEST-PROLOGUE and TEST-BODY.  If this fails,
+# try again with each compiler option in the space-separated OPTION-LIST; if one
+# helps, append it to CC.  If eventually successful, run ACTION-IF-AVAILABLE,
+# else ACTION-IF-UNAVAILABLE.
+AC_DEFUN([_AC_C_STD_TRY],
+[AC_MSG_CHECKING([for $CC option to accept ISO ]m4_translit($1, [c], [C]))
+AC_CACHE_VAL(ac_cv_prog_cc_$1,
+[ac_cv_prog_cc_$1=no
+ac_save_CC=$CC
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
+for ac_arg in '' $4
+do
+  CC="$ac_save_CC $ac_arg"
+  _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg])
+  test "x$ac_cv_prog_cc_$1" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+])# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_$1" in
+  x)
+    AC_MSG_RESULT([none needed]) ;;
+  xno)
+    AC_MSG_RESULT([unsupported]) ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_$1"
+    AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;;
+esac
+AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
+])# _AC_C_STD_TRY
+
+# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# ----------------------------------------------------------------
+# If the C compiler is not in ISO C99 mode by default, try to add an
+# option to output variable CC to make it so.  This macro tries
+# various options that select ISO C99 on some system or another.  It
+# considers the compiler to be in ISO C99 mode if it handles mixed
+# code and declarations, _Bool, inline and restrict.
+AC_DEFUN([_AC_PROG_CC_C99],
+[_AC_C_STD_TRY([c99],
+[[#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict(ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy work.
+static void
+test_varargs(const char *format, ...)
+{
+  va_list args;
+  va_start(args, format);
+  va_list args_copy;
+  va_copy(args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg(args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg(args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = (float) va_arg(args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end(args_copy);
+  va_end(args);
+}
+]],
+[[
+  // Check bool and long long datatypes.
+  _Bool success = false;
+  long long int bignum = -1234567890LL;
+  unsigned long long int ubignum = 1234567890uLL;
+
+  // Check restrict.
+  if (test_restrict("String literal") != 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs("s, d' f .", "string", 65, 34.234);
+
+  // Check incomplete arrays work.
+  struct incomplete_array *ia =
+    malloc(sizeof(struct incomplete_array) + (sizeof(double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = (double) i * 1.234;
+
+  // Check named initialisers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[43] = 543;
+
+  // work around unused variable warnings
+  return  bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x';
+]],
+dnl Try
+dnl GCC		-std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
+dnl AIX		-qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99)
+dnl Intel ICC	-c99
+dnl IRIX	-c99
+dnl Solaris	(unused because it causes the compiler to assume C99 semantics for
+dnl		library functions, and this is invalid before Solaris 10: -xc99)
+dnl Tru64	-c99
+dnl with extended modes being tried first.
+[[-std=gnu99 -c99 -qlanglvl=extc99]], [$1], [$2])[]dnl
+])# _AC_PROG_CC_C99
+
+# AC_PROG_CC_C99
+# --------------
+AC_DEFUN([AC_PROG_CC_C99],
+[ AC_REQUIRE([AC_PROG_CC])dnl
+  _AC_PROG_CC_C99
+])
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[
+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+  if test "$MINIX" = yes; then
+    AC_DEFINE([_POSIX_SOURCE], [1],
+      [Define to 1 if you need to in order for `stat' and other
+       things to work.])
+    AC_DEFINE([_POSIX_1_SOURCE], [2],
+      [Define to 2 if the system does not provide POSIX.1 features
+       except with this defined.])
+    AC_DEFINE([_MINIX], [1],
+      [Define to 1 if on MINIX.])
+  fi
+
+  AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+    [ac_cv_safe_to_define___extensions__],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[
+#	  define __EXTENSIONS__ 1
+	  ]AC_INCLUDES_DEFAULT])],
+       [ac_cv_safe_to_define___extensions__=yes],
+       [ac_cv_safe_to_define___extensions__=no])])
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    AC_DEFINE([__EXTENSIONS__])
+  AC_DEFINE([_ALL_SOURCE])
+  AC_DEFINE([_GNU_SOURCE])
+  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+  AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+])

Added: branches/talloc/experimental/lib/replace/autogen-waf.sh
===================================================================
--- branches/talloc/experimental/lib/replace/autogen-waf.sh	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/autogen-waf.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1 @@
+link ../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file


Property changes on: branches/talloc/experimental/lib/replace/autogen-waf.sh
___________________________________________________________________
Added: svn:special
   + *

Added: branches/talloc/experimental/lib/replace/autogen.sh
===================================================================
--- branches/talloc/experimental/lib/replace/autogen.sh	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/autogen.sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+rm -rf autom4te.cache
+rm -f configure config.h.in
+
+autoheader || exit 1
+autoconf || exit 1
+
+rm -rf autom4te.cache
+
+echo "Now run ./configure and then make."
+exit 0
+


Property changes on: branches/talloc/experimental/lib/replace/autogen.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/lib/replace/build_macros.m4
===================================================================
--- branches/talloc/experimental/lib/replace/build_macros.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/build_macros.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,14 @@
+AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
+  [ AC_ARG_WITH([shared-build-dir],
+                [AC_HELP_STRING([--with-shared-build-dir=DIR],
+                                [temporary build directory where libraries are installed [$srcdir/sharedbuild]])])
+
+    sharedbuilddir="$srcdir/sharedbuild"
+    if test x"$with_shared_build_dir" != x; then
+        sharedbuilddir=$with_shared_build_dir
+        CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
+        LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
+    fi
+    AC_SUBST(sharedbuilddir)
+  ])
+

Added: branches/talloc/experimental/lib/replace/config.guess
===================================================================
--- branches/talloc/experimental/lib/replace/config.guess	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/config.guess	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[456])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:[3456]*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    EM64T | authenticamd | genuineintel)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^LIBC/{
+		s: ::g
+		p
+	    }'`"
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: branches/talloc/experimental/lib/replace/config.guess
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/lib/replace/config.sub
===================================================================
--- branches/talloc/experimental/lib/replace/config.sub	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/config.sub	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+        mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: branches/talloc/experimental/lib/replace/config.sub
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/lib/replace/configure.ac
===================================================================
--- branches/talloc/experimental/lib/replace/configure.ac	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/configure.ac	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,33 @@
+AC_PREREQ(2.50)
+AC_INIT(replace.c)
+AC_CONFIG_SRCDIR([replace.c])
+AC_CONFIG_HEADER(config.h)
+
+CFLAGS="$CFLAGS -I$srcdir"
+
+AC_LIBREPLACE_ALL_CHECKS
+AC_LIBREPLACE_NETWORK_CHECKS
+
+if test "$ac_cv_prog_gcc" = yes; then
+   CFLAGS="$CFLAGS -Wall"
+   CFLAGS="$CFLAGS -W"
+   CFLAGS="$CFLAGS -Wshadow"
+   CFLAGS="$CFLAGS -Wstrict-prototypes"
+   CFLAGS="$CFLAGS -Wpointer-arith"
+   CFLAGS="$CFLAGS -Wcast-qual"
+   CFLAGS="$CFLAGS -Wcast-align"
+   CFLAGS="$CFLAGS -Wwrite-strings"
+   CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+   CFLAGS="$CFLAGS -Wformat=2"
+   CFLAGS="$CFLAGS -Wno-format-y2k"
+fi
+
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
+LIBS="${LIBREPLACE_NETWORK_LIBS}"
+AC_SUBST(LIBS)
+
+AC_SUBST(LDFLAGS)
+
+AC_OUTPUT(Makefile)

Added: branches/talloc/experimental/lib/replace/crypt.c
===================================================================
--- branches/talloc/experimental/lib/replace/crypt.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/crypt.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,770 @@
+/*
+   This bit of code was derived from the UFC-crypt package which
+   carries the following copyright 
+   
+   Modified for use by Samba by Andrew Tridgell, October 1994
+
+   Note that this routine is only faster on some machines. Under Linux 1.1.51 
+   libc 4.5.26 I actually found this routine to be slightly slower.
+
+   Under SunOS I found a huge speedup by using these routines 
+   (a factor of 20 or so)
+
+   Warning: I've had a report from Steve Kennedy <steve at gbnet.org>
+   that this crypt routine may sometimes get the wrong answer. Only
+   use UFC_CRYT if you really need it.
+
+*/
+
+#include "replace.h"
+
+#ifndef HAVE_CRYPT
+
+/*
+ * UFC-crypt: ultra fast crypt(3) implementation
+ *
+ * Copyright (C) 1991-1998, Free Software Foundation, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * @(#)crypt_util.c	2.31 02/08/92
+ *
+ * Support routines
+ *
+ */
+
+
+#ifndef long32
+#define long32 int32_t
+#endif
+
+#ifndef long64
+#define long64 int64_t
+#endif
+
+#ifndef ufc_long
+#define ufc_long unsigned
+#endif
+
+#ifndef _UFC_64_
+#define _UFC_32_
+#endif
+
+/* 
+ * Permutation done once on the 56 bit 
+ *  key derived from the original 8 byte ASCII key.
+ */
+static int pc1[56] = { 
+  57, 49, 41, 33, 25, 17,  9,  1, 58, 50, 42, 34, 26, 18,
+  10,  2, 59, 51, 43, 35, 27, 19, 11,  3, 60, 52, 44, 36,
+  63, 55, 47, 39, 31, 23, 15,  7, 62, 54, 46, 38, 30, 22,
+  14,  6, 61, 53, 45, 37, 29, 21, 13,  5, 28, 20, 12,  4
+};
+
+/*
+ * How much to rotate each 28 bit half of the pc1 permutated
+ *  56 bit key before using pc2 to give the i' key
+ */
+static int rots[16] = { 
+  1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 
+};
+
+/* 
+ * Permutation giving the key 
+ * of the i' DES round 
+ */
+static int pc2[48] = { 
+  14, 17, 11, 24,  1,  5,  3, 28, 15,  6, 21, 10,
+  23, 19, 12,  4, 26,  8, 16,  7, 27, 20, 13,  2,
+  41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,
+  44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32
+};
+
+/*
+ * The E expansion table which selects
+ * bits from the 32 bit intermediate result.
+ */
+static int esel[48] = { 
+  32,  1,  2,  3,  4,  5,  4,  5,  6,  7,  8,  9,
+   8,  9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17,
+  16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25,
+  24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32,  1
+};
+static int e_inverse[64];
+
+/* 
+ * Permutation done on the 
+ * result of sbox lookups 
+ */
+static int perm32[32] = {
+  16,  7, 20, 21, 29, 12, 28, 17,  1, 15, 23, 26,  5, 18, 31, 10,
+  2,   8, 24, 14, 32, 27,  3,  9, 19, 13, 30,  6, 22, 11,  4, 25
+};
+
+/* 
+ * The sboxes
+ */
+static int sbox[8][4][16]= {
+        { { 14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7 },
+          {  0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8 },
+          {  4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0 },
+          { 15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13 }
+        },
+
+        { { 15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10 },
+          {  3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5 },
+          {  0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15 },
+          { 13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9 }
+        },
+
+        { { 10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8 },
+          { 13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1 },
+          { 13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7 },
+          {  1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12 }
+        },
+
+        { {  7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15 },
+          { 13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9 },
+          { 10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4 },
+          {  3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14 }
+        },
+
+        { {  2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9 },
+          { 14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6 },
+          {  4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14 },
+          { 11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3 }
+        },
+
+        { { 12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11 },
+          { 10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8 },
+          {  9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6 },
+          {  4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13 }
+        },
+
+        { {  4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1 },
+          { 13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6 },
+          {  1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2 },
+          {  6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12 }
+        },
+
+        { { 13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7 },
+          {  1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2 },
+          {  7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8 },
+          {  2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11 }
+        }
+};
+
+/* 
+ * This is the final 
+ * permutation matrix
+ */
+static int final_perm[64] = {
+  40,  8, 48, 16, 56, 24, 64, 32, 39,  7, 47, 15, 55, 23, 63, 31,
+  38,  6, 46, 14, 54, 22, 62, 30, 37,  5, 45, 13, 53, 21, 61, 29,
+  36,  4, 44, 12, 52, 20, 60, 28, 35,  3, 43, 11, 51, 19, 59, 27,
+  34,  2, 42, 10, 50, 18, 58, 26, 33,  1, 41,  9, 49, 17, 57, 25
+};
+
+/* 
+ * The 16 DES keys in BITMASK format 
+ */
+#ifdef _UFC_32_
+long32 _ufc_keytab[16][2];
+#endif
+
+#ifdef _UFC_64_
+long64 _ufc_keytab[16];
+#endif
+
+
+#define ascii_to_bin(c) ((c)>='a'?(c-59):(c)>='A'?((c)-53):(c)-'.')
+#define bin_to_ascii(c) ((c)>=38?((c)-38+'a'):(c)>=12?((c)-12+'A'):(c)+'.')
+
+/* Macro to set a bit (0..23) */
+#define BITMASK(i) ( (1<<(11-(i)%12+3)) << ((i)<12?16:0) )
+
+/*
+ * sb arrays:
+ *
+ * Workhorses of the inner loop of the DES implementation.
+ * They do sbox lookup, shifting of this  value, 32 bit
+ * permutation and E permutation for the next round.
+ *
+ * Kept in 'BITMASK' format.
+ */
+
+#ifdef _UFC_32_
+long32 _ufc_sb0[8192], _ufc_sb1[8192], _ufc_sb2[8192], _ufc_sb3[8192];
+static long32 *sb[4] = {_ufc_sb0, _ufc_sb1, _ufc_sb2, _ufc_sb3}; 
+#endif
+
+#ifdef _UFC_64_
+long64 _ufc_sb0[4096], _ufc_sb1[4096], _ufc_sb2[4096], _ufc_sb3[4096];
+static long64 *sb[4] = {_ufc_sb0, _ufc_sb1, _ufc_sb2, _ufc_sb3}; 
+#endif
+
+/* 
+ * eperm32tab: do 32 bit permutation and E selection
+ *
+ * The first index is the byte number in the 32 bit value to be permuted
+ *  -  second  -   is the value of this byte
+ *  -  third   -   selects the two 32 bit values
+ *
+ * The table is used and generated internally in init_des to speed it up
+ */
+static ufc_long eperm32tab[4][256][2];
+
+/* 
+ * do_pc1: permform pc1 permutation in the key schedule generation.
+ *
+ * The first   index is the byte number in the 8 byte ASCII key
+ *  -  second    -      -    the two 28 bits halfs of the result
+ *  -  third     -   selects the 7 bits actually used of each byte
+ *
+ * The result is kept with 28 bit per 32 bit with the 4 most significant
+ * bits zero.
+ */
+static ufc_long do_pc1[8][2][128];
+
+/*
+ * do_pc2: permform pc2 permutation in the key schedule generation.
+ *
+ * The first   index is the septet number in the two 28 bit intermediate values
+ *  -  second    -    -  -  septet values
+ *
+ * Knowledge of the structure of the pc2 permutation is used.
+ *
+ * The result is kept with 28 bit per 32 bit with the 4 most significant
+ * bits zero.
+ */
+static ufc_long do_pc2[8][128];
+
+/*
+ * efp: undo an extra e selection and do final
+ *      permutation giving the DES result.
+ * 
+ *      Invoked 6 bit a time on two 48 bit values
+ *      giving two 32 bit longs.
+ */
+static ufc_long efp[16][64][2];
+
+static unsigned char bytemask[8]  = {
+  0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
+};
+
+static ufc_long longmask[32] = {
+  0x80000000, 0x40000000, 0x20000000, 0x10000000,
+  0x08000000, 0x04000000, 0x02000000, 0x01000000,
+  0x00800000, 0x00400000, 0x00200000, 0x00100000,
+  0x00080000, 0x00040000, 0x00020000, 0x00010000,
+  0x00008000, 0x00004000, 0x00002000, 0x00001000,
+  0x00000800, 0x00000400, 0x00000200, 0x00000100,
+  0x00000080, 0x00000040, 0x00000020, 0x00000010,
+  0x00000008, 0x00000004, 0x00000002, 0x00000001
+};
+
+
+/*
+ * Silly rewrite of 'bzero'. I do so
+ * because some machines don't have
+ * bzero and some don't have memset.
+ */
+
+static void clearmem(char *start, int cnt)
+  { while(cnt--)
+      *start++ = '\0';
+  }
+
+static int initialized = 0;
+
+/* lookup a 6 bit value in sbox */
+
+#define s_lookup(i,s) sbox[(i)][(((s)>>4) & 0x2)|((s) & 0x1)][((s)>>1) & 0xf];
+
+/*
+ * Initialize unit - may be invoked directly
+ * by fcrypt users.
+ */
+
+static void ufc_init_des(void)
+  { int comes_from_bit;
+    int bit, sg;
+    ufc_long j;
+    ufc_long mask1, mask2;
+
+    /*
+     * Create the do_pc1 table used
+     * to affect pc1 permutation
+     * when generating keys
+     */
+    for(bit = 0; bit < 56; bit++) {
+      comes_from_bit  = pc1[bit] - 1;
+      mask1 = bytemask[comes_from_bit % 8 + 1];
+      mask2 = longmask[bit % 28 + 4];
+      for(j = 0; j < 128; j++) {
+	if(j & mask1) 
+	  do_pc1[comes_from_bit / 8][bit / 28][j] |= mask2;
+      }
+    }
+
+    /*
+     * Create the do_pc2 table used
+     * to affect pc2 permutation when
+     * generating keys
+     */
+    for(bit = 0; bit < 48; bit++) {
+      comes_from_bit  = pc2[bit] - 1;
+      mask1 = bytemask[comes_from_bit % 7 + 1];
+      mask2 = BITMASK(bit % 24);
+      for(j = 0; j < 128; j++) {
+	if(j & mask1)
+	  do_pc2[comes_from_bit / 7][j] |= mask2;
+      }
+    }
+
+    /* 
+     * Now generate the table used to do combined
+     * 32 bit permutation and e expansion
+     *
+     * We use it because we have to permute 16384 32 bit
+     * longs into 48 bit in order to initialize sb.
+     *
+     * Looping 48 rounds per permutation becomes 
+     * just too slow...
+     *
+     */
+
+    clearmem((char*)eperm32tab, sizeof(eperm32tab));
+
+    for(bit = 0; bit < 48; bit++) {
+      ufc_long inner_mask1,comes_from;
+	
+      comes_from = perm32[esel[bit]-1]-1;
+      inner_mask1      = bytemask[comes_from % 8];
+	
+      for(j = 256; j--;) {
+	if(j & inner_mask1)
+	  eperm32tab[comes_from / 8][j][bit / 24] |= BITMASK(bit % 24);
+      }
+    }
+    
+    /* 
+     * Create the sb tables:
+     *
+     * For each 12 bit segment of an 48 bit intermediate
+     * result, the sb table precomputes the two 4 bit
+     * values of the sbox lookups done with the two 6
+     * bit halves, shifts them to their proper place,
+     * sends them through perm32 and finally E expands
+     * them so that they are ready for the next
+     * DES round.
+     *
+     */
+    for(sg = 0; sg < 4; sg++) {
+      int j1, j2;
+      int s1, s2;
+    
+      for(j1 = 0; j1 < 64; j1++) {
+	s1 = s_lookup(2 * sg, j1);
+	for(j2 = 0; j2 < 64; j2++) {
+	  ufc_long to_permute, inx;
+    
+	  s2         = s_lookup(2 * sg + 1, j2);
+	  to_permute = ((s1 << 4)  | s2) << (24 - 8 * sg);
+
+#ifdef _UFC_32_
+	  inx = ((j1 << 6)  | j2) << 1;
+	  sb[sg][inx  ]  = eperm32tab[0][(to_permute >> 24) & 0xff][0];
+	  sb[sg][inx+1]  = eperm32tab[0][(to_permute >> 24) & 0xff][1];
+	  sb[sg][inx  ] |= eperm32tab[1][(to_permute >> 16) & 0xff][0];
+	  sb[sg][inx+1] |= eperm32tab[1][(to_permute >> 16) & 0xff][1];
+  	  sb[sg][inx  ] |= eperm32tab[2][(to_permute >>  8) & 0xff][0];
+	  sb[sg][inx+1] |= eperm32tab[2][(to_permute >>  8) & 0xff][1];
+	  sb[sg][inx  ] |= eperm32tab[3][(to_permute)       & 0xff][0];
+	  sb[sg][inx+1] |= eperm32tab[3][(to_permute)       & 0xff][1];
+#endif
+#ifdef _UFC_64_
+	  inx = ((j1 << 6)  | j2);
+	  sb[sg][inx]  = 
+	    ((long64)eperm32tab[0][(to_permute >> 24) & 0xff][0] << 32) |
+	     (long64)eperm32tab[0][(to_permute >> 24) & 0xff][1];
+	  sb[sg][inx] |=
+	    ((long64)eperm32tab[1][(to_permute >> 16) & 0xff][0] << 32) |
+	     (long64)eperm32tab[1][(to_permute >> 16) & 0xff][1];
+  	  sb[sg][inx] |= 
+	    ((long64)eperm32tab[2][(to_permute >>  8) & 0xff][0] << 32) |
+	     (long64)eperm32tab[2][(to_permute >>  8) & 0xff][1];
+	  sb[sg][inx] |=
+	    ((long64)eperm32tab[3][(to_permute)       & 0xff][0] << 32) |
+	     (long64)eperm32tab[3][(to_permute)       & 0xff][1];
+#endif
+	}
+      }
+    }  
+
+    /* 
+     * Create an inverse matrix for esel telling
+     * where to plug out bits if undoing it
+     */
+    for(bit=48; bit--;) {
+      e_inverse[esel[bit] - 1     ] = bit;
+      e_inverse[esel[bit] - 1 + 32] = bit + 48;
+    }
+
+    /* 
+     * create efp: the matrix used to
+     * undo the E expansion and effect final permutation
+     */
+    clearmem((char*)efp, sizeof efp);
+    for(bit = 0; bit < 64; bit++) {
+      int o_bit, o_long;
+      ufc_long word_value, inner_mask1, inner_mask2;
+      int comes_from_f_bit, comes_from_e_bit;
+      int comes_from_word, bit_within_word;
+
+      /* See where bit i belongs in the two 32 bit long's */
+      o_long = bit / 32; /* 0..1  */
+      o_bit  = bit % 32; /* 0..31 */
+
+      /* 
+       * And find a bit in the e permutated value setting this bit.
+       *
+       * Note: the e selection may have selected the same bit several
+       * times. By the initialization of e_inverse, we only look
+       * for one specific instance.
+       */
+      comes_from_f_bit = final_perm[bit] - 1;         /* 0..63 */
+      comes_from_e_bit = e_inverse[comes_from_f_bit]; /* 0..95 */
+      comes_from_word  = comes_from_e_bit / 6;        /* 0..15 */
+      bit_within_word  = comes_from_e_bit % 6;        /* 0..5  */
+
+      inner_mask1 = longmask[bit_within_word + 26];
+      inner_mask2 = longmask[o_bit];
+
+      for(word_value = 64; word_value--;) {
+	if(word_value & inner_mask1)
+	  efp[comes_from_word][word_value][o_long] |= inner_mask2;
+      }
+    }
+    initialized++;
+  }
+
+/* 
+ * Process the elements of the sb table permuting the
+ * bits swapped in the expansion by the current salt.
+ */
+
+#ifdef _UFC_32_
+static void shuffle_sb(long32 *k, ufc_long saltbits)
+  { ufc_long j;
+    long32 x;
+    for(j=4096; j--;) {
+      x = (k[0] ^ k[1]) & (long32)saltbits;
+      *k++ ^= x;
+      *k++ ^= x;
+    }
+  }
+#endif
+
+#ifdef _UFC_64_
+static void shuffle_sb(long64 *k, ufc_long saltbits)
+  { ufc_long j;
+    long64 x;
+    for(j=4096; j--;) {
+      x = ((*k >> 32) ^ *k) & (long64)saltbits;
+      *k++ ^= (x << 32) | x;
+    }
+  }
+#endif
+
+/* 
+ * Setup the unit for a new salt
+ * Hopefully we'll not see a new salt in each crypt call.
+ */
+
+static unsigned char current_salt[3] = "&&"; /* invalid value */
+static ufc_long current_saltbits = 0;
+static int direction = 0;
+
+static void setup_salt(const char *s1)
+  { ufc_long i, j, saltbits;
+    const unsigned char *s2 = (const unsigned char *)s1;
+
+    if(!initialized)
+      ufc_init_des();
+
+    if(s2[0] == current_salt[0] && s2[1] == current_salt[1])
+      return;
+    current_salt[0] = s2[0]; current_salt[1] = s2[1];
+
+    /* 
+     * This is the only crypt change to DES:
+     * entries are swapped in the expansion table
+     * according to the bits set in the salt.
+     */
+    saltbits = 0;
+    for(i = 0; i < 2; i++) {
+      long c=ascii_to_bin(s2[i]);
+      if(c < 0 || c > 63)
+	c = 0;
+      for(j = 0; j < 6; j++) {
+	if((c >> j) & 0x1)
+	  saltbits |= BITMASK(6 * i + j);
+      }
+    }
+
+    /*
+     * Permute the sb table values
+     * to reflect the changed e
+     * selection table
+     */
+    shuffle_sb(_ufc_sb0, current_saltbits ^ saltbits); 
+    shuffle_sb(_ufc_sb1, current_saltbits ^ saltbits);
+    shuffle_sb(_ufc_sb2, current_saltbits ^ saltbits);
+    shuffle_sb(_ufc_sb3, current_saltbits ^ saltbits);
+
+    current_saltbits = saltbits;
+  }
+
+static void ufc_mk_keytab(char *key)
+  { ufc_long v1, v2, *k1;
+    int i;
+#ifdef _UFC_32_
+    long32 v, *k2 = &_ufc_keytab[0][0];
+#endif
+#ifdef _UFC_64_
+    long64 v, *k2 = &_ufc_keytab[0];
+#endif
+
+    v1 = v2 = 0; k1 = &do_pc1[0][0][0];
+    for(i = 8; i--;) {
+      v1 |= k1[*key   & 0x7f]; k1 += 128;
+      v2 |= k1[*key++ & 0x7f]; k1 += 128;
+    }
+
+    for(i = 0; i < 16; i++) {
+      k1 = &do_pc2[0][0];
+
+      v1 = (v1 << rots[i]) | (v1 >> (28 - rots[i]));
+      v  = k1[(v1 >> 21) & 0x7f]; k1 += 128;
+      v |= k1[(v1 >> 14) & 0x7f]; k1 += 128;
+      v |= k1[(v1 >>  7) & 0x7f]; k1 += 128;
+      v |= k1[(v1      ) & 0x7f]; k1 += 128;
+
+#ifdef _UFC_32_
+      *k2++ = v;
+      v = 0;
+#endif
+#ifdef _UFC_64_
+      v <<= 32;
+#endif
+
+      v2 = (v2 << rots[i]) | (v2 >> (28 - rots[i]));
+      v |= k1[(v2 >> 21) & 0x7f]; k1 += 128;
+      v |= k1[(v2 >> 14) & 0x7f]; k1 += 128;
+      v |= k1[(v2 >>  7) & 0x7f]; k1 += 128;
+      v |= k1[(v2      ) & 0x7f];
+
+      *k2++ = v;
+    }
+
+    direction = 0;
+  }
+
+/* 
+ * Undo an extra E selection and do final permutations
+ */
+
+ufc_long *_ufc_dofinalperm(ufc_long l1, ufc_long l2, ufc_long r1, ufc_long r2)
+  { ufc_long v1, v2, x;
+    static ufc_long ary[2];
+
+    x = (l1 ^ l2) & current_saltbits; l1 ^= x; l2 ^= x;
+    x = (r1 ^ r2) & current_saltbits; r1 ^= x; r2 ^= x;
+
+    v1=v2=0; l1 >>= 3; l2 >>= 3; r1 >>= 3; r2 >>= 3;
+
+    v1 |= efp[15][ r2         & 0x3f][0]; v2 |= efp[15][ r2 & 0x3f][1];
+    v1 |= efp[14][(r2 >>= 6)  & 0x3f][0]; v2 |= efp[14][ r2 & 0x3f][1];
+    v1 |= efp[13][(r2 >>= 10) & 0x3f][0]; v2 |= efp[13][ r2 & 0x3f][1];
+    v1 |= efp[12][(r2 >>= 6)  & 0x3f][0]; v2 |= efp[12][ r2 & 0x3f][1];
+
+    v1 |= efp[11][ r1         & 0x3f][0]; v2 |= efp[11][ r1 & 0x3f][1];
+    v1 |= efp[10][(r1 >>= 6)  & 0x3f][0]; v2 |= efp[10][ r1 & 0x3f][1];
+    v1 |= efp[ 9][(r1 >>= 10) & 0x3f][0]; v2 |= efp[ 9][ r1 & 0x3f][1];
+    v1 |= efp[ 8][(r1 >>= 6)  & 0x3f][0]; v2 |= efp[ 8][ r1 & 0x3f][1];
+
+    v1 |= efp[ 7][ l2         & 0x3f][0]; v2 |= efp[ 7][ l2 & 0x3f][1];
+    v1 |= efp[ 6][(l2 >>= 6)  & 0x3f][0]; v2 |= efp[ 6][ l2 & 0x3f][1];
+    v1 |= efp[ 5][(l2 >>= 10) & 0x3f][0]; v2 |= efp[ 5][ l2 & 0x3f][1];
+    v1 |= efp[ 4][(l2 >>= 6)  & 0x3f][0]; v2 |= efp[ 4][ l2 & 0x3f][1];
+
+    v1 |= efp[ 3][ l1         & 0x3f][0]; v2 |= efp[ 3][ l1 & 0x3f][1];
+    v1 |= efp[ 2][(l1 >>= 6)  & 0x3f][0]; v2 |= efp[ 2][ l1 & 0x3f][1];
+    v1 |= efp[ 1][(l1 >>= 10) & 0x3f][0]; v2 |= efp[ 1][ l1 & 0x3f][1];
+    v1 |= efp[ 0][(l1 >>= 6)  & 0x3f][0]; v2 |= efp[ 0][ l1 & 0x3f][1];
+
+    ary[0] = v1; ary[1] = v2;
+    return ary;
+  }
+
+/* 
+ * crypt only: convert from 64 bit to 11 bit ASCII 
+ * prefixing with the salt
+ */
+
+static char *output_conversion(ufc_long v1, ufc_long v2, const char *salt)
+  { static char outbuf[14];
+    int i, s;
+
+    outbuf[0] = salt[0];
+    outbuf[1] = salt[1] ? salt[1] : salt[0];
+
+    for(i = 0; i < 5; i++)
+      outbuf[i + 2] = bin_to_ascii((v1 >> (26 - 6 * i)) & 0x3f);
+
+    s  = (v2 & 0xf) << 2;
+    v2 = (v2 >> 2) | ((v1 & 0x3) << 30);
+
+    for(i = 5; i < 10; i++)
+      outbuf[i + 2] = bin_to_ascii((v2 >> (56 - 6 * i)) & 0x3f);
+
+    outbuf[12] = bin_to_ascii(s);
+    outbuf[13] = 0;
+
+    return outbuf;
+  }
+
+/* 
+ * UNIX crypt function
+ */
+
+static ufc_long *_ufc_doit(ufc_long , ufc_long, ufc_long, ufc_long, ufc_long);
+   
+char *ufc_crypt(const char *key,const char *salt)
+  { ufc_long *s;
+    char ktab[9];
+
+    /*
+     * Hack DES tables according to salt
+     */
+    setup_salt(salt);
+
+    /*
+     * Setup key schedule
+     */
+    clearmem(ktab, sizeof ktab);
+    strncpy(ktab, key, 8);
+    ufc_mk_keytab(ktab);
+
+    /*
+     * Go for the 25 DES encryptions
+     */
+    s = _ufc_doit((ufc_long)0, (ufc_long)0, 
+		  (ufc_long)0, (ufc_long)0, (ufc_long)25);
+
+    /*
+     * And convert back to 6 bit ASCII
+     */
+    return output_conversion(s[0], s[1], salt);
+  }
+
+
+#ifdef _UFC_32_
+
+/*
+ * 32 bit version
+ */
+
+extern long32 _ufc_keytab[16][2];
+extern long32 _ufc_sb0[], _ufc_sb1[], _ufc_sb2[], _ufc_sb3[];
+
+#define SBA(sb, v) (*(long32*)((char*)(sb)+(v)))
+
+static ufc_long *_ufc_doit(ufc_long l1, ufc_long l2, ufc_long r1, ufc_long r2, ufc_long itr)
+  { int i;
+    long32 s, *k;
+
+    while(itr--) {
+      k = &_ufc_keytab[0][0];
+      for(i=8; i--; ) {
+	s = *k++ ^ r1;
+	l1 ^= SBA(_ufc_sb1, s & 0xffff); l2 ^= SBA(_ufc_sb1, (s & 0xffff)+4);  
+        l1 ^= SBA(_ufc_sb0, s >>= 16);   l2 ^= SBA(_ufc_sb0, (s)         +4); 
+        s = *k++ ^ r2; 
+        l1 ^= SBA(_ufc_sb3, s & 0xffff); l2 ^= SBA(_ufc_sb3, (s & 0xffff)+4);
+        l1 ^= SBA(_ufc_sb2, s >>= 16);   l2 ^= SBA(_ufc_sb2, (s)         +4);
+
+        s = *k++ ^ l1; 
+        r1 ^= SBA(_ufc_sb1, s & 0xffff); r2 ^= SBA(_ufc_sb1, (s & 0xffff)+4);  
+        r1 ^= SBA(_ufc_sb0, s >>= 16);   r2 ^= SBA(_ufc_sb0, (s)         +4); 
+        s = *k++ ^ l2; 
+        r1 ^= SBA(_ufc_sb3, s & 0xffff); r2 ^= SBA(_ufc_sb3, (s & 0xffff)+4);  
+        r1 ^= SBA(_ufc_sb2, s >>= 16);   r2 ^= SBA(_ufc_sb2, (s)         +4);
+      } 
+      s=l1; l1=r1; r1=s; s=l2; l2=r2; r2=s;
+    }
+    return _ufc_dofinalperm(l1, l2, r1, r2);
+  }
+
+#endif
+
+#ifdef _UFC_64_
+
+/*
+ * 64 bit version
+ */
+
+extern long64 _ufc_keytab[16];
+extern long64 _ufc_sb0[], _ufc_sb1[], _ufc_sb2[], _ufc_sb3[];
+
+#define SBA(sb, v) (*(long64*)((char*)(sb)+(v)))
+
+static ufc_long *_ufc_doit(ufc_long l1, ufc_long l2, ufc_long r1, ufc_long r2, ufc_long itr)
+  { int i;
+    long64 l, r, s, *k;
+
+    l = (((long64)l1) << 32) | ((long64)l2);
+    r = (((long64)r1) << 32) | ((long64)r2);
+
+    while(itr--) {
+      k = &_ufc_keytab[0];
+      for(i=8; i--; ) {
+	s = *k++ ^ r;
+	l ^= SBA(_ufc_sb3, (s >>  0) & 0xffff);
+        l ^= SBA(_ufc_sb2, (s >> 16) & 0xffff);
+        l ^= SBA(_ufc_sb1, (s >> 32) & 0xffff);
+        l ^= SBA(_ufc_sb0, (s >> 48) & 0xffff);
+
+	s = *k++ ^ l;
+	r ^= SBA(_ufc_sb3, (s >>  0) & 0xffff);
+        r ^= SBA(_ufc_sb2, (s >> 16) & 0xffff);
+        r ^= SBA(_ufc_sb1, (s >> 32) & 0xffff);
+        r ^= SBA(_ufc_sb0, (s >> 48) & 0xffff);
+      } 
+      s=l; l=r; r=s;
+    }
+
+    l1 = l >> 32; l2 = l & 0xffffffff;
+    r1 = r >> 32; r2 = r & 0xffffffff;
+    return _ufc_dofinalperm(l1, l2, r1, r2);
+  }
+
+#endif
+
+
+#else
+ int ufc_dummy_procedure(void);
+ int ufc_dummy_procedure(void) {return 0;}
+#endif

Added: branches/talloc/experimental/lib/replace/crypt.m4
===================================================================
--- branches/talloc/experimental/lib/replace/crypt.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/crypt.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,6 @@
+###############################################
+# test for where we get crypt() from
+AC_CHECK_HEADERS(crypt.h)
+AC_SEARCH_LIBS_EXT(crypt, [crypt], CRYPT_LIBS,
+  [ AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function]) ],
+  [ LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/crypt.o" ])

Added: branches/talloc/experimental/lib/replace/dlfcn.c
===================================================================
--- branches/talloc/experimental/lib/replace/dlfcn.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/dlfcn.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,76 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba system utilities
+   Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) Jeremy Allison 1998-2002
+   Copyright (C) Jelmer Vernooij 2006
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+#ifdef HAVE_DL_H
+#include <dl.h>
+#endif
+
+#ifndef HAVE_DLOPEN
+#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
+void *rep_dlopen(const char *name, unsigned int flags)
+#else
+void *rep_dlopen(const char *name, int flags)
+#endif
+{
+#ifdef HAVE_SHL_LOAD
+	if (name == NULL)
+		return PROG_HANDLE;
+	return (void *)shl_load(name, flags, 0);
+#else
+	return NULL;
+#endif
+}
+#endif
+
+#ifndef HAVE_DLSYM
+void *rep_dlsym(void *handle, const char *symbol)
+{
+#ifdef HAVE_SHL_FINDSYM
+	void *sym_addr;
+	if (!shl_findsym((shl_t *)&handle, symbol, TYPE_UNDEFINED, &sym_addr))
+		return sym_addr;
+#endif
+    return NULL;
+}
+#endif
+
+#ifndef HAVE_DLERROR
+char *rep_dlerror(void)
+{
+	return "dynamic loading of objects not supported on this platform";
+}
+#endif
+
+#ifndef HAVE_DLCLOSE
+int rep_dlclose(void *handle)
+{
+#ifdef HAVE_SHL_CLOSE
+	return shl_unload((shl_t)handle);
+#else
+	return 0;
+#endif
+}
+#endif

Added: branches/talloc/experimental/lib/replace/dlfcn.m4
===================================================================
--- branches/talloc/experimental/lib/replace/dlfcn.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/dlfcn.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,31 @@
+dnl dummies provided by dlfcn.c if not available
+save_LIBS="$LIBS"
+LIBS=""
+
+libreplace_cv_dlfcn=no
+AC_SEARCH_LIBS(dlopen, dl)
+
+AC_CHECK_HEADERS(dlfcn.h)
+AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])
+
+libreplace_cv_shl=no
+AC_SEARCH_LIBS(shl_load, sl)
+AC_CHECK_HEADERS(dl.h)
+AC_CHECK_FUNCS([shl_load shl_unload shl_findsym],[],[libreplace_cv_shl=yes])
+
+AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
+	[
+	return 0;
+	],[
+	AC_DEFINE(DLOPEN_TAKES_UNSIGNED_FLAGS, 1, [Whether dlopen takes unsigned int flags])
+	],[],[
+	#include <dlfcn.h>
+	])
+
+if test x"${libreplace_cv_dlfcn}" = x"yes";then
+	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/dlfcn.o"
+fi
+
+LIBDL="$LIBS"
+AC_SUBST(LIBDL)
+LIBS="$save_LIBS"

Added: branches/talloc/experimental/lib/replace/getaddrinfo.c
===================================================================
--- branches/talloc/experimental/lib/replace/getaddrinfo.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/getaddrinfo.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,497 @@
+/*
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this paragraph
+and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
+EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
+TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+*/
+
+/*-------------------------------------------------------------------------
+ *
+ * getaddrinfo.c
+ *	  Support getaddrinfo() on platforms that don't have it.
+ *
+ * We also supply getnameinfo() here, assuming that the platform will have
+ * it if and only if it has getaddrinfo().	If this proves false on some
+ * platform, we'll need to split this file and provide a separate configure
+ * test for getnameinfo().
+ *
+ * Copyright (c) 2003-2007, PostgreSQL Global Development Group
+ *
+ * Copyright (C) 2007 Jeremy Allison.
+ * Modified to return multiple IPv4 addresses for Samba.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+#ifndef SMB_MALLOC
+#define SMB_MALLOC(s) malloc(s)
+#endif
+
+#ifndef SMB_STRDUP
+#define SMB_STRDUP(s) strdup(s)
+#endif
+
+static int check_hostent_err(struct hostent *hp)
+{
+	if (!hp) {
+		switch (h_errno) {
+			case HOST_NOT_FOUND:
+			case NO_DATA:
+				return EAI_NONAME;
+			case TRY_AGAIN:
+				return EAI_AGAIN;
+			case NO_RECOVERY:
+			default:
+				return EAI_FAIL;
+		}
+	}
+	if (!hp->h_name || hp->h_addrtype != AF_INET) {
+		return EAI_FAIL;
+	}
+	return 0;
+}
+
+static char *canon_name_from_hostent(struct hostent *hp,
+				int *perr)
+{
+	char *ret = NULL;
+
+	*perr = check_hostent_err(hp);
+	if (*perr) {
+		return NULL;
+	}
+	ret = SMB_STRDUP(hp->h_name);
+	if (!ret) {
+		*perr = EAI_MEMORY;
+	}
+	return ret;
+}
+
+static char *get_my_canon_name(int *perr)
+{
+	char name[HOST_NAME_MAX+1];
+
+	if (gethostname(name, HOST_NAME_MAX) == -1) {
+		*perr = EAI_FAIL;
+		return NULL;
+	}
+	/* Ensure null termination. */
+	name[HOST_NAME_MAX] = '\0';
+	return canon_name_from_hostent(gethostbyname(name), perr);
+}
+
+static char *get_canon_name_from_addr(struct in_addr ip,
+				int *perr)
+{
+	return canon_name_from_hostent(
+			gethostbyaddr(&ip, sizeof(ip), AF_INET),
+			perr);
+}
+
+static struct addrinfo *alloc_entry(const struct addrinfo *hints,
+				struct in_addr ip,
+				unsigned short port)
+{
+	struct sockaddr_in *psin = NULL;
+	struct addrinfo *ai = SMB_MALLOC(sizeof(*ai));
+
+	if (!ai) {
+		return NULL;
+	}
+	memset(ai, '\0', sizeof(*ai));
+
+	psin = SMB_MALLOC(sizeof(*psin));
+	if (!psin) {
+		free(ai);
+		return NULL;
+	}
+
+	memset(psin, '\0', sizeof(*psin));
+
+	psin->sin_family = AF_INET;
+	psin->sin_port = htons(port);
+	psin->sin_addr = ip;
+
+	ai->ai_flags = 0;
+	ai->ai_family = AF_INET;
+	ai->ai_socktype = hints->ai_socktype;
+	ai->ai_protocol = hints->ai_protocol;
+	ai->ai_addrlen = sizeof(*psin);
+	ai->ai_addr = (struct sockaddr *) psin;
+	ai->ai_canonname = NULL;
+	ai->ai_next = NULL;
+
+	return ai;
+}
+
+/*
+ * get address info for a single ipv4 address.
+ *
+ *	Bugs:	- servname can only be a number, not text.
+ */
+
+static int getaddr_info_single_addr(const char *service,
+				uint32_t addr,
+				const struct addrinfo *hints,
+				struct addrinfo **res)
+{
+
+	struct addrinfo *ai = NULL;
+	struct in_addr ip;
+	unsigned short port = 0;
+
+	if (service) {
+		port = (unsigned short)atoi(service);
+	}
+	ip.s_addr = htonl(addr);
+
+	ai = alloc_entry(hints, ip, port);
+	if (!ai) {
+		return EAI_MEMORY;
+	}
+
+	/* If we're asked for the canonical name,
+	 * make sure it returns correctly. */
+	if (!(hints->ai_flags & AI_NUMERICSERV) &&
+			hints->ai_flags & AI_CANONNAME) {
+		int err;
+		if (addr == INADDR_LOOPBACK || addr == INADDR_ANY) {
+			ai->ai_canonname = get_my_canon_name(&err);
+		} else {
+			ai->ai_canonname =
+			get_canon_name_from_addr(ip,&err);
+		}
+		if (ai->ai_canonname == NULL) {
+			freeaddrinfo(ai);
+			return err;
+		}
+	}
+
+	*res = ai;
+	return 0;
+}
+
+/*
+ * get address info for multiple ipv4 addresses.
+ *
+ *	Bugs:	- servname can only be a number, not text.
+ */
+
+static int getaddr_info_name(const char *node,
+				const char *service,
+				const struct addrinfo *hints,
+				struct addrinfo **res)
+{
+	struct addrinfo *listp = NULL, *prevp = NULL;
+	char **pptr = NULL;
+	int err;
+	struct hostent *hp = NULL;
+	unsigned short port = 0;
+
+	if (service) {
+		port = (unsigned short)atoi(service);
+	}
+
+	hp = gethostbyname(node);
+	err = check_hostent_err(hp);
+	if (err) {
+		return err;
+	}
+
+	for(pptr = hp->h_addr_list; *pptr; pptr++) {
+		struct in_addr ip = *(struct in_addr *)*pptr;
+		struct addrinfo *ai = alloc_entry(hints, ip, port);
+
+		if (!ai) {
+			freeaddrinfo(listp);
+			return EAI_MEMORY;
+		}
+
+		if (!listp) {
+			listp = ai;
+			prevp = ai;
+			ai->ai_canonname = SMB_STRDUP(hp->h_name);
+			if (!ai->ai_canonname) {
+				freeaddrinfo(listp);
+				return EAI_MEMORY;
+			}
+		} else {
+			prevp->ai_next = ai;
+			prevp = ai;
+		}
+	}
+	*res = listp;
+	return 0;
+}
+
+/*
+ * get address info for ipv4 sockets.
+ *
+ *	Bugs:	- servname can only be a number, not text.
+ */
+
+int rep_getaddrinfo(const char *node,
+		const char *service,
+		const struct addrinfo * hintp,
+		struct addrinfo ** res)
+{
+	struct addrinfo hints;
+
+	/* Setup the hints struct. */
+	if (hintp == NULL) {
+		memset(&hints, 0, sizeof(hints));
+		hints.ai_family = AF_INET;
+		hints.ai_socktype = SOCK_STREAM;
+	} else {
+		memcpy(&hints, hintp, sizeof(hints));
+	}
+
+	if (hints.ai_family != AF_INET && hints.ai_family != AF_UNSPEC) {
+		return EAI_FAMILY;
+	}
+
+	if (hints.ai_socktype == 0) {
+		hints.ai_socktype = SOCK_STREAM;
+	}
+
+	if (!node && !service) {
+		return EAI_NONAME;
+	}
+
+	if (node) {
+		if (node[0] == '\0') {
+			return getaddr_info_single_addr(service,
+					INADDR_ANY,
+					&hints,
+					res);
+		} else if (hints.ai_flags & AI_NUMERICHOST) {
+			struct in_addr ip;
+			if (!inet_aton(node, &ip)) {
+				return EAI_FAIL;
+			}
+			return getaddr_info_single_addr(service,
+					ntohl(ip.s_addr),
+					&hints,
+					res);
+		} else {
+			return getaddr_info_name(node,
+						service,
+						&hints,
+						res);
+		}
+	} else if (hints.ai_flags & AI_PASSIVE) {
+		return getaddr_info_single_addr(service,
+					INADDR_ANY,
+					&hints,
+					res);
+	}
+	return getaddr_info_single_addr(service,
+					INADDR_LOOPBACK,
+					&hints,
+					res);
+}
+
+
+void rep_freeaddrinfo(struct addrinfo *res)
+{
+	struct addrinfo *next = NULL;
+
+	for (;res; res = next) {
+		next = res->ai_next;
+		if (res->ai_canonname) {
+			free(res->ai_canonname);
+		}
+		if (res->ai_addr) {
+			free(res->ai_addr);
+		}
+		free(res);
+	}
+}
+
+
+const char *rep_gai_strerror(int errcode)
+{
+#ifdef HAVE_HSTRERROR
+	int			hcode;
+
+	switch (errcode)
+	{
+		case EAI_NONAME:
+			hcode = HOST_NOT_FOUND;
+			break;
+		case EAI_AGAIN:
+			hcode = TRY_AGAIN;
+			break;
+		case EAI_FAIL:
+		default:
+			hcode = NO_RECOVERY;
+			break;
+	}
+
+	return hstrerror(hcode);
+#else							/* !HAVE_HSTRERROR */
+
+	switch (errcode)
+	{
+		case EAI_NONAME:
+			return "Unknown host";
+		case EAI_AGAIN:
+			return "Host name lookup failure";
+#ifdef EAI_BADFLAGS
+		case EAI_BADFLAGS:
+			return "Invalid argument";
+#endif
+#ifdef EAI_FAMILY
+		case EAI_FAMILY:
+			return "Address family not supported";
+#endif
+#ifdef EAI_MEMORY
+		case EAI_MEMORY:
+			return "Not enough memory";
+#endif
+#ifdef EAI_NODATA
+		case EAI_NODATA:
+			return "No host data of that type was found";
+#endif
+#ifdef EAI_SERVICE
+		case EAI_SERVICE:
+			return "Class type not found";
+#endif
+#ifdef EAI_SOCKTYPE
+		case EAI_SOCKTYPE:
+			return "Socket type not supported";
+#endif
+		default:
+			return "Unknown server error";
+	}
+#endif   /* HAVE_HSTRERROR */
+}
+
+static int gethostnameinfo(const struct sockaddr *sa,
+			char *node,
+			size_t nodelen,
+			int flags)
+{
+	int ret = -1;
+	char *p = NULL;
+
+	if (!(flags & NI_NUMERICHOST)) {
+		struct hostent *hp = gethostbyaddr(
+				&((struct sockaddr_in *)sa)->sin_addr,
+				sizeof(struct in_addr),
+				sa->sa_family);
+		ret = check_hostent_err(hp);
+		if (ret == 0) {
+			/* Name looked up successfully. */
+			ret = snprintf(node, nodelen, "%s", hp->h_name);
+			if (ret < 0 || (size_t)ret >= nodelen) {
+				return EAI_MEMORY;
+			}
+			if (flags & NI_NOFQDN) {
+				p = strchr(node,'.');
+				if (p) {
+					*p = '\0';
+				}
+			}
+			return 0;
+		}
+
+		if (flags & NI_NAMEREQD) {
+			/* If we require a name and didn't get one,
+			 * automatically fail. */
+			return ret;
+		}
+		/* Otherwise just fall into the numeric host code... */
+	}
+	p = inet_ntoa(((struct sockaddr_in *)sa)->sin_addr);
+	ret = snprintf(node, nodelen, "%s", p);
+	if (ret < 0 || (size_t)ret >= nodelen) {
+		return EAI_MEMORY;
+	}
+	return 0;
+}
+
+static int getservicenameinfo(const struct sockaddr *sa,
+			char *service,
+			size_t servicelen,
+			int flags)
+{
+	int ret = -1;
+	int port = ntohs(((struct sockaddr_in *)sa)->sin_port);
+
+	if (!(flags & NI_NUMERICSERV)) {
+		struct servent *se = getservbyport(
+				port,
+				(flags & NI_DGRAM) ? "udp" : "tcp");
+		if (se && se->s_name) {
+			/* Service name looked up successfully. */
+			ret = snprintf(service, servicelen, "%s", se->s_name);
+			if (ret < 0 || (size_t)ret >= servicelen) {
+				return EAI_MEMORY;
+			}
+			return 0;
+		}
+		/* Otherwise just fall into the numeric service code... */
+	}
+	ret = snprintf(service, servicelen, "%d", port);
+	if (ret < 0 || (size_t)ret >= servicelen) {
+		return EAI_MEMORY;
+	}
+	return 0;
+}
+
+/*
+ * Convert an ipv4 address to a hostname.
+ *
+ * Bugs:	- No IPv6 support.
+ */
+int rep_getnameinfo(const struct sockaddr *sa, socklen_t salen,
+			char *node, size_t nodelen,
+			char *service, size_t servicelen, int flags)
+{
+
+	/* Invalid arguments. */
+	if (sa == NULL || (node == NULL && service == NULL)) {
+		return EAI_FAIL;
+	}
+
+	if (sa->sa_family != AF_INET) {
+		return EAI_FAIL;
+	}
+
+	if (salen < sizeof(struct sockaddr_in)) {
+		return EAI_FAIL;
+	}
+
+	if (node) {
+		return gethostnameinfo(sa, node, nodelen, flags);
+	}
+
+	if (service) {
+		return getservicenameinfo(sa, service, servicelen, flags);
+	}
+	return 0;
+}

Added: branches/talloc/experimental/lib/replace/getaddrinfo.h
===================================================================
--- branches/talloc/experimental/lib/replace/getaddrinfo.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/getaddrinfo.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,91 @@
+/*
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this paragraph
+and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
+EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
+TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+*/
+
+/*-------------------------------------------------------------------------
+ *
+ * getaddrinfo.h
+ *	  Support getaddrinfo() on platforms that don't have it.
+ *
+ * Note: we use our own routines on platforms that don't HAVE_STRUCT_ADDRINFO,
+ * whether or not the library routine getaddrinfo() can be found.  This
+ * policy is needed because on some platforms a manually installed libbind.a
+ * may provide getaddrinfo(), yet the system headers may not provide the
+ * struct definitions needed to call it.  To avoid conflict with the libbind
+ * definition in such cases, we rename our routines to pg_xxx() via macros.
+ *
+
+in lib/replace we use rep_xxx()
+
+ * This code will also work on platforms where struct addrinfo is defined
+ * in the system headers but no getaddrinfo() can be located.
+ *
+ * Copyright (c) 2003-2007, PostgreSQL Global Development Group
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef GETADDRINFO_H
+#define GETADDRINFO_H
+
+#ifndef HAVE_GETADDRINFO
+
+/* Rename private copies per comments above */
+#ifdef getaddrinfo
+#undef getaddrinfo
+#endif
+#define getaddrinfo rep_getaddrinfo
+#define HAVE_GETADDRINFO
+
+#ifdef freeaddrinfo
+#undef freeaddrinfo
+#endif
+#define freeaddrinfo rep_freeaddrinfo
+#define HAVE_FREEADDRINFO
+
+#ifdef gai_strerror
+#undef gai_strerror
+#endif
+#define gai_strerror rep_gai_strerror
+#define HAVE_GAI_STRERROR
+
+#ifdef getnameinfo
+#undef getnameinfo
+#endif
+#define getnameinfo rep_getnameinfo
+#ifndef HAVE_GETNAMEINFO
+#define HAVE_GETNAMEINFO
+#endif
+
+extern int rep_getaddrinfo(const char *node, const char *service,
+			const struct addrinfo * hints, struct addrinfo ** res);
+extern void rep_freeaddrinfo(struct addrinfo * res);
+extern const char *rep_gai_strerror(int errcode);
+extern int rep_getnameinfo(const struct sockaddr * sa, socklen_t salen,
+			char *node, size_t nodelen,
+			char *service, size_t servicelen, int flags);
+#endif   /* HAVE_GETADDRINFO */
+
+#endif   /* GETADDRINFO_H */

Added: branches/talloc/experimental/lib/replace/getifaddrs.c
===================================================================
--- branches/talloc/experimental/lib/replace/getifaddrs.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/getifaddrs.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,352 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1998
+   Copyright (C) Jeremy Allison 2007
+   Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2007
+   
+   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 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#define SOCKET_WRAPPER_NOT_REPLACE
+
+#include "replace.h"
+#include "system/network.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifndef SIOCGIFCONF
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#endif
+
+#ifdef HAVE_IFACE_GETIFADDRS
+#define _FOUND_IFACE_ANY
+#else
+
+void rep_freeifaddrs(struct ifaddrs *ifp)
+{
+	if (ifp != NULL) {
+		free(ifp->ifa_name);
+		free(ifp->ifa_addr);
+		free(ifp->ifa_netmask);
+		free(ifp->ifa_dstaddr);
+		freeifaddrs(ifp->ifa_next);
+		free(ifp);
+	}
+}
+
+static struct sockaddr *sockaddr_dup(struct sockaddr *sa)
+{
+	struct sockaddr *ret;
+	socklen_t socklen;
+#ifdef HAVE_SOCKADDR_SA_LEN
+	socklen = sa->sa_len;
+#else
+	socklen = sizeof(struct sockaddr_storage);
+#endif
+	ret = calloc(1, socklen);
+	if (ret == NULL)
+		return NULL;
+	memcpy(ret, sa, socklen);
+	return ret;
+}
+#endif
+
+#if HAVE_IFACE_IFCONF
+
+/* this works for Linux 2.2, Solaris 2.5, SunOS4, HPUX 10.20, OSF1
+   V4.0, Ultrix 4.4, SCO Unix 3.2, IRIX 6.4 and FreeBSD 3.2.
+
+   It probably also works on any BSD style system.  */
+
+int rep_getifaddrs(struct ifaddrs **ifap)
+{
+	struct ifconf ifc;
+	char buff[8192];
+	int fd, i, n;
+	struct ifreq *ifr=NULL;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
+
+	*ifap = NULL;
+
+	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+		return -1;
+	}
+  
+	ifc.ifc_len = sizeof(buff);
+	ifc.ifc_buf = buff;
+
+	if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {
+		close(fd);
+		return -1;
+	} 
+
+	ifr = ifc.ifc_req;
+  
+	n = ifc.ifc_len / sizeof(struct ifreq);
+
+	/* Loop through interfaces, looking for given IP address */
+	for (i=n-1; i>=0; i--) {
+		if (ioctl(fd, SIOCGIFFLAGS, &ifr[i]) == -1) {
+			freeifaddrs(*ifap);
+			return -1;
+		}
+
+		curif = calloc(1, sizeof(struct ifaddrs));
+		curif->ifa_name = strdup(ifr[i].ifr_name);
+		curif->ifa_flags = ifr[i].ifr_flags;
+		curif->ifa_dstaddr = NULL;
+		curif->ifa_data = NULL;
+		curif->ifa_next = NULL;
+
+		curif->ifa_addr = NULL;
+		if (ioctl(fd, SIOCGIFADDR, &ifr[i]) != -1) {
+			curif->ifa_addr = sockaddr_dup(&ifr[i].ifr_addr);
+		}
+
+		curif->ifa_netmask = NULL;
+		if (ioctl(fd, SIOCGIFNETMASK, &ifr[i]) != -1) {
+			curif->ifa_netmask = sockaddr_dup(&ifr[i].ifr_addr);
+		}
+
+		if (lastif == NULL) {
+			*ifap = curif;
+		} else {
+			lastif->ifa_next = curif;
+		}
+		lastif = curif;
+	}
+
+	close(fd);
+
+	return 0;
+}  
+
+#define _FOUND_IFACE_ANY
+#endif /* HAVE_IFACE_IFCONF */
+#ifdef HAVE_IFACE_IFREQ
+
+#ifndef I_STR
+#include <sys/stropts.h>
+#endif
+
+/****************************************************************************
+this should cover most of the streams based systems
+Thanks to Andrej.Borsenkow at mow.siemens.ru for several ideas in this code
+****************************************************************************/
+int rep_getifaddrs(struct ifaddrs **ifap)
+{
+	struct ifreq ifreq;
+	struct strioctl strioctl;
+	char buff[8192];
+	int fd, i, n;
+	struct ifreq *ifr=NULL;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
+
+	*ifap = NULL;
+
+	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+		return -1;
+	}
+  
+	strioctl.ic_cmd = SIOCGIFCONF;
+	strioctl.ic_dp  = buff;
+	strioctl.ic_len = sizeof(buff);
+	if (ioctl(fd, I_STR, &strioctl) < 0) {
+		close(fd);
+		return -1;
+	} 
+
+	/* we can ignore the possible sizeof(int) here as the resulting
+	   number of interface structures won't change */
+	n = strioctl.ic_len / sizeof(struct ifreq);
+
+	/* we will assume that the kernel returns the length as an int
+           at the start of the buffer if the offered size is a
+           multiple of the structure size plus an int */
+	if (n*sizeof(struct ifreq) + sizeof(int) == strioctl.ic_len) {
+		ifr = (struct ifreq *)(buff + sizeof(int));  
+	} else {
+		ifr = (struct ifreq *)buff;  
+	}
+
+	/* Loop through interfaces */
+
+	for (i = 0; i<n; i++) {
+		ifreq = ifr[i];
+  
+		curif = calloc(1, sizeof(struct ifaddrs));
+		if (lastif == NULL) {
+			*ifap = curif;
+		} else {
+			lastif->ifa_next = curif;
+		}
+
+		strioctl.ic_cmd = SIOCGIFFLAGS;
+		strioctl.ic_dp  = (char *)&ifreq;
+		strioctl.ic_len = sizeof(struct ifreq);
+		if (ioctl(fd, I_STR, &strioctl) != 0) {
+			freeifaddrs(*ifap);
+			return -1;
+		}
+
+		curif->ifa_flags = ifreq.ifr_flags;
+		
+		strioctl.ic_cmd = SIOCGIFADDR;
+		strioctl.ic_dp  = (char *)&ifreq;
+		strioctl.ic_len = sizeof(struct ifreq);
+		if (ioctl(fd, I_STR, &strioctl) != 0) {
+			freeifaddrs(*ifap);
+			return -1;
+		}
+
+		curif->ifa_name = strdup(ifreq.ifr_name);
+		curif->ifa_addr = sockaddr_dup(&ifreq.ifr_addr);
+		curif->ifa_dstaddr = NULL;
+		curif->ifa_data = NULL;
+		curif->ifa_next = NULL;
+		curif->ifa_netmask = NULL;
+
+		strioctl.ic_cmd = SIOCGIFNETMASK;
+		strioctl.ic_dp  = (char *)&ifreq;
+		strioctl.ic_len = sizeof(struct ifreq);
+		if (ioctl(fd, I_STR, &strioctl) != 0) {
+			freeifaddrs(*ifap);
+			return -1;
+		}
+
+		curif->ifa_netmask = sockaddr_dup(&ifreq.ifr_addr);
+
+		lastif = curif;
+	}
+
+	close(fd);
+
+	return 0;
+}
+
+#define _FOUND_IFACE_ANY
+#endif /* HAVE_IFACE_IFREQ */
+#ifdef HAVE_IFACE_AIX
+
+/****************************************************************************
+this one is for AIX (tested on 4.2)
+****************************************************************************/
+int rep_getifaddrs(struct ifaddrs **ifap)
+{
+	char buff[8192];
+	int fd, i;
+	struct ifconf ifc;
+	struct ifreq *ifr=NULL;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
+
+	*ifap = NULL;
+
+	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+		return -1;
+	}
+
+	ifc.ifc_len = sizeof(buff);
+	ifc.ifc_buf = buff;
+
+	if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {
+		close(fd);
+		return -1;
+	}
+
+	ifr = ifc.ifc_req;
+
+	/* Loop through interfaces */
+	i = ifc.ifc_len;
+
+	while (i > 0) {
+		unsigned int inc;
+
+		inc = ifr->ifr_addr.sa_len;
+
+		if (ioctl(fd, SIOCGIFADDR, ifr) != 0) {
+			freeaddrinfo(*ifap);
+			return -1;
+		}
+
+		curif = calloc(1, sizeof(struct ifaddrs));
+		if (lastif == NULL) {
+			*ifap = curif;
+		} else {
+			lastif->ifa_next = curif;
+		}
+
+		curif->ifa_name = strdup(ifr->ifr_name);
+		curif->ifa_addr = sockaddr_dup(&ifr->ifr_addr);
+		curif->ifa_dstaddr = NULL;
+		curif->ifa_data = NULL;
+		curif->ifa_netmask = NULL;
+		curif->ifa_next = NULL;
+
+		if (ioctl(fd, SIOCGIFFLAGS, ifr) != 0) {
+			freeaddrinfo(*ifap);
+			return -1;
+		}
+
+		curif->ifa_flags = ifr->ifr_flags;
+
+		if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) {
+			freeaddrinfo(*ifap);
+			return -1;
+		}
+
+		curif->ifa_netmask = sockaddr_dup(&ifr->ifr_addr);
+
+		lastif = curif;
+
+	next:
+		/*
+		 * Patch from Archie Cobbs (archie at whistle.com).  The
+		 * addresses in the SIOCGIFCONF interface list have a
+		 * minimum size. Usually this doesn't matter, but if
+		 * your machine has tunnel interfaces, etc. that have
+		 * a zero length "link address", this does matter.  */
+
+		if (inc < sizeof(ifr->ifr_addr))
+			inc = sizeof(ifr->ifr_addr);
+		inc += IFNAMSIZ;
+
+		ifr = (struct ifreq*) (((char*) ifr) + inc);
+		i -= inc;
+	}
+
+	close(fd);
+	return 0;
+}
+
+#define _FOUND_IFACE_ANY
+#endif /* HAVE_IFACE_AIX */
+#ifndef _FOUND_IFACE_ANY
+int rep_getifaddrs(struct ifaddrs **ifap)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif

Added: branches/talloc/experimental/lib/replace/getpass.c
===================================================================
--- branches/talloc/experimental/lib/replace/getpass.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/getpass.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,218 @@
+/* Copyright (C) 1992-1998 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 3 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, see <http://www.gnu.org/licenses/>.  */
+
+/* Modified to use with samba by Jeremy Allison, 8th July 1995. */
+
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/wait.h"
+#include "system/terminal.h"
+#include "system/passwd.h"
+
+/*
+ * Define additional missing types
+ */
+#ifndef HAVE_SIG_ATOMIC_T_TYPE
+typedef int sig_atomic_t;
+#endif
+
+#ifndef SIGCLD
+#define SIGCLD SIGCHLD
+#endif
+
+#ifdef SYSV_TERMIO 
+
+/* SYSTEM V TERMIO HANDLING */
+
+static struct termio t;
+
+#define ECHO_IS_ON(t) ((t).c_lflag & ECHO)
+#define TURN_ECHO_OFF(t) ((t).c_lflag &= ~ECHO)
+#define TURN_ECHO_ON(t) ((t).c_lflag |= ECHO)
+
+#ifndef TCSAFLUSH
+#define TCSAFLUSH 1
+#endif
+
+#ifndef TCSANOW
+#define TCSANOW 0
+#endif
+
+static int tcgetattr(int fd, struct termio *_t)
+{
+	return ioctl(fd, TCGETA, _t);
+}
+
+static int tcsetattr(int fd, int flags, struct termio *_t)
+{
+	if(flags & TCSAFLUSH)
+		ioctl(fd, TCFLSH, TCIOFLUSH);
+	return ioctl(fd, TCSETS, _t);
+}
+
+#elif !defined(TCSAFLUSH)
+
+/* BSD TERMIO HANDLING */
+
+static struct sgttyb t;  
+
+#define ECHO_IS_ON(t) ((t).sg_flags & ECHO)
+#define TURN_ECHO_OFF(t) ((t).sg_flags &= ~ECHO)
+#define TURN_ECHO_ON(t) ((t).sg_flags |= ECHO)
+
+#define TCSAFLUSH 1
+#define TCSANOW 0
+
+static int tcgetattr(int fd, struct sgttyb *_t)
+{
+	return ioctl(fd, TIOCGETP, (char *)_t);
+}
+
+static int tcsetattr(int fd, int flags, struct sgttyb *_t)
+{
+	return ioctl(fd, TIOCSETP, (char *)_t);
+}
+
+#else /* POSIX TERMIO HANDLING */
+#define ECHO_IS_ON(t) ((t).c_lflag & ECHO)
+#define TURN_ECHO_OFF(t) ((t).c_lflag &= ~ECHO)
+#define TURN_ECHO_ON(t) ((t).c_lflag |= ECHO)
+
+static struct termios t;
+#endif /* SYSV_TERMIO */
+
+static void catch_signal(int signum, void (*handler)(int ))
+{
+#ifdef HAVE_SIGACTION
+	struct sigaction act;
+	struct sigaction oldact;
+
+	memset(&act, 0, sizeof(act));
+
+	act.sa_handler = handler;
+#ifdef SA_RESTART
+	/*
+	 * We *want* SIGALRM to interrupt a system call.
+	 */
+	if(signum != SIGALRM)
+		act.sa_flags = SA_RESTART;
+#endif
+	sigemptyset(&act.sa_mask);
+	sigaddset(&act.sa_mask,signum);
+	sigaction(signum,&act,&oldact);
+#else /* !HAVE_SIGACTION */
+	/* FIXME: need to handle sigvec and systems with broken signal() */
+	signal(signum, handler);
+#endif
+}
+
+static sig_atomic_t gotintr;
+static int in_fd = -1;
+
+/***************************************************************
+ Signal function to tell us were ^C'ed.
+****************************************************************/
+
+static void gotintr_sig(int signum)
+{
+	gotintr = 1;
+	if (in_fd != -1)
+		close(in_fd); /* Safe way to force a return. */
+	in_fd = -1;
+}
+
+char *rep_getpass(const char *prompt)
+{
+	FILE *in, *out;
+	int echo_off;
+	static char buf[256];
+	static size_t bufsize = sizeof(buf);
+	size_t nread;
+
+	/* Catch problematic signals */
+	catch_signal(SIGINT, gotintr_sig);
+
+	/* Try to write to and read from the terminal if we can.
+		If we can't open the terminal, use stderr and stdin.  */
+
+	in = fopen ("/dev/tty", "w+");
+	if (in == NULL) {
+		in = stdin;
+		out = stderr;
+	} else {
+		out = in;
+	}
+
+	setvbuf(in, NULL, _IONBF, 0);
+
+	/* Turn echoing off if it is on now.  */
+
+	if (tcgetattr (fileno (in), &t) == 0) {
+		if (ECHO_IS_ON(t)) {
+			TURN_ECHO_OFF(t);
+			echo_off = tcsetattr (fileno (in), TCSAFLUSH, &t) == 0;
+			TURN_ECHO_ON(t);
+		} else {
+			echo_off = 0;
+		}
+	} else {
+		echo_off = 0;
+	}
+
+	/* Write the prompt.  */
+	fputs(prompt, out);
+	fflush(out);
+
+	/* Read the password.  */
+	buf[0] = 0;
+	if (!gotintr) {
+		in_fd = fileno(in);
+		if (fgets(buf, bufsize, in) == NULL) {
+			buf[0] = 0;
+		}
+	}
+	nread = strlen(buf);
+	if (nread) {
+		if (buf[nread - 1] == '\n')
+			buf[nread - 1] = '\0';
+	}
+
+	/* Restore echoing.  */
+	if (echo_off) {
+		if (gotintr && in_fd == -1) {
+			in = fopen ("/dev/tty", "w+");
+		}
+		if (in != NULL)
+			tcsetattr (fileno (in), TCSANOW, &t);
+	}
+
+	fprintf(out, "\n");
+	fflush(out);
+
+	if (in && in != stdin) /* We opened the terminal; now close it.  */
+		fclose(in);
+
+	/* Catch problematic signals */
+	catch_signal(SIGINT, SIG_DFL);
+
+	if (gotintr) {
+		printf("Interrupted by signal.\n");
+		fflush(stdout);
+		exit(1);
+	}
+	return buf;
+}

Added: branches/talloc/experimental/lib/replace/getpass.m4
===================================================================
--- branches/talloc/experimental/lib/replace/getpass.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/getpass.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,24 @@
+AC_CHECK_FUNC(getpass, libreplace_cv_HAVE_GETPASS=yes)
+AC_CHECK_FUNC(getpassphrase, libreplace_cv_HAVE_GETPASSPHRASE=yes)
+if test x"$libreplace_cv_HAVE_GETPASS" = x"yes" -a x"$libreplace_cv_HAVE_GETPASSPHRASE" = x"yes"; then
+        AC_DEFINE(REPLACE_GETPASS_BY_GETPASSPHRASE, 1, [getpass returns <9 chars where getpassphrase returns <265 chars])
+	AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
+	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/getpass.o"
+else
+
+AC_CACHE_CHECK([whether getpass should be replaced],libreplace_cv_REPLACE_GETPASS,[
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$libreplacedir/"
+AC_TRY_COMPILE([
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "$libreplacedir/getpass.c"
+],[],libreplace_cv_REPLACE_GETPASS=yes,libreplace_cv_REPLACE_GETPASS=no)
+CPPFLAGS="$SAVE_CPPFLAGS"
+])
+if test x"$libreplace_cv_REPLACE_GETPASS" = x"yes"; then
+	AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
+	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/getpass.o"
+fi
+
+fi

Added: branches/talloc/experimental/lib/replace/hdr_replace.h
===================================================================
--- branches/talloc/experimental/lib/replace/hdr_replace.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/hdr_replace.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,2 @@
+/* this is a replacement header for a missing system header */
+#include "replace.h"

Added: branches/talloc/experimental/lib/replace/inet_aton.c
===================================================================
--- branches/talloc/experimental/lib/replace/inet_aton.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/inet_aton.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,33 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * replacement functions
+ * Copyright (C) Michael Adam <obnox at samba.org> 2008
+ *
+ *  ** NOTE! The following LGPL license applies to the replace
+ *  ** library. This does NOT imply that all of Samba is released
+ *  ** under the LGPL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+/**
+ * We know that we have inet_pton from earlier libreplace checks.
+ */
+int rep_inet_aton(const char *src, struct in_addr *dst)
+{
+	return (inet_pton(AF_INET, src, dst) > 0) ? 1 : 0;
+}

Added: branches/talloc/experimental/lib/replace/inet_ntoa.c
===================================================================
--- branches/talloc/experimental/lib/replace/inet_ntoa.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/inet_ntoa.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,39 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * replacement routines for broken systems
+ * Copyright (C) Andrew Tridgell 2003
+ * Copyright (C) Michael Adam 2008
+ *
+ *  ** NOTE! The following LGPL license applies to the replace
+ *  ** library. This does NOT imply that all of Samba is released
+ *  ** under the LGPL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+/**
+ * NOTE: this is not thread safe, but it can't be, either
+ * since it returns a pointer to static memory.
+ */
+char *rep_inet_ntoa(struct in_addr ip)
+{
+	uint8_t *p = (uint8_t *)&ip.s_addr;
+	static char buf[18];
+	slprintf(buf, 17, "%d.%d.%d.%d",
+		 (int)p[0], (int)p[1], (int)p[2], (int)p[3]);
+	return buf;
+}

Added: branches/talloc/experimental/lib/replace/inet_ntop.c
===================================================================
--- branches/talloc/experimental/lib/replace/inet_ntop.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/inet_ntop.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 1996-2001  Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#include "replace.h"
+#include "system/network.h"
+
+#define NS_INT16SZ	 2
+#define NS_IN6ADDRSZ	16
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static const char *inet_ntop4(const unsigned char *src, char *dst,
+			      socklen_t size);
+
+#ifdef AF_INET6
+static const char *inet_ntop6(const unsigned char *src, char *dst,
+			      socklen_t size);
+#endif
+
+/* char *
+ * isc_net_ntop(af, src, dst, size)
+ *	convert a network format address to presentation format.
+ * return:
+ *	pointer to presentation format address (`dst'), or NULL (see errno).
+ * author:
+ *	Paul Vixie, 1996.
+ */
+const char *
+rep_inet_ntop(int af, const void *src, char *dst, socklen_t size)
+{
+	switch (af) {
+	case AF_INET:
+		return (inet_ntop4(src, dst, size));
+#ifdef AF_INET6
+	case AF_INET6:
+		return (inet_ntop6(src, dst, size));
+#endif
+	default:
+		errno = EAFNOSUPPORT;
+		return (NULL);
+	}
+	/* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ *	format an IPv4 address
+ * return:
+ *	`dst' (as a const)
+ * notes:
+ *	(1) uses no statics
+ *	(2) takes a unsigned char* not an in_addr as input
+ * author:
+ *	Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4(const unsigned char *src, char *dst, socklen_t size)
+{
+	static const char *fmt = "%u.%u.%u.%u";
+	char tmp[sizeof "255.255.255.255"];
+	size_t len;
+
+	len = snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]);
+	if (len >= size) {
+		errno = ENOSPC;
+		return (NULL);
+	}
+	memcpy(dst, tmp, len + 1);
+
+	return (dst);
+}
+
+/* const char *
+ * isc_inet_ntop6(src, dst, size)
+ *	convert IPv6 binary address into presentation (printable) format
+ * author:
+ *	Paul Vixie, 1996.
+ */
+#ifdef AF_INET6
+static const char *
+inet_ntop6(const unsigned char *src, char *dst, socklen_t size)
+{
+	/*
+	 * Note that int32_t and int16_t need only be "at least" large enough
+	 * to contain a value of the specified size.  On some systems, like
+	 * Crays, there is no such thing as an integer variable with 16 bits.
+	 * Keep this in mind if you think this function should have been coded
+	 * to use pointer overlays.  All the world's not a VAX.
+	 */
+	char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+	struct { int base, len; } best, cur;
+	unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+	int i, inc;
+
+	/*
+	 * Preprocess:
+	 *	Copy the input (bytewise) array into a wordwise array.
+	 *	Find the longest run of 0x00's in src[] for :: shorthanding.
+	 */
+	memset(words, '\0', sizeof words);
+	for (i = 0; i < NS_IN6ADDRSZ; i++)
+		words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+	best.base = -1;
+	best.len = 0;
+	cur.base = -1;
+	cur.len = 0;
+	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+		if (words[i] == 0) {
+			if (cur.base == -1)
+				cur.base = i, cur.len = 1;
+			else
+				cur.len++;
+		} else {
+			if (cur.base != -1) {
+				if (best.base == -1 || cur.len > best.len)
+					best = cur;
+				cur.base = -1;
+			}
+		}
+	}
+	if (cur.base != -1) {
+		if (best.base == -1 || cur.len > best.len)
+			best = cur;
+	}
+	if (best.base != -1 && best.len < 2)
+		best.base = -1;
+
+	/*
+	 * Format the result.
+	 */
+	tp = tmp;
+	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+		/* Are we inside the best run of 0x00's? */
+		if (best.base != -1 && i >= best.base &&
+		    i < (best.base + best.len)) {
+			if (i == best.base)
+				*tp++ = ':';
+			continue;
+		}
+		/* Are we following an initial run of 0x00s or any real hex? */
+		if (i != 0)
+			*tp++ = ':';
+		/* Is this address an encapsulated IPv4? */
+		if (i == 6 && best.base == 0 &&
+		    (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
+			if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+				return (NULL);
+			tp += strlen(tp);
+			break;
+		}
+		inc = snprintf(tp, 5, "%x", words[i]);
+		if (inc >= 5) {
+			abort();
+		}
+		tp += inc;
+	}
+	/* Was it a trailing run of 0x00's? */
+	if (best.base != -1 && (best.base + best.len) ==
+	    (NS_IN6ADDRSZ / NS_INT16SZ))
+		*tp++ = ':';
+	*tp++ = '\0';
+
+	/*
+	 * Check for overflow, copy, and we're done.
+	 */
+	if ((size_t)(tp - tmp) > size) {
+		errno = ENOSPC;
+		return (NULL);
+	}
+	memcpy(dst, tmp, tp - tmp);
+	return (dst);
+}
+#endif /* AF_INET6 */

Added: branches/talloc/experimental/lib/replace/inet_pton.c
===================================================================
--- branches/talloc/experimental/lib/replace/inet_pton.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/inet_pton.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 1996-2001  Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+#define NS_INT16SZ	 2
+#define NS_INADDRSZ	 4
+#define NS_IN6ADDRSZ	16
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4(const char *src, unsigned char *dst);
+#ifdef AF_INET6
+static int inet_pton6(const char *src, unsigned char *dst);
+#endif
+
+/* int
+ * inet_pton(af, src, dst)
+ *	convert from presentation format (which usually means ASCII printable)
+ *	to network format (which is usually some kind of binary format).
+ * return:
+ *	1 if the address was valid for the specified address family
+ *	0 if the address wasn't valid (`dst' is untouched in this case)
+ *	-1 if some other error occurred (`dst' is untouched in this case, too)
+ * author:
+ *	Paul Vixie, 1996.
+ */
+int
+rep_inet_pton(int af,
+	  const char *src,
+	  void *dst)
+{
+	switch (af) {
+	case AF_INET:
+		return (inet_pton4(src, dst));
+#ifdef AF_INET6
+	case AF_INET6:
+		return (inet_pton6(src, dst));
+#endif
+	default:
+		errno = EAFNOSUPPORT;
+		return (-1);
+	}
+	/* NOTREACHED */
+}
+
+/* int
+ * inet_pton4(src, dst)
+ *	like inet_aton() but without all the hexadecimal and shorthand.
+ * return:
+ *	1 if `src' is a valid dotted quad, else 0.
+ * notice:
+ *	does not touch `dst' unless it's returning 1.
+ * author:
+ *	Paul Vixie, 1996.
+ */
+static int
+inet_pton4(src, dst)
+	const char *src;
+	unsigned char *dst;
+{
+	static const char digits[] = "0123456789";
+	int saw_digit, octets, ch;
+	unsigned char tmp[NS_INADDRSZ], *tp;
+
+	saw_digit = 0;
+	octets = 0;
+	*(tp = tmp) = 0;
+	while ((ch = *src++) != '\0') {
+		const char *pch;
+
+		if ((pch = strchr(digits, ch)) != NULL) {
+			unsigned int new = *tp * 10 + (pch - digits);
+
+			if (new > 255)
+				return (0);
+			*tp = new;
+			if (! saw_digit) {
+				if (++octets > 4)
+					return (0);
+				saw_digit = 1;
+			}
+		} else if (ch == '.' && saw_digit) {
+			if (octets == 4)
+				return (0);
+			*++tp = 0;
+			saw_digit = 0;
+		} else
+			return (0);
+	}
+	if (octets < 4)
+		return (0);
+	memcpy(dst, tmp, NS_INADDRSZ);
+	return (1);
+}
+
+/* int
+ * inet_pton6(src, dst)
+ *	convert presentation level address to network order binary form.
+ * return:
+ *	1 if `src' is a valid [RFC1884 2.2] address, else 0.
+ * notice:
+ *	(1) does not touch `dst' unless it's returning 1.
+ *	(2) :: in a full address is silently ignored.
+ * credit:
+ *	inspired by Mark Andrews.
+ * author:
+ *	Paul Vixie, 1996.
+ */
+#ifdef AF_INET6
+static int
+inet_pton6(src, dst)
+	const char *src;
+	unsigned char *dst;
+{
+	static const char xdigits_l[] = "0123456789abcdef",
+			  xdigits_u[] = "0123456789ABCDEF";
+	unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+	const char *xdigits, *curtok;
+	int ch, saw_xdigit;
+	unsigned int val;
+
+	memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+	endp = tp + NS_IN6ADDRSZ;
+	colonp = NULL;
+	/* Leading :: requires some special handling. */
+	if (*src == ':')
+		if (*++src != ':')
+			return (0);
+	curtok = src;
+	saw_xdigit = 0;
+	val = 0;
+	while ((ch = *src++) != '\0') {
+		const char *pch;
+
+		if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+			pch = strchr((xdigits = xdigits_u), ch);
+		if (pch != NULL) {
+			val <<= 4;
+			val |= (pch - xdigits);
+			if (val > 0xffff)
+				return (0);
+			saw_xdigit = 1;
+			continue;
+		}
+		if (ch == ':') {
+			curtok = src;
+			if (!saw_xdigit) {
+				if (colonp)
+					return (0);
+				colonp = tp;
+				continue;
+			}
+			if (tp + NS_INT16SZ > endp)
+				return (0);
+			*tp++ = (unsigned char) (val >> 8) & 0xff;
+			*tp++ = (unsigned char) val & 0xff;
+			saw_xdigit = 0;
+			val = 0;
+			continue;
+		}
+		if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+		    inet_pton4(curtok, tp) > 0) {
+			tp += NS_INADDRSZ;
+			saw_xdigit = 0;
+			break;	/* '\0' was seen by inet_pton4(). */
+		}
+		return (0);
+	}
+	if (saw_xdigit) {
+		if (tp + NS_INT16SZ > endp)
+			return (0);
+		*tp++ = (unsigned char) (val >> 8) & 0xff;
+		*tp++ = (unsigned char) val & 0xff;
+	}
+	if (colonp != NULL) {
+		/*
+		 * Since some memmove()'s erroneously fail to handle
+		 * overlapping regions, we'll do the shift by hand.
+		 */
+		const int n = tp - colonp;
+		int i;
+
+		for (i = 1; i <= n; i++) {
+			endp[- i] = colonp[n - i];
+			colonp[n - i] = 0;
+		}
+		tp = endp;
+	}
+	if (tp != endp)
+		return (0);
+	memcpy(dst, tmp, NS_IN6ADDRSZ);
+	return (1);
+}
+#endif

Added: branches/talloc/experimental/lib/replace/install-sh
===================================================================
--- branches/talloc/experimental/lib/replace/install-sh	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/install-sh	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,238 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='	
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0


Property changes on: branches/talloc/experimental/lib/replace/install-sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/talloc/experimental/lib/replace/libreplace.m4
===================================================================
--- branches/talloc/experimental/lib/replace/libreplace.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/libreplace.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,313 @@
+AC_DEFUN_ONCE(AC_LIBREPLACE_LOCATION_CHECKS,
+[
+echo "LIBREPLACE_LOCATION_CHECKS: START"
+
+dnl find the libreplace sources. This is meant to work both for 
+dnl libreplace standalone builds, and builds of packages using libreplace
+libreplacedir=""
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
+for d in $libreplacepaths; do
+	if test -f "$d/replace.c"; then
+		libreplacedir="$d"		
+		AC_SUBST(libreplacedir)
+		break;
+	fi
+done
+if test x"$libreplacedir" = "x"; then
+	AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
+fi
+LIBREPLACEOBJ="$libreplacedir/replace.o"
+AC_SUBST(LIBREPLACEOBJ)
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+echo "LIBREPLACE_LOCATION_CHECKS: END"
+]) dnl end AC_LIBREPLACE_LOCATION_CHECKS
+
+
+AC_DEFUN_ONCE(AC_LIBREPLACE_BROKEN_CHECKS,
+[
+echo "LIBREPLACE_BROKEN_CHECKS: START"
+
+dnl find the libreplace sources. This is meant to work both for 
+dnl libreplace standalone builds, and builds of packages using libreplace
+libreplacedir=""
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
+for d in $libreplacepaths; do
+	if test -f "$d/replace.c"; then
+		libreplacedir="$d"		
+		AC_SUBST(libreplacedir)
+		break;
+	fi
+done
+if test x"$libreplacedir" = "x"; then
+	AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
+fi
+
+LIBREPLACEOBJ="$libreplacedir/replace.o"
+AC_SUBST(LIBREPLACEOBJ)
+
+LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o"
+
+AC_TYPE_UID_T
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_TYPE_PID_T
+AC_STRUCT_ST_RDEV
+AC_CHECK_TYPE(ino_t,unsigned)
+AC_CHECK_TYPE(loff_t,off_t)
+AC_CHECK_TYPE(offset_t,loff_t)
+
+AC_FUNC_MEMCMP
+
+AC_CHECK_FUNCS([pipe strftime srandom random srand rand usleep setbuffer lstat getpgrp utime utimes])
+
+AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h)
+AC_CHECK_HEADERS(setjmp.h utime.h)
+
+LIBREPLACE_PROVIDE_HEADER([stdint.h])
+LIBREPLACE_PROVIDE_HEADER([stdbool.h])
+
+AC_CHECK_TYPE(bool, 
+[AC_DEFINE(HAVE_BOOL, 1, [Whether the bool type is available])],,
+[
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif]
+)
+
+AC_CHECK_TYPE(_Bool, 
+[AC_DEFINE(HAVE__Bool, 1, [Whether the _Bool type is available])],,
+[
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif]
+)
+
+AC_CACHE_CHECK([for working mmap],libreplace_cv_HAVE_MMAP,[
+AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"],
+           libreplace_cv_HAVE_MMAP=yes,libreplace_cv_HAVE_MMAP=no,libreplace_cv_HAVE_MMAP=cross)])
+if test x"$libreplace_cv_HAVE_MMAP" = x"yes"; then
+    AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
+fi
+
+
+AC_CHECK_HEADERS(sys/syslog.h syslog.h)
+AC_CHECK_HEADERS(sys/time.h time.h)
+AC_CHECK_HEADERS(stdarg.h vararg.h)
+AC_CHECK_HEADERS(sys/mount.h mntent.h)
+AC_CHECK_HEADERS(stropts.h)
+AC_CHECK_HEADERS(unix.h)
+
+AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r)
+AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
+AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
+AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf)
+AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath fdatasync)
+AC_CHECK_FUNCS(get_current_dir_name)
+AC_HAVE_DECL(setresuid, [#include <unistd.h>])
+AC_HAVE_DECL(setresgid, [#include <unistd.h>])
+AC_HAVE_DECL(errno, [#include <errno.h>])
+
+AC_CACHE_CHECK([for secure mkstemp],libreplace_cv_HAVE_SECURE_MKSTEMP,[
+AC_TRY_RUN([#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+main() { 
+  struct stat st;
+  char tpl[20]="/tmp/test.XXXXXX"; 
+  int fd = mkstemp(tpl); 
+  if (fd == -1) exit(1);
+  unlink(tpl);
+  if (fstat(fd, &st) != 0) exit(1);
+  if ((st.st_mode & 0777) != 0600) exit(1);
+  exit(0);
+}],
+libreplace_cv_HAVE_SECURE_MKSTEMP=yes,
+libreplace_cv_HAVE_SECURE_MKSTEMP=no,
+libreplace_cv_HAVE_SECURE_MKSTEMP=cross)])
+if test x"$libreplace_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
+    AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
+fi
+
+dnl Provided by snprintf.c:
+AC_CHECK_HEADERS(stdio.h strings.h)
+AC_CHECK_DECLS([snprintf, vsnprintf, asprintf, vasprintf])
+AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
+
+AC_CACHE_CHECK([for C99 vsnprintf],libreplace_cv_HAVE_C99_VSNPRINTF,[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+void foo(const char *format, ...) { 
+       va_list ap;
+       int len;
+       char buf[20];
+       long long l = 1234567890;
+       l *= 100;
+
+       va_start(ap, format);
+       len = vsnprintf(buf, 0, format, ap);
+       va_end(ap);
+       if (len != 5) exit(1);
+
+       va_start(ap, format);
+       len = vsnprintf(0, 0, format, ap);
+       va_end(ap);
+       if (len != 5) exit(2);
+
+       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(3);
+
+       if (snprintf(buf, 20, "%lld", l) != 12 || strcmp(buf, "123456789000") != 0) exit(4);
+       if (snprintf(buf, 20, "%zu", 123456789) != 9 || strcmp(buf, "123456789") != 0) exit(5);
+       if (snprintf(buf, 20, "%2\$d %1\$d", 3, 4) != 3 || strcmp(buf, "4 3") != 0) exit(6);
+       if (snprintf(buf, 20, "%s", 0) < 3) exit(7);
+
+       exit(0);
+}
+main() { foo("hello"); }
+],
+libreplace_cv_HAVE_C99_VSNPRINTF=yes,libreplace_cv_HAVE_C99_VSNPRINTF=no,libreplace_cv_HAVE_C99_VSNPRINTF=cross)])
+if test x"$libreplace_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
+    AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
+fi
+
+
+dnl VA_COPY
+AC_CACHE_CHECK([for va_copy],libreplace_cv_HAVE_VA_COPY,[
+AC_TRY_LINK([#include <stdarg.h>
+va_list ap1,ap2;], [va_copy(ap1,ap2);],
+libreplace_cv_HAVE_VA_COPY=yes,libreplace_cv_HAVE_VA_COPY=no)])
+if test x"$libreplace_cv_HAVE_VA_COPY" = x"yes"; then
+    AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
+fi
+
+if test x"$libreplace_cv_HAVE_VA_COPY" != x"yes"; then
+AC_CACHE_CHECK([for __va_copy],libreplace_cv_HAVE___VA_COPY,[
+AC_TRY_LINK([#include <stdarg.h>
+va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+libreplace_cv_HAVE___VA_COPY=yes,libreplace_cv_HAVE___VA_COPY=no)])
+if test x"$libreplace_cv_HAVE___VA_COPY" = x"yes"; then
+    AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
+fi
+fi
+
+dnl __FUNCTION__ macro
+AC_CACHE_CHECK([for __FUNCTION__ macro],libreplace_cv_HAVE_FUNCTION_MACRO,[
+AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
+libreplace_cv_HAVE_FUNCTION_MACRO=yes,libreplace_cv_HAVE_FUNCTION_MACRO=no)])
+if test x"$libreplace_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
+    AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
+else
+    dnl __func__ macro
+    AC_CACHE_CHECK([for __func__ macro],libreplace_cv_HAVE_func_MACRO,[
+    AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __func__);],
+    libreplace_cv_HAVE_func_MACRO=yes,libreplace_cv_HAVE_func_MACRO=no)])
+    if test x"$libreplace_cv_HAVE_func_MACRO" = x"yes"; then
+       AC_DEFINE(HAVE_func_MACRO,1,[Whether there is a __func__ macro])
+    fi
+fi
+
+AC_CHECK_HEADERS([sys/param.h limits.h])
+
+AC_CHECK_TYPE(comparison_fn_t, 
+[AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])])
+
+AC_HAVE_DECL(setenv, [#include <stdlib.h>])
+AC_CHECK_FUNCS(setenv unsetenv)
+AC_HAVE_DECL(environ, [#include <unistd.h>])
+
+AC_CHECK_FUNCS(strnlen)
+AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
+
+AC_CHECK_FUNCS(memmem)
+
+# this test disabled as we don't actually need __VA_ARGS__ yet
+AC_TRY_CPP([
+#define eprintf(...) fprintf(stderr, __VA_ARGS__)
+eprintf("bla", "bar");
+], AC_DEFINE(HAVE__VA_ARGS__MACRO, 1, [Whether the __VA_ARGS__ macro is available]))
+
+
+AC_CACHE_CHECK([for sig_atomic_t type],libreplace_cv_sig_atomic_t, [
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>],[sig_atomic_t i = 0],
+	libreplace_cv_sig_atomic_t=yes,libreplace_cv_sig_atomic_t=no)])
+if test x"$libreplace_cv_sig_atomic_t" = x"yes"; then
+   AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
+fi
+
+
+AC_CACHE_CHECK([for O_DIRECT flag to open(2)],libreplace_cv_HAVE_OPEN_O_DIRECT,[
+AC_TRY_COMPILE([
+#include <unistd.h>
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif],
+[int fd = open("/dev/null", O_DIRECT);],
+libreplace_cv_HAVE_OPEN_O_DIRECT=yes,libreplace_cv_HAVE_OPEN_O_DIRECT=no)])
+if test x"$libreplace_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
+    AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
+fi
+
+
+dnl Check if the C compiler understands volatile (it should, being ANSI).
+AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [
+	AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
+		libreplace_cv_volatile=yes,libreplace_cv_volatile=no)])
+if test x"$libreplace_cv_volatile" = x"yes"; then
+	AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
+fi
+
+m4_include(system/config.m4)
+
+m4_include(dlfcn.m4)
+m4_include(getpass.m4)
+m4_include(strptime.m4)
+m4_include(win32.m4)
+m4_include(timegm.m4)
+m4_include(repdir.m4)
+m4_include(crypt.m4)
+
+AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
+
+echo "LIBREPLACE_BROKEN_CHECKS: END"
+]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_START,
+[
+#LIBREPLACE_ALL_CHECKS: START"
+])
+AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_END,
+[
+#LIBREPLACE_ALL_CHECKS: END"
+])
+m4_define(AC_LIBREPLACE_ALL_CHECKS,
+[
+AC__LIBREPLACE_ALL_CHECKS_START
+AC_LIBREPLACE_LOCATION_CHECKS
+AC_LIBREPLACE_CC_CHECKS
+AC_LIBREPLACE_BROKEN_CHECKS
+AC__LIBREPLACE_ALL_CHECKS_END
+CFLAGS="$CFLAGS -I$libreplacedir"
+])
+
+m4_include(libreplace_cc.m4)
+m4_include(libreplace_ld.m4)
+m4_include(libreplace_network.m4)
+m4_include(libreplace_macros.m4)
+
+m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[m4_include(autoconf-2.60.m4)])

Added: branches/talloc/experimental/lib/replace/libreplace_cc.m4
===================================================================
--- branches/talloc/experimental/lib/replace/libreplace_cc.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/libreplace_cc.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,179 @@
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_START,
+[
+echo "LIBREPLACE_CC_CHECKS: START"
+])
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_END,
+[
+echo "LIBREPLACE_CC_CHECKS: END"
+])
+
+dnl
+dnl
+dnl AC_LIBREPLACE_CC_CHECKS
+dnl
+dnl Note: we need to use m4_define instead of AC_DEFUN because
+dnl       of the ordering of tests
+dnl       
+dnl 
+m4_define(AC_LIBREPLACE_CC_CHECKS,
+[
+AC__LIBREPLACE_ONLY_CC_CHECKS_START
+
+dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable it
+dnl which conflicts with C99 on HPUX
+ac_cv_prog_cc_Ae=no
+
+savedCFLAGS=$CFLAGS
+AC_PROG_CC
+CFLAGS=$savedCFLAGS
+
+dnl don't try for C99 if we are using gcc, as otherwise we 
+dnl lose immediate structure constants
+if test x"$GCC" != x"yes" ; then
+AC_PROG_CC_C99
+fi
+
+if test x"$GCC" = x"yes" ; then
+	AC_MSG_CHECKING([for version of gcc])
+	GCC_VERSION=`$CC -dumpversion`
+	AC_MSG_RESULT(${GCC_VERSION})
+fi
+AC_USE_SYSTEM_EXTENSIONS
+AC_C_BIGENDIAN
+AC_C_INLINE
+LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_WARN([c99 structure initializer are not supported])])
+
+AC_PROG_INSTALL
+
+AC_ISC_POSIX
+AC_N_DEFINE(_XOPEN_SOURCE_EXTENDED)
+
+AC_SYS_LARGEFILE
+
+dnl Add #include for broken IRIX header files
+case "$host_os" in
+	*irix6*) AC_ADD_INCLUDE(<standards.h>)
+		;;
+	*hpux*)
+		# mmap on HPUX is completely broken...
+		AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
+		if test "`uname -r`" = "B.11.00" -o "`uname -r`" = "B.11.11"; then
+			AC_MSG_WARN([Enabling HPUX 11.00/11.11 header bug workaround])
+			CFLAGS="$CFLAGS -Dpread=pread64 -Dpwrite=pwrite64"
+		fi
+		if test "`uname -r`" = "B.11.23"; then
+			AC_MSG_WARN([Enabling HPUX 11.23 machine/sys/getppdp.h bug workaround])
+			CFLAGS="$CFLAGS -D_MACHINE_SYS_GETPPDP_INCLUDED"
+		fi
+		;;
+	*aix*)
+		AC_DEFINE(BROKEN_STRNDUP, 1, [Whether strndup is broken])
+		AC_DEFINE(BROKEN_STRNLEN, 1, [Whether strnlen is broken])
+		if test "${GCC}" != "yes"; then
+			## for funky AIX compiler using strncpy()
+			CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
+		fi
+		;;
+	*osf*)
+		# this brings in socklen_t
+		AC_N_DEFINE(_XOPEN_SOURCE,600)
+		AC_N_DEFINE(_OSF_SOURCE)
+		;;
+	#
+	# VOS may need to have POSIX support and System V compatibility enabled.
+	#
+	*vos*)
+		case "$CFLAGS" in
+			*-D_POSIX_C_SOURCE*);;
+			*)
+				CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L"
+				AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
+				;;
+		esac
+		case "$CFLAGS" in
+			*-D_SYSV*|*-D_SVID_SOURCE*);;
+			*)
+				CFLAGS="$CFLAGS -D_SYSV"
+				AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
+				;;
+		esac
+		;;
+esac
+
+
+
+AC_CHECK_HEADERS([standards.h])
+
+# Solaris needs HAVE_LONG_LONG defined
+AC_CHECK_TYPES(long long)
+
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+AC_CHECK_TYPE(int8_t, char)
+AC_CHECK_TYPE(uint8_t, unsigned char)
+AC_CHECK_TYPE(int16_t, short)
+AC_CHECK_TYPE(uint16_t, unsigned short)
+
+if test $ac_cv_sizeof_int -eq 4 ; then
+AC_CHECK_TYPE(int32_t, int)
+AC_CHECK_TYPE(uint32_t, unsigned int)
+elif test $ac_cv_size_long -eq 4 ; then
+AC_CHECK_TYPE(int32_t, long)
+AC_CHECK_TYPE(uint32_t, unsigned long)
+else
+AC_MSG_ERROR([LIBREPLACE no 32-bit type found])
+fi
+
+AC_CHECK_TYPE(int64_t, long long)
+AC_CHECK_TYPE(uint64_t, unsigned long long)
+
+AC_CHECK_TYPE(size_t, unsigned int)
+AC_CHECK_TYPE(ssize_t, int)
+
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ssize_t)
+
+AC_CHECK_TYPES([intptr_t, uintptr_t, ptrdiff_t])
+
+if test x"$ac_cv_type_long_long" != x"yes";then
+	AC_MSG_ERROR([LIBREPLACE needs type 'long long'])
+fi
+if test $ac_cv_sizeof_long_long -lt 8;then
+	AC_MSG_ERROR([LIBREPLACE needs sizeof(long long) >= 8])
+fi
+
+############################################
+# check if the compiler can do immediate structures
+AC_SUBST(libreplace_cv_immediate_structures)
+AC_CACHE_CHECK([for immediate structures],libreplace_cv_immediate_structures,[
+	AC_TRY_COMPILE([
+		#include <stdio.h>
+	],[
+		typedef struct {unsigned x;} FOOBAR;
+		#define X_FOOBAR(x) ((FOOBAR) { x })
+		#define FOO_ONE X_FOOBAR(1)
+		FOOBAR f = FOO_ONE;   
+		static const struct {
+			FOOBAR y; 
+		} f2[] = {
+			{FOO_ONE}
+		};
+		static const FOOBAR f3[] = {FOO_ONE};
+	],
+	libreplace_cv_immediate_structures=yes,
+	libreplace_cv_immediate_structures=no,
+	libreplace_cv_immediate_structures=cross)
+])
+if test x"$libreplace_cv_immediate_structures" = x"yes"; then
+	AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
+fi
+
+AC__LIBREPLACE_ONLY_CC_CHECKS_END
+]) dnl end AC_LIBREPLACE_CC_CHECKS

Added: branches/talloc/experimental/lib/replace/libreplace_ld.m4
===================================================================
--- branches/talloc/experimental/lib/replace/libreplace_ld.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/libreplace_ld.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,337 @@
+#
+# This offers a nice overview how to build shared libraries on all platforms
+#        http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html
+#
+
+AC_DEFUN([AC_LIBREPLACE_STLD],
+[
+	AC_PATH_PROG(PROG_AR, ar)
+
+	STLD=${PROG_AR}
+
+	AC_SUBST(STLD)
+])
+
+AC_DEFUN([AC_LIBREPLACE_STLD_FLAGS],
+[
+	STLD_FLAGS="-rcs"
+	AC_SUBST(STLD_FLAGS)
+])
+
+AC_DEFUN([AC_LD_EXPORT_DYNAMIC],
+[
+saved_LDFLAGS="$LDFLAGS"
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -Wl,--version 2>&1 | grep "GNU ld" >/dev/null]); then
+	LD_EXPORT_DYNAMIC="-Wl,-export-dynamic"
+else
+	case "$host_os" in
+		hpux* )
+		  LD_EXPORT_DYNAMIC="-Wl,-E"
+		  ;;
+		*)
+		  LD_EXPORT_DYNAMIC=""
+		  ;;
+	  esac
+fi
+AC_SUBST(LD_EXPORT_DYNAMIC)
+LDFLAGS="$saved_LDFLAGS"
+])
+
+AC_DEFUN([AC_LD_PICFLAG],
+[
+case "$host_os" in
+	*linux*|*gnu*)
+		PICFLAG="-fPIC" 
+		;;
+	*solaris*)
+		if test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		else
+			PICFLAG="-KPIC"
+		fi
+		;;
+	*sunos*)
+		PICFLAG="-KPIC"   # Is this correct for SunOS
+		;;
+	*netbsd* | *freebsd* | *dragonfly* )  
+		PICFLAG="-fPIC -DPIC"
+		;;
+	*openbsd*)
+		PICFLAG="-fPIC"
+		;;
+	*irix*)
+		if test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		else 
+			PICFLAG="-KPIC"
+		fi
+		;;
+	*aix*)
+		# as AIX code is always position independent...
+		PICFLAG="-O2"
+		;;
+	*hpux*)
+		if test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		elif test "$host_cpu" = "ia64"; then
+		        PICFLAG="+z"
+		elif test $ac_cv_prog_cc_Ae = yes; then
+			PICFLAG="+z +ESnolit"
+		fi
+		;;
+	*osf*)
+		PICFLAG="-fPIC"
+		;;
+	*unixware*)
+		PICFLAG="-KPIC"
+		;;
+	*darwin*)
+		PICFLAG="-fno-common"
+		;;
+esac
+AC_SUBST(PICFLAG)
+])
+
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_LINKER],
+[
+	LD_SHLIB_LINKER="${CC}"
+
+	case "$host_os" in
+		*irix*)
+			LD_SHLIB_LINKER="${PROG_LD}"
+			;;
+	esac
+
+	AC_SUBST(LD_SHLIB_LINKER)
+])
+
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_FLAGS],
+[
+	LD_SHLIB_FLAGS="-shared"
+
+	case "$host_os" in
+		*linux*|*gnu*)
+			LD_SHLIB_FLAGS="-shared -Wl,-Bsymbolic"
+			;;
+		*solaris*)
+			LD_SHLIB_FLAGS="-G"
+			if test "${GCC}" = "no"; then
+				## ${CFLAGS} added for building 64-bit shared 
+				## libs using Sun's Compiler
+				LD_SHLIB_FLAGS="-G \${CFLAGS}"
+			fi
+			;;
+		*sunos*)
+			LD_SHLIB_FLAGS="-G"
+			;;
+		*irix*)
+			LD_SHLIB_FLAGS="-shared"
+			;;
+		*aix*)
+			LD_SHLIB_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
+			;;
+		*hpux*)
+			if test "${GCC}" = "yes"; then
+				LD_SHLIB_FLAGS="-shared"
+			else
+				LD_SHLIB_FLAGS="-b"
+			fi
+			;;
+		*osf*)
+			LD_SHLIB_FLAGS="-shared"
+			;;
+		*darwin*)
+			LD_SHLIB_FLAGS="-dynamiclib -Wl,-search_paths_first"
+			;;
+	esac
+
+	AC_SUBST(LD_SHLIB_FLAGS)
+])
+
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG],
+[
+	LD_SHLIB_DISALLOW_UNDEF_FLAG=""
+
+	#
+	# TODO: enforce error not only warnings
+	#
+	# NOTE: -Wl,--no-allow-shlib-undefined isn't what we want...
+	#       as it bails out on broken system libraries
+	#
+	case "$host_os" in
+		*osf*)
+			LD_SHLIB_DISALLOW_UNDEF_FLAG="-warning_unresolved"
+			;;
+		*darwin*)
+			LD_SHLIB_DISALLOW_UNDEF_FLAG="-undefined error"
+			;;
+	esac
+
+	AC_SUBST(LD_SHLIB_DISALLOW_UNDEF_FLAG)
+])
+
+AC_DEFUN([AC_LIBREPLACE_SHLD],
+[
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
+	SHLD="$LD_SHLIB_LINKER"
+	AC_SUBST(SHLD)
+])
+
+AC_DEFUN([AC_LIBREPLACE_SHLD_FLAGS],
+[
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG])
+	SHLD_FLAGS="$LD_SHLIB_FLAGS $LD_SHLIB_DISALLOW_UNDEF_FLAG"
+	AC_SUBST(SHLD_FLAGS)
+])
+
+AC_DEFUN([AC_LD_SHLIBEXT],
+[
+	SHLIBEXT="so"
+	case "$host_os" in
+		*hpux*)
+			if test "$host_cpu" = "ia64"; then
+				SHLIBEXT="so"
+			else
+				SHLIBEXT="sl"
+			fi
+		;;
+		*darwin*)
+			SHLIBEXT="dylib"
+		;;
+	esac
+	AC_SUBST(SHLIBEXT)
+])
+
+AC_DEFUN([AC_LD_SONAMEFLAG],
+[
+	AC_SUBST(SONAMEFLAG)
+	SONAMEFLAG=""
+	case "$host_os" in 
+		*linux*|*gnu*|*qnx*)
+			SONAMEFLAG="-Wl,-soname="
+			;;
+		*solaris*)
+			SONAMEFLAG="-h "
+			if test "${GCC}" = "yes"; then
+				SONAMEFLAG="-Wl,-soname="
+			fi
+			;;
+		*sunos*)
+			SONAMEFLAG="-Wl,-h,"
+			;;
+		*netbsd* | *freebsd* | *dragonfly* )
+			SONAMEFLAG="-Wl,-soname,"
+			;;
+		*openbsd*)
+			SONAMEFLAG="-Wl,-soname,"
+			;;
+		*irix*)
+			SONAMEFLAG="-Wl,-soname,"
+			;;
+		*hpux*)
+			SONAMEFLAG="-Wl,+h,"
+			;;
+		*osf*)
+			SONAMEFLAG="-Wl,-soname,"
+			;;
+		*unixware*)
+			SONAMEFLAG="-Wl,-soname,"
+			;;
+		*darwin*)
+			SONAMEFLAG="#"
+			;;
+		*aix*)
+			# Not supported
+			SONAMEFLAG="#"
+			;;
+		esac
+])
+
+AC_DEFUN([AC_LD_VERSIONSCRIPT],
+[
+	AC_SUBST(VERSIONSCRIPT)
+	VERSIONSCRIPT=""
+	case "$host_os" in 
+		*linux*|*gnu*)
+			VERSIONSCRIPT="-Wl,--version-script"
+			;;
+		*solaris*)
+			if test "${GCC}" = "yes"; then
+				VERSIONSCRIPT="-Wl,--version-script"
+			fi
+			;;
+		esac
+])
+
+AC_DEFUN([AC_LIBREPLACE_MDLD],
+[
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
+	MDLD="$LD_SHLIB_LINKER"
+	AC_SUBST(MDLD)
+])
+
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_ALLOW_UNDEF_FLAG],
+[
+	LD_ALLOW_SHLIB_UNDEF_FLAG=""
+
+	case "$host_os" in
+		*linux*|*gnu*)
+			LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,--allow-shlib-undefined"
+			;;
+		*osf*)
+			LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,-expect_unresolved,\"*\""
+			;;
+		*darwin*)
+			LD_SHLIB_ALLOW_UNDEF_FLAG="-undefined dynamic_lookup"
+			;;
+		*aix*)
+			LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,-bnoentry"
+			;;
+	esac
+
+	AC_SUBST(LD_SHLIB_ALLOW_UNDEF_FLAG)
+])
+
+AC_DEFUN([AC_LIBREPLACE_MDLD_FLAGS],
+[
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
+	AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_ALLOW_UNDEF_FLAG])
+	MDLD_FLAGS="$LD_SHLIB_FLAGS $LD_SHLIB_ALLOW_UNDEF_FLAG"
+	AC_SUBST(MDLD_FLAGS)
+])
+
+AC_DEFUN([AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR],
+[
+	case "$host_os" in
+		*linux*|*gnu*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+		;;
+		*bsd*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+		;;
+		*solaris*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+		;;
+		*hpux*)
+			LIB_PATH_VAR=SHLIB_PATH
+		;;
+		*osf*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+		;;
+		*aix*)
+			LIB_PATH_VAR=LIBPATH
+			;;
+		*irix*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+			;;
+		*darwin*)
+			LIB_PATH_VAR=DYLD_LIBRARY_PATH
+			;;
+		*)
+			LIB_PATH_VAR=LD_LIBRARY_PATH
+			;;
+	esac
+
+	AC_SUBST(LIB_PATH_VAR)
+])

Added: branches/talloc/experimental/lib/replace/libreplace_macros.m4
===================================================================
--- branches/talloc/experimental/lib/replace/libreplace_macros.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/libreplace_macros.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,332 @@
+#
+# This is a collection of useful autoconf macros
+#
+
+############################################
+# Check if the compiler handles c99 struct initialization, and if not try -AC99 and -c99 flags
+# Usage: LIBREPLACE_C99_STRUCT_INIT(success-action,failure-action)
+# changes CFLAGS to add -AC99 or -c99 if needed
+AC_DEFUN([LIBREPLACE_C99_STRUCT_INIT],
+[
+saved_CFLAGS="$CFLAGS";
+c99_init=no
+if test x"$c99_init" = x"no"; then
+    AC_MSG_CHECKING(for C99 designated initializers)
+    CFLAGS="$saved_CFLAGS";
+    AC_TRY_COMPILE([#include <stdio.h>],
+     [ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };	 
+     ],
+     [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
+fi
+if test x"$c99_init" = x"no"; then
+    AC_MSG_CHECKING(for C99 designated initializers with -AC99)
+    CFLAGS="$saved_CFLAGS -AC99";
+    AC_TRY_COMPILE([#include <stdio.h>],
+     [ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };	 
+     ],
+     [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
+fi
+if test x"$c99_init" = x"no"; then
+    AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=extc99)
+    CFLAGS="$saved_CFLAGS -qlanglvl=extc99";
+    AC_TRY_COMPILE([#include <stdio.h>],
+     [ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };	 
+     ],
+     [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
+fi
+if test x"$c99_init" = x"no"; then
+    AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=stdc99)
+    CFLAGS="$saved_CFLAGS -qlanglvl=stdc99";
+    AC_TRY_COMPILE([#include <stdio.h>],
+     [ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };	 
+     ],
+     [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
+fi
+if test x"$c99_init" = x"no"; then
+    AC_MSG_CHECKING(for C99 designated initializers with -c99)
+    CFLAGS="$saved_CFLAGS -c99"
+    AC_TRY_COMPILE([#include <stdio.h>],
+     [ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };	 
+     ],
+     [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
+fi
+
+if test "`uname`" = "HP-UX"; then
+  if test "$ac_cv_c_compiler_gnu" = no; then
+	# special override for broken HP-UX compiler - I can't find a way to test
+	# this properly (its a compiler bug)
+	CFLAGS="$CFLAGS -AC99";
+	c99_init=yes;
+  fi
+fi
+
+if test x"$c99_init" = x"yes"; then
+    saved_CFLAGS=""
+    $1
+else
+    CFLAGS="$saved_CFLAGS"
+    saved_CFLAGS=""
+    $2
+fi
+])
+
+dnl AC_PROG_CC_FLAG(flag)
+AC_DEFUN(AC_PROG_CC_FLAG,
+[AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
+[echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_$1=yes
+else
+  ac_cv_prog_cc_$1=no
+fi
+rm -f conftest*
+])])
+
+dnl see if a declaration exists for a function or variable
+dnl defines HAVE_function_DECL if it exists
+dnl AC_HAVE_DECL(var, includes)
+AC_DEFUN(AC_HAVE_DECL,
+[
+ AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
+    AC_TRY_COMPILE([$2],[int i = (int)$1],
+        ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
+ if test x"$ac_cv_have_$1_decl" = x"yes"; then
+    AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
+ fi
+])
+
+
+# AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
+#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+#              [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
+# ------------------------------------------------------
+#
+# Use a cache variable name containing both the library and function name,
+# because the test really is for library $1 defining function $3, not
+# just for library $1.  Separate tests with the same $1 and different $3s
+# may have different results.
+#
+# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
+# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
+# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
+# the AS_LITERAL_IF indirection.
+#
+# FIXME: This macro is extremely suspicious.  It DEFINEs unconditionally,
+# whatever the FUNCTION, in addition to not being a *S macro.  Note
+# that the cache does depend upon the function we are looking for.
+#
+# It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
+# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
+# changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
+# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
+# freedom.
+AC_DEFUN([AC_CHECK_LIB_EXT],
+[
+AH_CHECK_LIB_EXT([$1])
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-l$1 $$2 $7 $LIBS"
+AS_LITERAL_IF([$1],
+      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
+      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
+
+m4_ifval([$3],
+ [
+    AH_CHECK_FUNC_EXT([$3])
+    AS_LITERAL_IF([$1],
+              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
+              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
+    AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
+	[AC_TRY_LINK_FUNC($3,
+                 [AS_VAR_SET(ac_Lib_func, yes);
+		  AS_VAR_SET(ac_Lib_ext, yes)],
+                 [AS_VAR_SET(ac_Lib_func, no);
+		  AS_VAR_SET(ac_Lib_ext, no)])
+	])
+    AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
+        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
+    AS_VAR_POPDEF([ac_Lib_func])dnl
+ ],[
+    AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
+	[AC_TRY_LINK_FUNC([main],
+                 [AS_VAR_SET(ac_Lib_ext, yes)],
+                 [AS_VAR_SET(ac_Lib_ext, no)])
+	])
+ ])
+LIBS=$ac_check_lib_ext_save_LIBS
+
+AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
+    [m4_default([$4], 
+        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
+		case "$$2" in
+		    *-l$1*)
+			;;
+		    *)
+			$2="-l$1 $$2"
+			;;
+		esac])
+		[$6]
+	    ],
+	    [$5])dnl
+AS_VAR_POPDEF([ac_Lib_ext])dnl
+])# AC_CHECK_LIB_EXT
+
+# AH_CHECK_LIB_EXT(LIBNAME)
+# ---------------------
+m4_define([AH_CHECK_LIB_EXT],
+[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
+             [Define to 1 if you have the `]$1[' library (-l]$1[).])])
+
+dnl AC_SEARCH_LIBS_EXT(FUNCTION, SEARCH-LIBS, EXT_LIBS,
+dnl                    [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl                    [OTHER-LIBRARIES])
+dnl --------------------------------------------------------
+dnl Search for a library defining FUNC, if it's not already available.
+AC_DEFUN([AC_SEARCH_LIBS_EXT],
+[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_ext_$1],
+[
+ac_func_search_ext_save_LIBS=$LIBS
+ac_cv_search_ext_$1=no
+AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
+	       [ac_cv_search_ext_$1="none required"])
+if test "$ac_cv_search_ext_$1" = no; then
+  for ac_lib in $2; do
+    LIBS="-l$ac_lib $$3 $6 $ac_func_search_save_ext_LIBS"
+    AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
+		   [ac_cv_search_ext_$1="-l$ac_lib"
+break])
+  done
+fi
+LIBS=$ac_func_search_ext_save_LIBS])
+AS_IF([test "$ac_cv_search_ext_$1" != no],
+  [test "$ac_cv_search_ext_$1" = "none required" || $3="$ac_cv_search_ext_$1 $$3"
+  $4],
+      [$5])dnl
+])
+
+dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
+dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
+AC_DEFUN([AC_CHECK_FUNC_EXT],
+[
+    AH_CHECK_FUNC_EXT($1)	
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$2 $LIBS"
+    AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
+    AC_CACHE_CHECK([for $1], ac_var,
+	[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
+                [AS_VAR_SET(ac_var, yes)],
+                [AS_VAR_SET(ac_var, no)])])
+    LIBS=$ac_check_func_ext_save_LIBS
+    AS_IF([test AS_VAR_GET(ac_var) = yes], 
+	    [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3], 
+	    [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
+
+# AH_CHECK_FUNC_EXT(FUNCNAME)
+# ---------------------
+m4_define([AH_CHECK_FUNC_EXT],
+[AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
+             [Define to 1 if you have the `]$1[' function.])])
+
+dnl Define an AC_DEFINE with ifndef guard.
+dnl AC_N_DEFINE(VARIABLE [, VALUE])
+AC_DEFUN([AC_N_DEFINE],
+[
+AH_VERBATIM([$1], [
+#ifndef $1
+# undef $1
+#endif
+])
+
+ cat >>confdefs.h <<\EOF
+#ifndef $1
+[#define] $1 m4_if($#, 1, 1, [$2])
+#endif
+EOF
+])
+
+dnl Add an #include
+dnl AC_ADD_INCLUDE(VARIABLE)
+define(AC_ADD_INCLUDE,
+[cat >> confdefs.h <<\EOF
+[#include] $1
+EOF
+])
+
+dnl remove an #include
+dnl AC_REMOVE_INCLUDE(VARIABLE)
+define(AC_REMOVE_INCLUDE,
+[
+grep -v '[#include] $1' confdefs.h >confdefs.h.tmp
+cat confdefs.h.tmp > confdefs.h
+rm confdefs.h.tmp
+])
+
+dnl remove an #define
+dnl AC_REMOVE_DEFINE(VARIABLE)
+define(AC_REMOVE_DEFINE,
+[
+grep -v '[#define] $1 ' confdefs.h |grep -v '[#define] $1[$]'>confdefs.h.tmp
+cat confdefs.h.tmp > confdefs.h
+rm confdefs.h.tmp
+])
+
+dnl AS_HELP_STRING is not available in autoconf 2.57, and AC_HELP_STRING is deprecated
+dnl in autoconf 2.59, so define AS_HELP_STRING to be AC_HELP_STRING unless it is already
+dnl defined.
+m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
+
+dnl check if the prototype in the header matches the given one
+dnl AC_VERIFY_C_PROTOTYPE(prototype,functionbody,[IF-TRUE].[IF-FALSE],[extraheaders])
+AC_DEFUN(AC_VERIFY_C_PROTOTYPE,
+[AC_CACHE_CHECK([for prototype $1], AS_TR_SH([ac_cv_c_prototype_$1]),
+	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+		AC_INCLUDES_DEFAULT
+		$5
+		$1
+		{
+			$2
+		}
+	])],[
+		AS_TR_SH([ac_cv_c_prototype_$1])=yes
+	],[
+		AS_TR_SH([ac_cv_c_prototype_$1])=no
+	])
+)
+AS_IF([test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])
+])
+
+AC_DEFUN(LIBREPLACE_PROVIDE_HEADER, 
+[AC_CHECK_HEADER([$1], 
+		[ AC_CONFIG_COMMANDS(rm-$1, [rm -f $libreplacedir/$1], [libreplacedir=$libreplacedir]) ],
+		[ AC_CONFIG_COMMANDS(mk-$1, [echo "#include \"replace.h\"" > $libreplacedir/$1], [libreplacedir=$libreplacedir]) ]
+	)
+])
+
+dnl AC_HAVE_TYPE(TYPE,INCLUDES)
+AC_DEFUN([AC_HAVE_TYPE], [
+AC_REQUIRE([AC_HEADER_STDC])
+cv=`echo "$1" | sed 'y%./+- %__p__%'`
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL([ac_cv_type_$cv],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+AC_INCLUDES_DEFAULT
+$2]],
+[[$1 foo;]])],
+[eval "ac_cv_type_$cv=yes"],
+[eval "ac_cv_type_$cv=no"]))dnl
+ac_foo=`eval echo \\$ac_cv_type_$cv`
+AC_MSG_RESULT($ac_foo)
+if test "$ac_foo" = yes; then
+  ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
+if false; then
+	AC_CHECK_TYPES($1)
+fi
+  AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
+fi
+])

Added: branches/talloc/experimental/lib/replace/libreplace_network.m4
===================================================================
--- branches/talloc/experimental/lib/replace/libreplace_network.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/libreplace_network.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,466 @@
+AC_DEFUN_ONCE(AC_LIBREPLACE_NETWORK_CHECKS,
+[
+echo "LIBREPLACE_NETWORK_CHECKS: START"
+
+AC_DEFINE(LIBREPLACE_NETWORK_CHECKS, 1, [LIBREPLACE_NETWORK_CHECKS were used])
+LIBREPLACE_NETWORK_OBJS=""
+LIBREPLACE_NETWORK_LIBS=""
+
+AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
+AC_CHECK_HEADERS(netinet/in_systm.h)
+AC_CHECK_HEADERS([netinet/ip.h], [], [],[
+	#include <sys/types.h>
+	#ifdef HAVE_NETINET_IN_H
+	#include <netinet/in.h>
+	#endif
+	#ifdef HAVE_NETINET_IN_SYSTM_H
+	#include <netinet/in_systm.h>
+	#endif
+])
+AC_CHECK_HEADERS(netinet/tcp.h netinet/in_ip.h)
+AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
+AC_CHECK_HEADERS(sys/uio.h)
+
+dnl we need to check that net/if.h really can be used, to cope with hpux
+dnl where including it always fails
+AC_CACHE_CHECK([for usable net/if.h],libreplace_cv_USABLE_NET_IF_H,[
+	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+		AC_INCLUDES_DEFAULT
+		#if HAVE_SYS_SOCKET_H
+		# include <sys/socket.h>
+		#endif
+		#include <net/if.h>
+		int main(void) {return 0;}])],
+		[libreplace_cv_USABLE_NET_IF_H=yes],
+		[libreplace_cv_USABLE_NET_IF_H=no]
+	)
+])
+if test x"$libreplace_cv_USABLE_NET_IF_H" = x"yes";then
+	AC_DEFINE(HAVE_NET_IF_H, 1, usability of net/if.h)
+fi
+
+AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
+AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
+AC_HAVE_TYPE([struct sockaddr_storage], [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+])
+AC_HAVE_TYPE([struct sockaddr_in6], [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+])
+
+if test x"$ac_cv_type_struct_sockaddr_storage" = x"yes"; then
+AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,
+                AC_DEFINE(HAVE_SS_FAMILY, 1, [Defined if struct sockaddr_storage has ss_family field]),,
+                [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+		])
+
+if test x"$ac_cv_member_struct_sockaddr_storage_ss_family" != x"yes"; then
+AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
+                AC_DEFINE(HAVE___SS_FAMILY, 1, [Defined if struct sockaddr_storage has __ss_family field]),,
+                [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+		])
+fi
+fi
+
+AC_CACHE_CHECK([for sin_len in sock],libreplace_cv_HAVE_SOCK_SIN_LEN,[
+	AC_TRY_COMPILE(
+		[
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+		],[
+struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+		],[
+		libreplace_cv_HAVE_SOCK_SIN_LEN=yes
+		],[
+		libreplace_cv_HAVE_SOCK_SIN_LEN=no
+		])
+])
+if test x"$libreplace_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
+	AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
+fi
+
+############################################
+# check for unix domain sockets
+AC_CACHE_CHECK([for unix domain sockets],libreplace_cv_HAVE_UNIXSOCKET,[
+	AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+		],[
+struct sockaddr_un sunaddr;
+sunaddr.sun_family = AF_UNIX;
+		],[
+		libreplace_cv_HAVE_UNIXSOCKET=yes
+		],[
+		libreplace_cv_HAVE_UNIXSOCKET=no
+		])
+])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+	AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
+fi
+
+dnl The following test is roughl taken from the cvs sources.
+dnl
+dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
+dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+dnl libsocket.so which has a bad implementation of gethostbyname (it
+dnl only looks in /etc/hosts), so we only look for -lsocket if we need
+dnl it.
+AC_CHECK_FUNCS(connect)
+if test x"$ac_cv_func_connect" = x"no"; then
+	AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(inet, LIBREPLACE_NETWORK_LIBS, connect)
+	dnl We can't just call AC_CHECK_FUNCS(connect) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_nsl_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_socket_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_inet_connect" = x"yes"
+	then
+		AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
+	fi
+fi
+
+AC_CHECK_FUNCS(gethostbyname)
+if test x"$ac_cv_func_gethostbyname" = x"no"; then
+	AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" = x"yes" ||
+		test x"$ac_cv_lib_ext_nsl_gethostbyname" = x"yes" ||
+		test x"$ac_cv_lib_ext_socket_gethostbyname" = x"yes"
+	then
+		AC_DEFINE(HAVE_GETHOSTBYNAME,1,
+			  [Whether the system has gethostbyname()])
+	fi
+fi
+
+dnl HP-UX has if_nametoindex in -lipv6
+AC_CHECK_FUNCS(if_nametoindex)
+if test x"$ac_cv_func_if_nametoindex" = x"no"; then
+	AC_CHECK_LIB_EXT(ipv6, LIBREPLACE_NETWORK_LIBS, if_nametoindex)
+	dnl We can't just call AC_CHECK_FUNCS(if_nametoindex) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_ipv6_if_nametoindex" = x"yes"
+	then
+		AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
+			  [Whether the system has if_nametoindex()])
+	fi
+fi
+
+# The following tests need LIBS="${LIBREPLACE_NETWORK_LIBS}"
+old_LIBS=$LIBS
+LIBS="${LIBREPLACE_NETWORK_LIBS}"
+libreplace_SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$libreplacedir"
+
+AC_CHECK_FUNCS(socketpair,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/socketpair.o"])
+
+AC_CACHE_CHECK([for broken inet_ntoa],libreplace_cv_REPLACE_INET_NTOA,[
+AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+main() { struct in_addr ip; ip.s_addr = 0x12345678;
+if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
+    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
+exit(1);}],
+           libreplace_cv_REPLACE_INET_NTOA=yes,libreplace_cv_REPLACE_INET_NTOA=no,libreplace_cv_REPLACE_INET_NTOA=cross)])
+
+AC_CHECK_FUNCS(inet_ntoa,[],[libreplace_cv_REPLACE_INET_NTOA=yes])
+if test x"$libreplace_cv_REPLACE_INET_NTOA" = x"yes"; then
+    AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
+    LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_ntoa.o"
+fi
+
+AC_CHECK_FUNCS(inet_aton,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_aton.o"])
+
+AC_CHECK_FUNCS(inet_ntop,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_ntop.o"])
+
+AC_CHECK_FUNCS(inet_pton,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_pton.o"])
+
+dnl test for getaddrinfo/getnameinfo
+AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
+AC_TRY_LINK([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.h>
+#include <netdb.h>],
+[
+struct sockaddr sa;
+struct addrinfo *ai = NULL;
+int ret = getaddrinfo(NULL, NULL, NULL, &ai);
+if (ret != 0) {
+	const char *es = gai_strerror(ret);
+}
+freeaddrinfo(ai);
+ret = getnameinfo(&sa, sizeof(sa),
+		NULL, 0,
+		NULL, 0, 0);
+
+],
+libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
+
+if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
+	# getaddrinfo is broken on some AIX systems
+	# see bug 5910, use our replacements if we detect
+	# a broken system.
+	AC_TRY_RUN([
+		#include <stddef.h>
+		#include <sys/types.h>
+		#include <sys/socket.h>
+		#include <netdb.h>
+		int main(int argc, const char *argv[])
+		{
+			struct addrinfo hints = {0,};
+			struct addrinfo *ppres;
+			const char hostname[] = "0.0.0.0";
+			hints.ai_socktype = SOCK_STREAM;
+			hints.ai_family = AF_INET;
+			hints.ai_flags =
+				AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG;
+			return getaddrinfo(hostname, NULL, &hints, &ppres) != 0 ? 1 : 0;
+		}],
+		libreplace_cv_HAVE_GETADDRINFO=yes,
+		libreplace_cv_HAVE_GETADDRINFO=no)
+fi
+
+if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
+	AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
+	AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo])
+	AC_DEFINE(HAVE_FREEADDRINFO,1,[Whether the system has freeaddrinfo])
+	AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
+else
+	LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/getaddrinfo.o"
+fi
+
+AC_CHECK_HEADERS([ifaddrs.h])
+
+dnl Used when getifaddrs is not available
+AC_CHECK_MEMBERS([struct sockaddr.sa_len], 
+	 [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has a sa_len member])],
+	 [],
+	 [#include <sys/socket.h>])
+
+dnl test for getifaddrs and freeifaddrs
+AC_CACHE_CHECK([for getifaddrs and freeifaddrs],libreplace_cv_HAVE_GETIFADDRS,[
+AC_TRY_LINK([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ifaddrs.h>
+#include <netdb.h>],
+[
+struct ifaddrs *ifp = NULL;
+int ret = getifaddrs (&ifp);
+freeifaddrs(ifp);
+],
+libreplace_cv_HAVE_GETIFADDRS=yes,libreplace_cv_HAVE_GETIFADDRS=no)])
+if test x"$libreplace_cv_HAVE_GETIFADDRS" = x"yes"; then
+    AC_DEFINE(HAVE_GETIFADDRS,1,[Whether the system has getifaddrs])
+    AC_DEFINE(HAVE_FREEIFADDRS,1,[Whether the system has freeifaddrs])
+	AC_DEFINE(HAVE_STRUCT_IFADDRS,1,[Whether struct ifaddrs is available])
+fi
+
+##################
+# look for a method of finding the list of network interfaces
+iface=no;
+AC_CACHE_CHECK([for iface getifaddrs],libreplace_cv_HAVE_IFACE_GETIFADDRS,[
+AC_TRY_RUN([
+#define HAVE_IFACE_GETIFADDRS 1
+#define NO_CONFIG_H 1
+#define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
+#include "$libreplacedir/inet_ntop.c"
+#include "$libreplacedir/snprintf.c"
+#include "$libreplacedir/getifaddrs.c"
+#define getifaddrs_test main
+#include "$libreplacedir/test/getifaddrs.c"],
+           libreplace_cv_HAVE_IFACE_GETIFADDRS=yes,libreplace_cv_HAVE_IFACE_GETIFADDRS=no,libreplace_cv_HAVE_IFACE_GETIFADDRS=cross)])
+if test x"$libreplace_cv_HAVE_IFACE_GETIFADDRS" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_GETIFADDRS,1,[Whether iface getifaddrs is available])
+else
+	LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/getifaddrs.o"
+fi
+
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[
+AC_TRY_RUN([
+#define HAVE_IFACE_AIX 1
+#define NO_CONFIG_H 1
+#define AUTOCONF_TEST 1
+#undef _XOPEN_SOURCE_EXTENDED
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
+#include "$libreplacedir/inet_ntop.c"
+#include "$libreplacedir/snprintf.c"
+#include "$libreplacedir/getifaddrs.c"
+#define getifaddrs_test main
+#include "$libreplacedir/test/getifaddrs.c"],
+           libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)])
+if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
+fi
+fi
+
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFCONF 1
+#define NO_CONFIG_H 1
+#define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
+#include "$libreplacedir/inet_ntop.c"
+#include "$libreplacedir/snprintf.c"
+#include "$libreplacedir/getifaddrs.c"
+#define getifaddrs_test main
+#include "$libreplacedir/test/getifaddrs.c"],
+           libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)])
+if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
+fi
+fi
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFREQ 1
+#define NO_CONFIG_H 1
+#define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
+#include "$libreplacedir/inet_ntop.c"
+#include "$libreplacedir/snprintf.c"
+#include "$libreplacedir/getifaddrs.c"
+#define getifaddrs_test main
+#include "$libreplacedir/test/getifaddrs.c"],
+           libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)])
+if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
+fi
+fi
+
+dnl Some old Linux systems have broken header files and
+dnl miss the IPV6_V6ONLY define in netinet/in.h,
+dnl but have it in linux/in6.h.
+dnl We can't include both files so we just check if the value
+dnl if defined and do the replacement in system/network.h
+AC_CACHE_CHECK([for IPV6_V6ONLY support],libreplace_cv_HAVE_IPV6_V6ONLY,[
+	AC_TRY_COMPILE([
+#include <stdlib.h> /* for NULL */
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>
+#include <netinet/in.h>
+		],
+		[
+#ifndef IPV6_V6ONLY
+#error no IPV6_V6ONLY
+#endif
+		],[
+		libreplace_cv_HAVE_IPV6_V6ONLY=yes
+		],[
+		libreplace_cv_HAVE_IPV6_V6ONLY=no
+		])
+])
+if test x"$libreplace_cv_HAVE_IPV6_V6ONLY" != x"yes"; then
+   dnl test for IPV6_V6ONLY
+   AC_CACHE_CHECK([for IPV6_V6ONLY in linux/in6.h],libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26,[
+	AC_TRY_COMPILE([
+	#include <linux/in6.h>
+		],
+		[
+	#if (IPV6_V6ONLY != 26)
+	#error no linux IPV6_V6ONLY
+	#endif
+		],[
+		libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26=yes
+		],[
+		libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26=no
+		])
+	])
+	if test x"$libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26" = x"yes"; then
+		AC_DEFINE(HAVE_LINUX_IPV6_V6ONLY_26,1,[Whether the system has IPV6_V6ONLY in linux/in6.h])
+	fi
+fi
+
+dnl test for ipv6
+AC_CACHE_CHECK([for ipv6 support],libreplace_cv_HAVE_IPV6,[
+	AC_TRY_LINK([
+#include <stdlib.h> /* for NULL */
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>
+#include <netinet/in.h>
+		],
+		[
+struct sockaddr_storage sa_store;
+struct addrinfo *ai = NULL;
+struct in6_addr in6addr;
+int idx = if_nametoindex("iface1");
+int s = socket(AF_INET6, SOCK_STREAM, 0);
+int ret = getaddrinfo(NULL, NULL, NULL, &ai);
+if (ret != 0) {
+	const char *es = gai_strerror(ret);
+}
+freeaddrinfo(ai);
+{
+	int val = 1;
+	#ifdef HAVE_LINUX_IPV6_V6ONLY_26
+	#define IPV6_V6ONLY 26
+	#endif
+	ret = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+			 (const void *)&val, sizeof(val));
+}
+		],[
+		libreplace_cv_HAVE_IPV6=yes
+		],[
+		libreplace_cv_HAVE_IPV6=no
+		])
+])
+if test x"$libreplace_cv_HAVE_IPV6" = x"yes"; then
+    AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
+fi
+
+LIBS=$old_LIBS
+CPPFLAGS="$libreplace_SAVE_CPPFLAGS"
+
+LIBREPLACEOBJ="${LIBREPLACEOBJ} ${LIBREPLACE_NETWORK_OBJS}"
+
+echo "LIBREPLACE_NETWORK_CHECKS: END"
+]) dnl end AC_LIBREPLACE_NETWORK_CHECKS

Added: branches/talloc/experimental/lib/replace/repdir.m4
===================================================================
--- branches/talloc/experimental/lib/replace/repdir.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/repdir.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,81 @@
+AC_CACHE_CHECK([for broken readdir],libreplace_cv_READDIR_NEEDED,[
+	AC_TRY_RUN([
+#define test_readdir_os2_delete main
+#include "$libreplacedir/test/os2_delete.c"],
+	[libreplace_cv_READDIR_NEEDED=no],
+	[libreplace_cv_READDIR_NEEDED=yes],
+	[libreplace_cv_READDIR_NEEDED="assuming not"])
+])
+
+AC_CHECK_FUNCS(dirfd)
+AC_HAVE_DECL(dirfd, [#include <dirent.h>])
+
+#
+# try to replace with getdirentries() if needed
+#
+if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
+AC_CHECK_FUNCS(getdirentries)
+AC_VERIFY_C_PROTOTYPE([long telldir(const DIR *dir)],
+	[
+	return 0;
+	],[
+	AC_DEFINE(TELLDIR_TAKES_CONST_DIR, 1, [Whether telldir takes a const pointer])
+	],[],[
+	#include <dirent.h>
+	])
+
+AC_VERIFY_C_PROTOTYPE([int seekdir(DIR *dir, long ofs)],
+	[
+	return 0;
+	],[
+	AC_DEFINE(SEEKDIR_RETURNS_INT, 1, [Whether seekdir returns an int])
+	],[],[
+	#include <dirent.h>
+	])
+AC_CACHE_CHECK([for replacing readdir using getdirentries()],libreplace_cv_READDIR_GETDIRENTRIES,[
+	AC_TRY_RUN([
+#define _LIBREPLACE_REPLACE_H
+#include "$libreplacedir/repdir_getdirentries.c"
+#define test_readdir_os2_delete main
+#include "$libreplacedir/test/os2_delete.c"],
+	[libreplace_cv_READDIR_GETDIRENTRIES=yes],
+	[libreplace_cv_READDIR_GETDIRENTRIES=no])
+])
+fi
+if test x"$libreplace_cv_READDIR_GETDIRENTRIES" = x"yes"; then
+	AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
+	AC_DEFINE(REPLACE_READDIR_GETDIRENTRIES,1,[replace readdir using getdirentries()])
+	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/repdir_getdirentries.o"
+	libreplace_cv_READDIR_NEEDED=no
+fi
+
+#
+# try to replace with getdents() if needed
+#
+if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
+AC_CHECK_FUNCS(getdents)
+AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_cv_READDIR_GETDENTS,[
+	AC_TRY_RUN([
+#define _LIBREPLACE_REPLACE_H
+#error _donot_use_getdents_replacement_anymore
+#include "$libreplacedir/repdir_getdents.c"
+#define test_readdir_os2_delete main
+#include "$libreplacedir/test/os2_delete.c"],
+	[libreplace_cv_READDIR_GETDENTS=yes],
+	[libreplace_cv_READDIR_GETDENTS=no])
+])
+fi
+if test x"$libreplace_cv_READDIR_GETDENTS" = x"yes"; then
+	AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
+	AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()])
+	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/repdir_getdents.o"
+	libreplace_cv_READDIR_NEEDED=no
+fi
+
+AC_MSG_CHECKING([a usable readdir()])
+if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
+	AC_MSG_RESULT(no)
+	AC_MSG_WARN([the provided readdir() is broken])
+else
+	AC_MSG_RESULT(yes)
+fi

Added: branches/talloc/experimental/lib/replace/repdir_getdents.c
===================================================================
--- branches/talloc/experimental/lib/replace/repdir_getdents.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/repdir_getdents.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,166 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   Copyright (C) Andrew Tridgell 2005
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+/*
+  a replacement for opendir/readdir/telldir/seekdir/closedir for BSD systems
+
+  This is needed because the existing directory handling in FreeBSD
+  and OpenBSD (and possibly NetBSD) doesn't correctly handle unlink()
+  on files in a directory where telldir() has been used. On a block
+  boundary it will occasionally miss a file when seekdir() is used to
+  return to a position previously recorded with telldir().
+
+  This also fixes a severe performance and memory usage problem with
+  telldir() on BSD systems. Each call to telldir() in BSD adds an
+  entry to a linked list, and those entries are cleaned up on
+  closedir(). This means with a large directory closedir() can take an
+  arbitrary amount of time, causing network timeouts as millions of
+  telldir() entries are freed
+
+  Note! This replacement code is not portable. It relies on getdents()
+  always leaving the file descriptor at a seek offset that is a
+  multiple of DIR_BUF_SIZE. If the code detects that this doesn't
+  happen then it will abort(). It also does not handle directories
+  with offsets larger than can be stored in a long,
+
+  This code is available under other free software licenses as
+  well. Contact the author.
+*/
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <dirent.h>
+
+#define DIR_BUF_BITS 9
+#define DIR_BUF_SIZE (1<<DIR_BUF_BITS)
+
+struct dir_buf {
+	int fd;
+	int nbytes, ofs;
+	off_t seekpos;
+	char buf[DIR_BUF_SIZE];
+};
+
+DIR *opendir(const char *dname)
+{
+	struct dir_buf *d;
+	struct stat sb;
+	d = malloc(sizeof(*d));
+	if (d == NULL) {
+		errno = ENOMEM;
+		return NULL;
+	}
+	d->fd = open(dname, O_RDONLY);
+	if (d->fd == -1) {
+		free(d);
+		return NULL;
+	}
+	if (fstat(d->fd, &sb) < 0) {
+		close(d->fd);
+		free(d);
+		return NULL;
+	}
+	if (!S_ISDIR(sb.st_mode)) {
+		close(d->fd);
+		free(d);   
+		errno = ENOTDIR;
+		return NULL;
+	}
+	d->ofs = 0;
+	d->seekpos = 0;
+	d->nbytes = 0;
+	return (DIR *)d;
+}
+
+struct dirent *readdir(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	struct dirent *de;
+
+	if (d->ofs >= d->nbytes) {
+		d->seekpos = lseek(d->fd, 0, SEEK_CUR);
+		d->nbytes = getdents(d->fd, d->buf, DIR_BUF_SIZE);
+		d->ofs = 0;
+	}
+	if (d->ofs >= d->nbytes) {
+		return NULL;
+	}
+	de = (struct dirent *)&d->buf[d->ofs];
+	d->ofs += de->d_reclen;
+	return de;
+}
+
+long telldir(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	if (d->ofs >= d->nbytes) {
+		d->seekpos = lseek(d->fd, 0, SEEK_CUR);
+		d->ofs = 0;
+		d->nbytes = 0;
+	}
+	/* this relies on seekpos always being a multiple of
+	   DIR_BUF_SIZE. Is that always true on BSD systems? */
+	if (d->seekpos & (DIR_BUF_SIZE-1)) {
+		abort();
+	}
+	return d->seekpos + d->ofs;
+}
+
+void seekdir(DIR *dir, long ofs)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	d->seekpos = lseek(d->fd, ofs & ~(DIR_BUF_SIZE-1), SEEK_SET);
+	d->nbytes = getdents(d->fd, d->buf, DIR_BUF_SIZE);
+	d->ofs = 0;
+	while (d->ofs < (ofs & (DIR_BUF_SIZE-1))) {
+		if (readdir(dir) == NULL) break;
+	}
+}
+
+void rewinddir(DIR *dir)
+{
+	seekdir(dir, 0);
+}
+
+int closedir(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	int r = close(d->fd);
+	if (r != 0) {
+		return r;
+	}
+	free(d);
+	return 0;
+}
+
+#ifndef dirfd
+/* darn, this is a macro on some systems. */
+int dirfd(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	return d->fd;
+}
+#endif

Added: branches/talloc/experimental/lib/replace/repdir_getdirentries.c
===================================================================
--- branches/talloc/experimental/lib/replace/repdir_getdirentries.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/repdir_getdirentries.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,183 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   Copyright (C) Andrew Tridgell 2005
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+/*
+  a replacement for opendir/readdir/telldir/seekdir/closedir for BSD
+  systems using getdirentries
+
+  This is needed because the existing directory handling in FreeBSD
+  and OpenBSD (and possibly NetBSD) doesn't correctly handle unlink()
+  on files in a directory where telldir() has been used. On a block
+  boundary it will occasionally miss a file when seekdir() is used to
+  return to a position previously recorded with telldir().
+
+  This also fixes a severe performance and memory usage problem with
+  telldir() on BSD systems. Each call to telldir() in BSD adds an
+  entry to a linked list, and those entries are cleaned up on
+  closedir(). This means with a large directory closedir() can take an
+  arbitrary amount of time, causing network timeouts as millions of
+  telldir() entries are freed
+
+  Note! This replacement code is not portable. It relies on
+  getdirentries() always leaving the file descriptor at a seek offset
+  that is a multiple of DIR_BUF_SIZE. If the code detects that this
+  doesn't happen then it will abort(). It also does not handle
+  directories with offsets larger than can be stored in a long,
+
+  This code is available under other free software licenses as
+  well. Contact the author.
+*/
+
+#include "replace.h"
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <dirent.h>
+
+#define DIR_BUF_BITS 9
+#define DIR_BUF_SIZE (1<<DIR_BUF_BITS)
+
+struct dir_buf {
+	int fd;
+	int nbytes, ofs;
+	off_t seekpos;
+	char buf[DIR_BUF_SIZE];
+};
+
+DIR *opendir(const char *dname)
+{
+	struct dir_buf *d;
+	struct stat sb;
+	d = malloc(sizeof(*d));
+	if (d == NULL) {
+		errno = ENOMEM;
+		return NULL;
+	}
+	d->fd = open(dname, O_RDONLY);
+	if (d->fd == -1) {
+		free(d);
+		return NULL;
+	}
+	if (fstat(d->fd, &sb) < 0) {
+		close(d->fd);
+		free(d);
+		return NULL;
+	}
+	if (!S_ISDIR(sb.st_mode)) {
+		close(d->fd);
+		free(d);   
+		errno = ENOTDIR;
+		return NULL;
+	}
+	d->ofs = 0;
+	d->seekpos = 0;
+	d->nbytes = 0;
+	return (DIR *)d;
+}
+
+struct dirent *readdir(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	struct dirent *de;
+
+	if (d->ofs >= d->nbytes) {
+		long pos;
+		d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &pos);
+		d->seekpos = pos;
+		d->ofs = 0;
+	}
+	if (d->ofs >= d->nbytes) {
+		return NULL;
+	}
+	de = (struct dirent *)&d->buf[d->ofs];
+	d->ofs += de->d_reclen;
+	return de;
+}
+
+#ifdef TELLDIR_TAKES_CONST_DIR
+long telldir(const DIR *dir)
+#else
+long telldir(DIR *dir)
+#endif
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	if (d->ofs >= d->nbytes) {
+		d->seekpos = lseek(d->fd, 0, SEEK_CUR);
+		d->ofs = 0;
+		d->nbytes = 0;
+	}
+	/* this relies on seekpos always being a multiple of
+	   DIR_BUF_SIZE. Is that always true on BSD systems? */
+	if (d->seekpos & (DIR_BUF_SIZE-1)) {
+		abort();
+	}
+	return d->seekpos + d->ofs;
+}
+
+#ifdef SEEKDIR_RETURNS_INT
+int seekdir(DIR *dir, long ofs)
+#else
+void seekdir(DIR *dir, long ofs)
+#endif
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	long pos;
+	d->seekpos = lseek(d->fd, ofs & ~(DIR_BUF_SIZE-1), SEEK_SET);
+	d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &pos);
+	d->ofs = 0;
+	while (d->ofs < (ofs & (DIR_BUF_SIZE-1))) {
+		if (readdir(dir) == NULL) break;
+	}
+#ifdef SEEKDIR_RETURNS_INT
+	return -1;
+#endif
+}
+
+void rewinddir(DIR *dir)
+{
+	seekdir(dir, 0);
+}
+
+int closedir(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	int r = close(d->fd);
+	if (r != 0) {
+		return r;
+	}
+	free(d);
+	return 0;
+}
+
+#ifndef dirfd
+/* darn, this is a macro on some systems. */
+int dirfd(DIR *dir)
+{
+	struct dir_buf *d = (struct dir_buf *)dir;
+	return d->fd;
+}
+#endif
+
+

Added: branches/talloc/experimental/lib/replace/replace.c
===================================================================
--- branches/talloc/experimental/lib/replace/replace.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/replace.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,762 @@
+/* 
+   Unix SMB/CIFS implementation.
+   replacement routines for broken systems
+   Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) Jelmer Vernooij 2005-2008
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+#include "system/filesys.h"
+#include "system/time.h"
+#include "system/passwd.h"
+#include "system/syslog.h"
+#include "system/locale.h"
+#include "system/wait.h"
+
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
+void replace_dummy(void);
+void replace_dummy(void) {}
+
+#ifndef HAVE_FTRUNCATE
+ /*******************************************************************
+ftruncate for operating systems that don't have it
+********************************************************************/
+int rep_ftruncate(int f, off_t l)
+{
+#ifdef HAVE_CHSIZE
+      return chsize(f,l);
+#elif defined(F_FREESP)
+      struct  flock   fl;
+
+      fl.l_whence = 0;
+      fl.l_len = 0;
+      fl.l_start = l;
+      fl.l_type = F_WRLCK;
+      return fcntl(f, F_FREESP, &fl);
+#else
+#error "you must have a ftruncate function"
+#endif
+}
+#endif /* HAVE_FTRUNCATE */
+
+
+#ifndef HAVE_STRLCPY
+/* like strncpy but does not 0 fill the buffer and always null 
+   terminates. bufsize is the size of the destination buffer */
+size_t rep_strlcpy(char *d, const char *s, size_t bufsize)
+{
+	size_t len = strlen(s);
+	size_t ret = len;
+	if (bufsize <= 0) return 0;
+	if (len >= bufsize) len = bufsize-1;
+	memcpy(d, s, len);
+	d[len] = 0;
+	return ret;
+}
+#endif
+
+#ifndef HAVE_STRLCAT
+/* like strncat but does not 0 fill the buffer and always null 
+   terminates. bufsize is the length of the buffer, which should
+   be one more than the maximum resulting string length */
+size_t rep_strlcat(char *d, const char *s, size_t bufsize)
+{
+	size_t len1 = strlen(d);
+	size_t len2 = strlen(s);
+	size_t ret = len1 + len2;
+
+	if (len1+len2 >= bufsize) {
+		if (bufsize < (len1+1)) {
+			return ret;
+		}
+		len2 = bufsize - (len1+1);
+	}
+	if (len2 > 0) {
+		memcpy(d+len1, s, len2);
+		d[len1+len2] = 0;
+	}
+	return ret;
+}
+#endif
+
+#ifndef HAVE_MKTIME
+/*******************************************************************
+a mktime() replacement for those who don't have it - contributed by 
+C.A. Lademann <cal at zls.com>
+Corrections by richard.kettlewell at kewill.com
+********************************************************************/
+
+#define  MINUTE  60
+#define  HOUR    60*MINUTE
+#define  DAY             24*HOUR
+#define  YEAR    365*DAY
+time_t rep_mktime(struct tm *t)
+{
+  struct tm       *u;
+  time_t  epoch = 0;
+  int n;
+  int             mon [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+  y, m, i;
+
+  if(t->tm_year < 70)
+    return((time_t)-1);
+
+  n = t->tm_year + 1900 - 1;
+  epoch = (t->tm_year - 70) * YEAR + 
+    ((n / 4 - n / 100 + n / 400) - (1969 / 4 - 1969 / 100 + 1969 / 400)) * DAY;
+
+  y = t->tm_year + 1900;
+  m = 0;
+
+  for(i = 0; i < t->tm_mon; i++) {
+    epoch += mon [m] * DAY;
+    if(m == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
+      epoch += DAY;
+    
+    if(++m > 11) {
+      m = 0;
+      y++;
+    }
+  }
+
+  epoch += (t->tm_mday - 1) * DAY;
+  epoch += t->tm_hour * HOUR + t->tm_min * MINUTE + t->tm_sec;
+  
+  if((u = localtime(&epoch)) != NULL) {
+    t->tm_sec = u->tm_sec;
+    t->tm_min = u->tm_min;
+    t->tm_hour = u->tm_hour;
+    t->tm_mday = u->tm_mday;
+    t->tm_mon = u->tm_mon;
+    t->tm_year = u->tm_year;
+    t->tm_wday = u->tm_wday;
+    t->tm_yday = u->tm_yday;
+    t->tm_isdst = u->tm_isdst;
+  }
+
+  return(epoch);
+}
+#endif /* !HAVE_MKTIME */
+
+
+#ifndef HAVE_INITGROUPS
+/****************************************************************************
+ some systems don't have an initgroups call 
+****************************************************************************/
+int rep_initgroups(char *name, gid_t id)
+{
+#ifndef HAVE_SETGROUPS
+	/* yikes! no SETGROUPS or INITGROUPS? how can this work? */
+	errno = ENOSYS;
+	return -1;
+#else /* HAVE_SETGROUPS */
+
+#include <grp.h>
+
+	gid_t *grouplst = NULL;
+	int max_gr = NGROUPS_MAX;
+	int ret;
+	int    i,j;
+	struct group *g;
+	char   *gr;
+	
+	if((grouplst = malloc(sizeof(gid_t) * max_gr)) == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+
+	grouplst[0] = id;
+	i = 1;
+	while (i < max_gr && ((g = (struct group *)getgrent()) != (struct group *)NULL)) {
+		if (g->gr_gid == id)
+			continue;
+		j = 0;
+		gr = g->gr_mem[0];
+		while (gr && (*gr != (char)NULL)) {
+			if (strcmp(name,gr) == 0) {
+				grouplst[i] = g->gr_gid;
+				i++;
+				gr = (char *)NULL;
+				break;
+			}
+			gr = g->gr_mem[++j];
+		}
+	}
+	endgrent();
+	ret = setgroups(i, grouplst);
+	free(grouplst);
+	return ret;
+#endif /* HAVE_SETGROUPS */
+}
+#endif /* HAVE_INITGROUPS */
+
+
+#if (defined(SecureWare) && defined(SCO))
+/* This is needed due to needing the nap() function but we don't want
+   to include the Xenix libraries since that will break other things...
+   BTW: system call # 0x0c28 is the same as calling nap() */
+long nap(long milliseconds) {
+	 return syscall(0x0c28, milliseconds);
+ }
+#endif
+
+
+#ifndef HAVE_MEMMOVE
+/*******************************************************************
+safely copies memory, ensuring no overlap problems.
+this is only used if the machine does not have its own memmove().
+this is not the fastest algorithm in town, but it will do for our
+needs.
+********************************************************************/
+void *rep_memmove(void *dest,const void *src,int size)
+{
+	unsigned long d,s;
+	int i;
+	if (dest==src || !size) return(dest);
+
+	d = (unsigned long)dest;
+	s = (unsigned long)src;
+
+	if ((d >= (s+size)) || (s >= (d+size))) {
+		/* no overlap */
+		memcpy(dest,src,size);
+		return(dest);
+	}
+
+	if (d < s) {
+		/* we can forward copy */
+		if (s-d >= sizeof(int) && 
+		    !(s%sizeof(int)) && 
+		    !(d%sizeof(int)) && 
+		    !(size%sizeof(int))) {
+			/* do it all as words */
+			int *idest = (int *)dest;
+			int *isrc = (int *)src;
+			size /= sizeof(int);
+			for (i=0;i<size;i++) idest[i] = isrc[i];
+		} else {
+			/* simplest */
+			char *cdest = (char *)dest;
+			char *csrc = (char *)src;
+			for (i=0;i<size;i++) cdest[i] = csrc[i];
+		}
+	} else {
+		/* must backward copy */
+		if (d-s >= sizeof(int) && 
+		    !(s%sizeof(int)) && 
+		    !(d%sizeof(int)) && 
+		    !(size%sizeof(int))) {
+			/* do it all as words */
+			int *idest = (int *)dest;
+			int *isrc = (int *)src;
+			size /= sizeof(int);
+			for (i=size-1;i>=0;i--) idest[i] = isrc[i];
+		} else {
+			/* simplest */
+			char *cdest = (char *)dest;
+			char *csrc = (char *)src;
+			for (i=size-1;i>=0;i--) cdest[i] = csrc[i];
+		}      
+	}
+	return(dest);
+}
+#endif /* HAVE_MEMMOVE */
+
+#ifndef HAVE_STRDUP
+/****************************************************************************
+duplicate a string
+****************************************************************************/
+char *rep_strdup(const char *s)
+{
+	size_t len;
+	char *ret;
+
+	if (!s) return(NULL);
+
+	len = strlen(s)+1;
+	ret = (char *)malloc(len);
+	if (!ret) return(NULL);
+	memcpy(ret,s,len);
+	return(ret);
+}
+#endif /* HAVE_STRDUP */
+
+#ifndef HAVE_SETLINEBUF
+void rep_setlinebuf(FILE *stream)
+{
+	setvbuf(stream, (char *)NULL, _IOLBF, 0);
+}
+#endif /* HAVE_SETLINEBUF */
+
+#ifndef HAVE_VSYSLOG
+#ifdef HAVE_SYSLOG
+void rep_vsyslog (int facility_priority, const char *format, va_list arglist)
+{
+	char *msg = NULL;
+	vasprintf(&msg, format, arglist);
+	if (!msg)
+		return;
+	syslog(facility_priority, "%s", msg);
+	free(msg);
+}
+#endif /* HAVE_SYSLOG */
+#endif /* HAVE_VSYSLOG */
+
+#ifndef HAVE_STRNLEN
+/**
+ Some platforms don't have strnlen
+**/
+ size_t rep_strnlen(const char *s, size_t max)
+{
+        size_t len;
+  
+        for (len = 0; len < max; len++) {
+                if (s[len] == '\0') {
+                        break;
+                }
+        }
+        return len;  
+}
+#endif
+  
+#ifndef HAVE_STRNDUP
+/**
+ Some platforms don't have strndup.
+**/
+char *rep_strndup(const char *s, size_t n)
+{
+	char *ret;
+	
+	n = strnlen(s, n);
+	ret = malloc(n+1);
+	if (!ret)
+		return NULL;
+	memcpy(ret, s, n);
+	ret[n] = 0;
+
+	return ret;
+}
+#endif
+
+#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
+int rep_waitpid(pid_t pid,int *status,int options)
+{
+  return wait4(pid, status, options, NULL);
+}
+#endif
+
+#ifndef HAVE_SETEUID
+int rep_seteuid(uid_t euid)
+{
+#ifdef HAVE_SETRESUID
+	return setresuid(-1, euid, -1);
+#else
+	errno = ENOSYS;
+	return -1;
+#endif
+}
+#endif
+
+#ifndef HAVE_SETEGID
+int rep_setegid(gid_t egid)
+{
+#ifdef HAVE_SETRESGID
+	return setresgid(-1, egid, -1);
+#else
+	errno = ENOSYS;
+	return -1;
+#endif
+}
+#endif
+
+/*******************************************************************
+os/2 also doesn't have chroot
+********************************************************************/
+#ifndef HAVE_CHROOT
+int rep_chroot(const char *dname)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+/*****************************************************************
+ Possibly replace mkstemp if it is broken.
+*****************************************************************/  
+
+#ifndef HAVE_SECURE_MKSTEMP
+int rep_mkstemp(char *template)
+{
+	/* have a reasonable go at emulating it. Hope that
+	   the system mktemp() isn't completely hopeless */
+	char *p = mktemp(template);
+	if (!p)
+		return -1;
+	return open(p, O_CREAT|O_EXCL|O_RDWR, 0600);
+}
+#endif
+
+#ifndef HAVE_MKDTEMP
+char *rep_mkdtemp(char *template)
+{
+	char *dname;
+	
+	if ((dname = mktemp(template))) {
+		if (mkdir(dname, 0700) >= 0) {
+			return dname;
+		}
+	}
+
+	return NULL;
+}
+#endif
+
+/*****************************************************************
+ Watch out: this is not thread safe.
+*****************************************************************/
+
+#ifndef HAVE_PREAD
+ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset)
+{
+	if (lseek(__fd, __offset, SEEK_SET) != __offset) {
+		return -1;
+	}
+	return read(__fd, __buf, __nbytes);
+}
+#endif
+
+/*****************************************************************
+ Watch out: this is not thread safe.
+*****************************************************************/
+
+#ifndef HAVE_PWRITE
+ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
+{
+	if (lseek(__fd, __offset, SEEK_SET) != __offset) {
+		return -1;
+	}
+	return write(__fd, __buf, __nbytes);
+}
+#endif
+
+#ifndef HAVE_STRCASESTR
+char *rep_strcasestr(const char *haystack, const char *needle)
+{
+	const char *s;
+	size_t nlen = strlen(needle);
+	for (s=haystack;*s;s++) {
+		if (toupper(*needle) == toupper(*s) &&
+		    strncasecmp(s, needle, nlen) == 0) {
+			return (char *)((uintptr_t)s);
+		}
+	}
+	return NULL;
+}
+#endif
+
+#ifndef HAVE_STRTOK_R
+/* based on GLIBC version, copyright Free Software Foundation */
+char *rep_strtok_r(char *s, const char *delim, char **save_ptr)
+{
+	char *token;
+
+	if (s == NULL) s = *save_ptr;
+
+	s += strspn(s, delim);
+	if (*s == '\0') {
+		*save_ptr = s;
+		return NULL;
+	}
+
+	token = s;
+	s = strpbrk(token, delim);
+	if (s == NULL) {
+		*save_ptr = token + strlen(token);
+	} else {
+		*s = '\0';
+		*save_ptr = s + 1;
+	}
+
+	return token;
+}
+#endif
+
+#ifndef HAVE_STRTOLL
+long long int rep_strtoll(const char *str, char **endptr, int base)
+{
+#ifdef HAVE_STRTOQ
+	return strtoq(str, endptr, base);
+#elif defined(HAVE___STRTOLL) 
+	return __strtoll(str, endptr, base);
+#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+	return (long long int) strtol(str, endptr, base);
+#else
+# error "You need a strtoll function"
+#endif
+}
+#endif
+
+
+#ifndef HAVE_STRTOULL
+unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+{
+#ifdef HAVE_STRTOUQ
+	return strtouq(str, endptr, base);
+#elif defined(HAVE___STRTOULL) 
+	return __strtoull(str, endptr, base);
+#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+	return (unsigned long long int) strtoul(str, endptr, base);
+#else
+# error "You need a strtoull function"
+#endif
+}
+#endif
+
+#ifndef HAVE_SETENV
+int rep_setenv(const char *name, const char *value, int overwrite) 
+{
+	char *p;
+	size_t l1, l2;
+	int ret;
+
+	if (!overwrite && getenv(name)) {
+		return 0;
+	}
+
+	l1 = strlen(name);
+	l2 = strlen(value);
+
+	p = malloc(l1+l2+2);
+	if (p == NULL) {
+		return -1;
+	}
+	memcpy(p, name, l1);
+	p[l1] = '=';
+	memcpy(p+l1+1, value, l2);
+	p[l1+l2+1] = 0;
+
+	ret = putenv(p);
+	if (ret != 0) {
+		free(p);
+	}
+
+	return ret;
+}
+#endif
+
+#ifndef HAVE_UNSETENV
+int rep_unsetenv(const char *name)
+{
+	extern char **environ;
+	size_t len = strlen(name);
+	size_t i, count;
+
+	if (environ == NULL || getenv(name) == NULL) {
+		return 0;
+	}
+
+	for (i=0;environ[i];i++) /* noop */ ;
+
+	count=i;
+	
+	for (i=0;i<count;) {
+		if (strncmp(environ[i], name, len) == 0 && environ[i][len] == '=') {
+			/* note: we do _not_ free the old variable here. It is unsafe to 
+			   do so, as the pointer may not have come from malloc */
+			memmove(&environ[i], &environ[i+1], (count-i)*sizeof(char *));
+			count--;
+		} else {
+			i++;
+		}
+	}
+
+	return 0;
+}
+#endif
+
+#ifndef HAVE_UTIME
+int rep_utime(const char *filename, const struct utimbuf *buf)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_UTIMES
+int rep_utimes(const char *filename, const struct timeval tv[2])
+{
+	struct utimbuf u;
+
+	u.actime = tv[0].tv_sec;
+	if (tv[0].tv_usec > 500000) {
+		u.actime += 1;
+	}
+
+	u.modtime = tv[1].tv_sec;
+	if (tv[1].tv_usec > 500000) {
+		u.modtime += 1;
+	}
+
+	return utime(filename, &u);
+}
+#endif
+
+#ifndef HAVE_DUP2
+int rep_dup2(int oldfd, int newfd) 
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_CHOWN
+/**
+chown isn't used much but OS/2 doesn't have it
+**/
+int rep_chown(const char *fname, uid_t uid, gid_t gid)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_LINK
+int rep_link(const char *oldpath, const char *newpath)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_READLINK
+int rep_readlink(const char *path, char *buf, size_t bufsiz)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_SYMLINK
+int rep_symlink(const char *oldpath, const char *newpath)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_LCHOWN
+int rep_lchown(const char *fname,uid_t uid,gid_t gid)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
+#ifndef HAVE_REALPATH
+char *rep_realpath(const char *path, char *resolved_path)
+{
+	/* As realpath is not a system call we can't return ENOSYS. */
+	errno = EINVAL;
+	return NULL;
+}
+#endif
+
+
+#ifndef HAVE_MEMMEM
+void *rep_memmem(const void *haystack, size_t haystacklen,
+		 const void *needle, size_t needlelen)
+{
+	if (needlelen == 0) {
+		return discard_const(haystack);
+	}
+	while (haystacklen >= needlelen) {
+		char *p = (char *)memchr(haystack, *(const char *)needle,
+					 haystacklen-(needlelen-1));
+		if (!p) return NULL;
+		if (memcmp(p, needle, needlelen) == 0) {
+			return p;
+		}
+		haystack = p+1;
+		haystacklen -= (p - (const char *)haystack) + 1;
+	}
+	return NULL;
+}
+#endif
+
+#ifndef HAVE_VDPRINTF
+int rep_vdprintf(int fd, const char *format, va_list ap)
+{
+	char *s = NULL;
+	int ret;
+
+	vasprintf(&s, format, ap);
+	if (s == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+	ret = write(fd, s, strlen(s));
+	free(s);
+	return ret;
+}
+#endif
+
+#ifndef HAVE_DPRINTF
+int rep_dprintf(int fd, const char *format, ...)
+{
+	int ret;
+	va_list ap;
+
+	va_start(ap, format);
+	ret = vdprintf(fd, format, ap);
+	va_end(ap);
+
+	return ret;
+}
+#endif
+
+#ifndef HAVE_GET_CURRENT_DIR_NAME
+char *rep_get_current_dir_name(void)
+{
+	char buf[PATH_MAX+1];
+	char *p;
+	p = getcwd(buf, sizeof(buf));
+	if (p == NULL) {
+		return NULL;
+	}
+	return strdup(p);
+}
+#endif
+
+#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
+int rep_strerror_r(int errnum, char *buf, size_t buflen)
+{
+	char *s = strerror(errnum);
+	if (strlen(s)+1 > buflen) {
+		errno = ERANGE;
+		return -1;
+	}
+	strncpy(buf, s, buflen);
+	return 0;
+}
+#endif

Added: branches/talloc/experimental/lib/replace/replace.h
===================================================================
--- branches/talloc/experimental/lib/replace/replace.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/replace.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,774 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   macros to go along with the lib/replace/ portability layer code
+
+   Copyright (C) Andrew Tridgell 2005
+   Copyright (C) Jelmer Vernooij 2006-2008
+   Copyright (C) Jeremy Allison 2007.
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _LIBREPLACE_REPLACE_H
+#define _LIBREPLACE_REPLACE_H
+
+#ifndef NO_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_STANDARDS_H
+#include <standards.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include "win32_replace.h"
+#endif
+
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+/* force off HAVE_INTTYPES_H so that roken doesn't try to include both,
+   which causes a warning storm on irix */
+#undef HAVE_INTTYPES_H
+#elif HAVE_INTTYPES_H
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+#endif
+
+#ifndef __PRI64_PREFIX
+# if __WORDSIZE == 64
+#  define __PRI64_PREFIX	"l"
+# else
+#  define __PRI64_PREFIX	"ll"
+# endif
+#endif
+
+/* Decimal notation.  */
+#ifndef PRId8
+# define PRId8		"d"
+#endif
+#ifndef PRId16
+# define PRId16		"d"
+#endif
+#ifndef PRId32
+# define PRId32		"d"
+#endif
+#ifndef PRId64
+# define PRId64		__PRI64_PREFIX "d"
+#endif
+
+#ifndef PRIi8
+# define PRIi8		"i"
+#endif
+#ifndef PRIi8
+# define PRIi16		"i"
+#endif
+#ifndef PRIi8
+# define PRIi32		"i"
+#endif
+#ifndef PRIi8
+# define PRIi64		__PRI64_PREFIX "i"
+#endif
+
+#ifndef PRIu8
+# define PRIu8		"u"
+#endif
+#ifndef PRIu16
+# define PRIu16		"u"
+#endif
+#ifndef PRIu32
+# define PRIu32		"u"
+#endif
+#ifndef PRIu64
+# define PRIu64		__PRI64_PREFIX "u"
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
+#ifndef HAVE_STRERROR
+extern char *sys_errlist[];
+#define strerror(i) sys_errlist[i]
+#endif
+
+#ifndef HAVE_ERRNO_DECL
+extern int errno;
+#endif
+
+#ifndef HAVE_STRDUP
+#define strdup rep_strdup
+char *rep_strdup(const char *s);
+#endif
+
+#ifndef HAVE_MEMMOVE
+#define memmove rep_memmove
+void *rep_memmove(void *dest,const void *src,int size);
+#endif
+
+#ifndef HAVE_MEMMEM
+#define memmem rep_memmem
+void *rep_memmem(const void *haystack, size_t haystacklen,
+		 const void *needle, size_t needlelen);
+#endif
+
+#ifndef HAVE_MKTIME
+#define mktime rep_mktime
+/* prototype is in "system/time.h" */
+#endif
+
+#ifndef HAVE_TIMEGM
+#define timegm rep_timegm
+/* prototype is in "system/time.h" */
+#endif
+
+#ifndef HAVE_UTIME
+#define utime rep_utime
+/* prototype is in "system/time.h" */
+#endif
+
+#ifndef HAVE_UTIMES
+#define utimes rep_utimes
+/* prototype is in "system/time.h" */
+#endif
+
+#ifndef HAVE_STRLCPY
+#define strlcpy rep_strlcpy
+size_t rep_strlcpy(char *d, const char *s, size_t bufsize);
+#endif
+
+#ifndef HAVE_STRLCAT
+#define strlcat rep_strlcat
+size_t rep_strlcat(char *d, const char *s, size_t bufsize);
+#endif
+
+#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
+#undef HAVE_STRNDUP
+#define strndup rep_strndup
+char *rep_strndup(const char *s, size_t n);
+#endif
+
+#if (defined(BROKEN_STRNLEN) || !defined(HAVE_STRNLEN))
+#undef HAVE_STRNLEN
+#define strnlen rep_strnlen
+size_t rep_strnlen(const char *s, size_t n);
+#endif
+
+#if !HAVE_DECL_ENVIRON
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
+extern char **environ;
+#endif
+#endif
+
+#ifndef HAVE_SETENV
+#define setenv rep_setenv
+int rep_setenv(const char *name, const char *value, int overwrite);
+#else
+#ifndef HAVE_SETENV_DECL
+int setenv(const char *name, const char *value, int overwrite);
+#endif
+#endif
+
+#ifndef HAVE_UNSETENV
+#define unsetenv rep_unsetenv
+int rep_unsetenv(const char *name);
+#endif
+
+#ifndef HAVE_SETEUID
+#define seteuid rep_seteuid
+int rep_seteuid(uid_t);
+#endif
+
+#ifndef HAVE_SETEGID
+#define setegid rep_setegid
+int rep_setegid(gid_t);
+#endif
+
+#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
+/* stupid glibc */
+int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+#endif
+#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL))
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+#endif
+
+#ifndef HAVE_CHOWN
+#define chown rep_chown
+int rep_chown(const char *path, uid_t uid, gid_t gid);
+#endif
+
+#ifndef HAVE_CHROOT
+#define chroot rep_chroot
+int rep_chroot(const char *dirname);
+#endif
+
+#ifndef HAVE_LINK
+#define link rep_link
+int rep_link(const char *oldpath, const char *newpath);
+#endif
+
+#ifndef HAVE_READLINK
+#define readlink rep_readlink
+ssize_t rep_readlink(const char *path, char *buf, size_t bufsize);
+#endif
+
+#ifndef HAVE_SYMLINK
+#define symlink rep_symlink
+int rep_symlink(const char *oldpath, const char *newpath);
+#endif
+
+#ifndef HAVE_REALPATH
+#define realpath rep_realpath
+char *rep_realpath(const char *path, char *resolved_path);
+#endif
+
+#ifndef HAVE_LCHOWN
+#define lchown rep_lchown
+int rep_lchown(const char *fname,uid_t uid,gid_t gid);
+#endif
+
+#ifdef HAVE_UNIX_H
+#include <unix.h>
+#endif
+
+#ifndef HAVE_SETLINEBUF
+#define setlinebuf rep_setlinebuf
+void rep_setlinebuf(FILE *);
+#endif
+
+#ifndef HAVE_STRCASESTR
+#define strcasestr rep_strcasestr
+char *rep_strcasestr(const char *haystack, const char *needle);
+#endif
+
+#ifndef HAVE_STRTOK_R
+#define strtok_r rep_strtok_r
+char *rep_strtok_r(char *s, const char *delim, char **save_ptr);
+#endif
+
+#ifndef HAVE_STRTOLL
+#define strtoll rep_strtoll
+long long int rep_strtoll(const char *str, char **endptr, int base);
+#endif
+
+#ifndef HAVE_STRTOULL
+#define strtoull rep_strtoull
+unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+#endif
+
+#ifndef HAVE_FTRUNCATE
+#define ftruncate rep_ftruncate
+int rep_ftruncate(int,off_t);
+#endif
+
+#ifndef HAVE_INITGROUPS
+#define initgroups rep_initgroups
+int rep_initgroups(char *name, gid_t id);
+#endif
+
+#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
+#define bzero(a,b) memset((a),'\0',(b))
+#endif
+
+#ifndef HAVE_DLERROR
+#define dlerror rep_dlerror
+char *rep_dlerror(void);
+#endif
+
+#ifndef HAVE_DLOPEN
+#define dlopen rep_dlopen
+#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
+void *rep_dlopen(const char *name, unsigned int flags);
+#else
+void *rep_dlopen(const char *name, int flags);
+#endif
+#endif
+
+#ifndef HAVE_DLSYM
+#define dlsym rep_dlsym
+void *rep_dlsym(void *handle, const char *symbol);
+#endif
+
+#ifndef HAVE_DLCLOSE
+#define dlclose rep_dlclose
+int rep_dlclose(void *handle);
+#endif
+
+#ifndef HAVE_SOCKETPAIR
+#define socketpair rep_socketpair
+/* prototype is in system/network.h */
+#endif
+
+#ifndef HAVE_VDPRINTF
+#define vdprintf rep_vdprintf
+int rep_vdprintf(int fd, const char *format, va_list ap);
+#endif
+
+#ifndef HAVE_DPRINTF
+#define dprintf rep_dprintf
+int rep_dprintf(int fd, const char *format, ...);
+#endif
+
+#ifndef PRINTF_ATTRIBUTE
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+#endif
+
+#ifndef _DEPRECATED_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
+#endif
+
+#ifndef HAVE_VASPRINTF
+#define vasprintf rep_vasprintf
+int rep_vasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
+#endif
+
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+#define snprintf rep_snprintf
+int rep_snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
+#endif
+
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+#define vsnprintf rep_vsnprintf
+int rep_vsnprintf(char *,size_t ,const char *, va_list ap) PRINTF_ATTRIBUTE(3,0);
+#endif
+
+#ifndef HAVE_ASPRINTF
+#define asprintf rep_asprintf
+int rep_asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
+#endif
+
+#ifndef HAVE_VSYSLOG
+#ifdef HAVE_SYSLOG
+#define vsyslog rep_vsyslog
+void rep_vsyslog (int facility_priority, const char *format, va_list arglist) PRINTF_ATTRIBUTE(2,0);
+#endif
+#endif
+
+/* we used to use these fns, but now we have good replacements
+   for snprintf and vsnprintf */
+#define slprintf snprintf
+
+
+#ifndef HAVE_VA_COPY
+#undef va_copy
+#ifdef HAVE___VA_COPY
+#define va_copy(dest, src) __va_copy(dest, src)
+#else
+#define va_copy(dest, src) (dest) = (src)
+#endif
+#endif
+
+#ifndef HAVE_VOLATILE
+#define volatile
+#endif
+
+#ifndef HAVE_COMPARISON_FN_T
+typedef int (*comparison_fn_t)(const void *, const void *);
+#endif
+
+#ifdef REPLACE_STRPTIME
+#define strptime rep_strptime
+struct tm;
+char *rep_strptime(const char *buf, const char *format, struct tm *tm);
+#endif
+
+#ifndef HAVE_DUP2
+#define dup2 rep_dup2
+int rep_dup2(int oldfd, int newfd);
+#endif
+
+/* Load header file for dynamic linking stuff */
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#ifndef RTLD_LAZY
+#define RTLD_LAZY 0
+#endif
+#ifndef RTLD_NOW
+#define RTLD_NOW 0
+#endif
+#ifndef RTLD_GLOBAL
+#define RTLD_GLOBAL 0
+#endif
+
+#ifndef HAVE_SECURE_MKSTEMP
+#define mkstemp(path) rep_mkstemp(path)
+int rep_mkstemp(char *temp);
+#endif
+
+#ifndef HAVE_MKDTEMP
+#define mkdtemp rep_mkdtemp
+char *rep_mkdtemp(char *template);
+#endif
+
+#ifndef HAVE_PREAD
+#define pread rep_pread
+ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset);
+#define LIBREPLACE_PREAD_REPLACED 1
+#else
+#define LIBREPLACE_PREAD_NOT_REPLACED 1
+#endif
+
+#ifndef HAVE_PWRITE
+#define pwrite rep_pwrite
+ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset);
+#define LIBREPLACE_PWRITE_REPLACED 1
+#else
+#define LIBREPLACE_PWRITE_NOT_REPLACED 1
+#endif
+
+#if !defined(HAVE_INET_NTOA) || defined(REPLACE_INET_NTOA)
+#define inet_ntoa rep_inet_ntoa
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_INET_PTON
+#define inet_pton rep_inet_pton
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_INET_NTOP
+#define inet_ntop rep_inet_ntop
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_INET_ATON
+#define inet_aton rep_inet_aton
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_CONNECT
+#define connect rep_connect
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_GETHOSTBYNAME
+#define gethostbyname rep_gethostbyname
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_GETIFADDRS
+#define getifaddrs rep_getifaddrs
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_FREEIFADDRS
+#define freeifaddrs rep_freeifaddrs
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_GET_CURRENT_DIR_NAME
+#define get_current_dir_name rep_get_current_dir_name
+char *rep_get_current_dir_name(void);
+#endif
+
+#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
+#define strerror_r rep_strerror_r
+int rep_strerror_r(int errnum, char *buf, size_t buflen);
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+/* The extra casts work around common compiler bugs.  */
+#define _TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
+   It is necessary at least when t == time_t.  */
+#define _TYPE_MINIMUM(t) ((t) (_TYPE_SIGNED (t) \
+  			      ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
+#define _TYPE_MAXIMUM(t) ((t) (~ (t) 0 - _TYPE_MINIMUM (t)))
+
+#ifndef UINT16_MAX
+#define UINT16_MAX 65535
+#endif
+
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#ifndef UINT64_MAX
+#define UINT64_MAX ((uint64_t)-1)
+#endif
+
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
+#ifndef INT32_MAX
+#define INT32_MAX _TYPE_MAXIMUM(int32_t)
+#endif
+
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
+#if !defined(HAVE_BOOL)
+#ifdef HAVE__Bool
+#define bool _Bool
+#else
+typedef int bool;
+#endif
+#endif
+
+#if !defined(HAVE_INTPTR_T)
+typedef long long intptr_t ;
+#endif
+
+#if !defined(HAVE_UINTPTR_T)
+typedef unsigned long long uintptr_t ;
+#endif
+
+#if !defined(HAVE_PTRDIFF_T)
+typedef unsigned long long ptrdiff_t ;
+#endif
+
+/*
+ * to prevent <rpcsvc/yp_prot.h> from doing a redefine of 'bool'
+ *
+ * IRIX, HPUX, MacOS 10 and Solaris need BOOL_DEFINED
+ * Tru64 needs _BOOL_EXISTS
+ * AIX needs _BOOL,_TRUE,_FALSE
+ */
+#ifndef BOOL_DEFINED
+#define BOOL_DEFINED
+#endif
+#ifndef _BOOL_EXISTS
+#define _BOOL_EXISTS
+#endif
+#ifndef _BOOL
+#define _BOOL
+#endif
+
+#ifndef __bool_true_false_are_defined
+#define __bool_true_false_are_defined
+#endif
+
+#ifndef true
+#define true (1)
+#endif
+#ifndef false
+#define false (0)
+#endif
+
+#ifndef _TRUE
+#define _TRUE true
+#endif
+#ifndef _FALSE
+#define _FALSE false
+#endif
+
+#ifndef HAVE_FUNCTION_MACRO
+#ifdef HAVE_func_MACRO
+#define __FUNCTION__ __func__
+#else
+#define __FUNCTION__ ("")
+#endif
+#endif
+
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+#if !defined(HAVE_VOLATILE)
+#define volatile
+#endif
+
+/**
+  this is a warning hack. The idea is to use this everywhere that we
+  get the "discarding const" warning from gcc. That doesn't actually
+  fix the problem of course, but it means that when we do get to
+  cleaning them up we can do it by searching the code for
+  discard_const.
+
+  It also means that other error types aren't as swamped by the noise
+  of hundreds of const warnings, so we are more likely to notice when
+  we get new errors.
+
+  Please only add more uses of this macro when you find it
+  _really_ hard to fix const warnings. Our aim is to eventually use
+  this function in only a very few places.
+
+  Also, please call this via the discard_const_p() macro interface, as that
+  makes the return type safe.
+*/
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+
+/** Type-safe version of discard_const */
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+
+#ifndef __STRING
+#define __STRING(x)    #x
+#endif
+
+#ifndef __STRINGSTRING
+#define __STRINGSTRING(x) __STRING(x)
+#endif
+
+#ifndef __LINESTR__
+#define __LINESTR__ __STRINGSTRING(__LINE__)
+#endif
+
+#ifndef __location__
+#define __location__ __FILE__ ":" __LINESTR__
+#endif
+
+/** 
+ * zero a structure 
+ */
+#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+
+/** 
+ * zero a structure given a pointer to the structure 
+ */
+#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
+
+/** 
+ * zero a structure given a pointer to the structure - no zero check 
+ */
+#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
+
+/* zero an array - note that sizeof(array) must work - ie. it must not be a
+   pointer */
+#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x))
+
+/**
+ * work out how many elements there are in a static array 
+ */
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
+
+/** 
+ * pointer difference macro 
+ */
+#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
+
+#if MMAP_BLACKLIST
+#undef HAVE_MMAP
+#endif
+
+#ifdef __COMPAR_FN_T
+#define QSORT_CAST (__compar_fn_t)
+#endif
+
+#ifndef QSORT_CAST
+#define QSORT_CAST (int (*)(const void *, const void *))
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+#ifndef MAX_DNS_NAME_LENGTH
+#define MAX_DNS_NAME_LENGTH 256 /* Actually 255 but +1 for terminating null. */
+#endif
+
+#ifndef HAVE_CRYPT
+char *ufc_crypt(const char *key, const char *salt);
+#define crypt ufc_crypt
+#else
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+#endif
+
+/* these macros gain us a few percent of speed on gcc */
+#if (__GNUC__ >= 3)
+/* the strange !! is to ensure that __builtin_expect() takes either 0 or 1
+   as its first argument */
+#ifndef likely
+#define likely(x)   __builtin_expect(!!(x), 1)
+#endif
+#ifndef unlikely
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#endif
+#else
+#ifndef likely
+#define likely(x) (x)
+#endif
+#ifndef unlikely
+#define unlikely(x) (x)
+#endif
+#endif
+
+#ifndef HAVE_FDATASYNC
+#define fdatasync(fd) fsync(fd)
+#endif
+
+/* these are used to mark symbols as local to a shared lib, or
+ * publicly available via the shared lib API */
+#ifndef _PUBLIC_
+#ifdef HAVE_VISIBILITY_ATTR
+#define _PUBLIC_ __attribute__((visibility("default")))
+#else
+#define _PUBLIC_
+#endif
+#endif
+
+#ifndef _PRIVATE_
+#ifdef HAVE_VISIBILITY_ATTR
+#  define _PRIVATE_ __attribute__((visibility("hidden")))
+#else
+#  define _PRIVATE_
+#endif
+#endif
+
+#endif /* _LIBREPLACE_REPLACE_H */

Added: branches/talloc/experimental/lib/replace/samba.m4
===================================================================
--- branches/talloc/experimental/lib/replace/samba.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/samba.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,34 @@
+AC_LIBREPLACE_BROKEN_CHECKS
+AC_LIBREPLACE_NETWORK_CHECKS
+
+SMB_EXT_LIB(LIBREPLACE_EXT, [${LIBDL} ${CRYPT_LIBS}])
+SMB_ENABLE(LIBREPLACE_EXT)
+
+SMB_EXT_LIB(LIBREPLACE_NETWORK, [${LIBREPLACE_NETWORK_LIBS}])
+SMB_ENABLE(LIBREPLACE_NETWORK)
+
+# remove leading ./
+LIBREPLACE_DIR=`echo ${libreplacedir} |sed -e 's/^\.\///g'`
+
+# remove leading srcdir .. we are looking for the relative
+# path within the samba source tree or wherever libreplace is.
+# We need to make sure the object is not forced to end up in
+# the source directory because we might be using a separate
+# build directory.
+LIBREPLACE_DIR=`echo ${LIBREPLACE_DIR} | sed -e "s|^$srcdir/||g"`
+
+LIBREPLACE_OBJS="${LIBREPLACEOBJ}"
+
+SMB_SUBSYSTEM(LIBREPLACE,
+	[${LIBREPLACE_OBJS}],
+	[LIBREPLACE_EXT LIBREPLACE_NETWORK],
+	[-Ilib/replace])
+
+LIBREPLACE_HOSTCC_OBJS=`echo ${LIBREPLACE_OBJS} |sed -e 's/\.o/\.ho/g'`
+
+SMB_SUBSYSTEM(LIBREPLACE_HOSTCC,
+	[${LIBREPLACE_HOSTCC_OBJS}],
+	[],
+	[-Ilib/replace])
+
+AC_CHECK_FUNCS([syslog],,[AC_MSG_ERROR([Required function not found])])

Added: branches/talloc/experimental/lib/replace/snprintf.c
===================================================================
--- branches/talloc/experimental/lib/replace/snprintf.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/snprintf.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,1531 @@
+/*
+ * NOTE: If you change this file, please merge it into rsync, samba, etc.
+ */
+
+/*
+ * Copyright Patrick Powell 1995
+ * This code is based on code written by Patrick Powell (papowell at astart.com)
+ * It may be used for any purpose as long as this notice remains intact
+ * on all source code distributions
+ */
+
+/**************************************************************
+ * Original:
+ * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
+ * A bombproof version of doprnt (dopr) included.
+ * Sigh.  This sort of thing is always nasty do deal with.  Note that
+ * the version here does not include floating point...
+ *
+ * snprintf() is used instead of sprintf() as it does limit checks
+ * for string length.  This covers a nasty loophole.
+ *
+ * The other functions are there to prevent NULL pointers from
+ * causing nast effects.
+ *
+ * More Recently:
+ *  Brandon Long <blong at fiction.net> 9/15/96 for mutt 0.43
+ *  This was ugly.  It is still ugly.  I opted out of floating point
+ *  numbers, but the formatter understands just about everything
+ *  from the normal C string format, at least as far as I can tell from
+ *  the Solaris 2.5 printf(3S) man page.
+ *
+ *  Brandon Long <blong at fiction.net> 10/22/97 for mutt 0.87.1
+ *    Ok, added some minimal floating point support, which means this
+ *    probably requires libm on most operating systems.  Don't yet
+ *    support the exponent (e,E) and sigfig (g,G).  Also, fmtint()
+ *    was pretty badly broken, it just wasn't being exercised in ways
+ *    which showed it, so that's been fixed.  Also, formated the code
+ *    to mutt conventions, and removed dead code left over from the
+ *    original.  Also, there is now a builtin-test, just compile with:
+ *           gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
+ *    and run snprintf for results.
+ * 
+ *  Thomas Roessler <roessler at guug.de> 01/27/98 for mutt 0.89i
+ *    The PGP code was using unsigned hexadecimal formats. 
+ *    Unfortunately, unsigned formats simply didn't work.
+ *
+ *  Michael Elkins <me at cs.hmc.edu> 03/05/98 for mutt 0.90.8
+ *    The original code assumed that both snprintf() and vsnprintf() were
+ *    missing.  Some systems only have snprintf() but not vsnprintf(), so
+ *    the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
+ *
+ *  Andrew Tridgell (tridge at samba.org) Oct 1998
+ *    fixed handling of %.0f
+ *    added test for HAVE_LONG_DOUBLE
+ *
+ * tridge at samba.org, idra at samba.org, April 2001
+ *    got rid of fcvt code (twas buggy and made testing harder)
+ *    added C99 semantics
+ *
+ * date: 2002/12/19 19:56:31;  author: herb;  state: Exp;  lines: +2 -0
+ * actually print args for %g and %e
+ * 
+ * date: 2002/06/03 13:37:52;  author: jmcd;  state: Exp;  lines: +8 -0
+ * Since includes.h isn't included here, VA_COPY has to be defined here.  I don't
+ * see any include file that is guaranteed to be here, so I'm defining it
+ * locally.  Fixes AIX and Solaris builds.
+ * 
+ * date: 2002/06/03 03:07:24;  author: tridge;  state: Exp;  lines: +5 -13
+ * put the ifdef for HAVE_VA_COPY in one place rather than in lots of
+ * functions
+ * 
+ * date: 2002/05/17 14:51:22;  author: jmcd;  state: Exp;  lines: +21 -4
+ * Fix usage of va_list passed as an arg.  Use __va_copy before using it
+ * when it exists.
+ * 
+ * date: 2002/04/16 22:38:04;  author: idra;  state: Exp;  lines: +20 -14
+ * Fix incorrect zpadlen handling in fmtfp.
+ * Thanks to Ollie Oldham <ollie.oldham at metro-optix.com> for spotting it.
+ * few mods to make it easier to compile the tests.
+ * addedd the "Ollie" test to the floating point ones.
+ *
+ * Martin Pool (mbp at samba.org) April 2003
+ *    Remove NO_CONFIG_H so that the test case can be built within a source
+ *    tree with less trouble.
+ *    Remove unnecessary SAFE_FREE() definition.
+ *
+ * Martin Pool (mbp at samba.org) May 2003
+ *    Put in a prototype for dummy_snprintf() to quiet compiler warnings.
+ *
+ *    Move #endif to make sure VA_COPY, LDOUBLE, etc are defined even
+ *    if the C library has some snprintf functions already.
+ *
+ * Darren Tucker (dtucker at zip.com.au) 2005
+ *    Fix bug allowing read overruns of the source string with "%.*s"
+ *    Usually harmless unless the read runs outside the process' allocation
+ *    (eg if your malloc does guard pages) in which case it will segfault.
+ *    From OpenSSH.  Also added test for same.
+ *
+ * Simo Sorce (idra at samba.org) Jan 2006
+ * 
+ *    Add support for position independent parameters 
+ *    fix fmtstr now it conforms to sprintf wrt min.max
+ *
+ **************************************************************/
+
+#include "replace.h"
+#include "system/locale.h"
+
+#ifdef TEST_SNPRINTF /* need math library headers for testing */
+
+/* In test mode, we pretend that this system doesn't have any snprintf
+ * functions, regardless of what config.h says. */
+#  undef HAVE_SNPRINTF
+#  undef HAVE_VSNPRINTF
+#  undef HAVE_C99_VSNPRINTF
+#  undef HAVE_ASPRINTF
+#  undef HAVE_VASPRINTF
+#  include <math.h>
+#endif /* TEST_SNPRINTF */
+
+#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF)
+/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
+#include <stdio.h>
+ /* make the compiler happy with an empty file */
+ void dummy_snprintf(void);
+ void dummy_snprintf(void) {} 
+#endif /* HAVE_SNPRINTF, etc */
+
+/* yes this really must be a ||. Don't muck with this (tridge) */
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+
+#ifdef HAVE_LONG_DOUBLE
+#define LDOUBLE long double
+#else
+#define LDOUBLE double
+#endif
+
+#ifdef HAVE_LONG_LONG
+#define LLONG long long
+#else
+#define LLONG long
+#endif
+
+#ifndef VA_COPY
+#ifdef HAVE_VA_COPY
+#define VA_COPY(dest, src) va_copy(dest, src)
+#else
+#ifdef HAVE___VA_COPY
+#define VA_COPY(dest, src) __va_copy(dest, src)
+#else
+#define VA_COPY(dest, src) (dest) = (src)
+#endif
+#endif
+
+/*
+ * dopr(): poor man's version of doprintf
+ */
+
+/* format read states */
+#define DP_S_DEFAULT 0
+#define DP_S_FLAGS   1
+#define DP_S_MIN     2
+#define DP_S_DOT     3
+#define DP_S_MAX     4
+#define DP_S_MOD     5
+#define DP_S_CONV    6
+#define DP_S_DONE    7
+
+/* format flags - Bits */
+#define DP_F_MINUS 	(1 << 0)
+#define DP_F_PLUS  	(1 << 1)
+#define DP_F_SPACE 	(1 << 2)
+#define DP_F_NUM   	(1 << 3)
+#define DP_F_ZERO  	(1 << 4)
+#define DP_F_UP    	(1 << 5)
+#define DP_F_UNSIGNED 	(1 << 6)
+
+/* Conversion Flags */
+#define DP_C_CHAR    1
+#define DP_C_SHORT   2
+#define DP_C_LONG    3
+#define DP_C_LDOUBLE 4
+#define DP_C_LLONG   5
+#define DP_C_SIZET   6
+
+/* Chunk types */
+#define CNK_FMT_STR 0
+#define CNK_INT     1
+#define CNK_OCTAL   2
+#define CNK_UINT    3
+#define CNK_HEX     4
+#define CNK_FLOAT   5
+#define CNK_CHAR    6
+#define CNK_STRING  7
+#define CNK_PTR     8
+#define CNK_NUM     9
+#define CNK_PRCNT   10
+
+#define char_to_int(p) ((p)- '0')
+#ifndef MAX
+#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
+#endif
+
+struct pr_chunk {
+	int type; /* chunk type */
+	int num; /* parameter number */
+	int min; 
+	int max;
+	int flags;
+	int cflags;
+	int start;
+	int len;
+	LLONG value;
+	LDOUBLE fvalue;
+	char *strvalue;
+	void *pnum;
+	struct pr_chunk *min_star;
+	struct pr_chunk *max_star;
+	struct pr_chunk *next;
+};
+
+struct pr_chunk_x {
+	struct pr_chunk **chunks;
+	int num;
+};
+
+static int dopr(char *buffer, size_t maxlen, const char *format, 
+		   va_list args_in);
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+		    char *value, int flags, int min, int max);
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+		    LLONG value, int base, int min, int max, int flags);
+static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
+		   LDOUBLE fvalue, int min, int max, int flags);
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
+static struct pr_chunk *new_chunk(void);
+static int add_cnk_list_entry(struct pr_chunk_x **list,
+				int max_num, struct pr_chunk *chunk);
+
+static int dopr(char *buffer, size_t maxlen, const char *format, va_list args_in)
+{
+	char ch;
+	int state;
+	int pflag;
+	int pnum;
+	int pfirst;
+	size_t currlen;
+	va_list args;
+	const char *base;
+	struct pr_chunk *chunks = NULL;
+	struct pr_chunk *cnk = NULL;
+	struct pr_chunk_x *clist = NULL;
+	int max_pos;
+	int ret = -1;
+
+	VA_COPY(args, args_in);
+
+	state = DP_S_DEFAULT;
+	pfirst = 1;
+	pflag = 0;
+	pnum = 0;
+
+	max_pos = 0;
+	base = format;
+	ch = *format++;
+	
+	/* retrieve the string structure as chunks */
+	while (state != DP_S_DONE) {
+		if (ch == '\0') 
+			state = DP_S_DONE;
+
+		switch(state) {
+		case DP_S_DEFAULT:
+			
+			if (cnk) {
+				cnk->next = new_chunk();
+				cnk = cnk->next;
+			} else {
+				cnk = new_chunk();
+			}
+			if (!cnk) goto done;
+			if (!chunks) chunks = cnk;
+			
+			if (ch == '%') {
+				state = DP_S_FLAGS;
+				ch = *format++;
+			} else {
+				cnk->type = CNK_FMT_STR;
+				cnk->start = format - base -1;
+				while ((ch != '\0') && (ch != '%')) ch = *format++;
+				cnk->len = format - base - cnk->start -1;
+			}
+			break;
+		case DP_S_FLAGS:
+			switch (ch) {
+			case '-':
+				cnk->flags |= DP_F_MINUS;
+				ch = *format++;
+				break;
+			case '+':
+				cnk->flags |= DP_F_PLUS;
+				ch = *format++;
+				break;
+			case ' ':
+				cnk->flags |= DP_F_SPACE;
+				ch = *format++;
+				break;
+			case '#':
+				cnk->flags |= DP_F_NUM;
+				ch = *format++;
+				break;
+			case '0':
+				cnk->flags |= DP_F_ZERO;
+				ch = *format++;
+				break;
+			case 'I':
+				/* internationalization not supported yet */
+				ch = *format++;
+				break;
+			default:
+				state = DP_S_MIN;
+				break;
+			}
+			break;
+		case DP_S_MIN:
+			if (isdigit((unsigned char)ch)) {
+				cnk->min = 10 * cnk->min + char_to_int (ch);
+				ch = *format++;
+			} else if (ch == '$') {
+				if (!pfirst && !pflag) {
+					/* parameters must be all positioned or none */
+					goto done;
+				}
+				if (pfirst) {
+					pfirst = 0;
+					pflag = 1;
+				}
+				if (cnk->min == 0) /* what ?? */
+					goto done;
+				cnk->num = cnk->min;
+				cnk->min = 0;
+				ch = *format++;
+			} else if (ch == '*') {
+				if (pfirst) pfirst = 0;
+				cnk->min_star = new_chunk();
+				if (!cnk->min_star) /* out of memory :-( */
+					goto done;
+				cnk->min_star->type = CNK_INT;
+				if (pflag) {
+					int num;
+					ch = *format++;
+					if (!isdigit((unsigned char)ch)) {
+						/* parameters must be all positioned or none */
+						goto done;
+					}
+					for (num = 0; isdigit((unsigned char)ch); ch = *format++) {
+						num = 10 * num + char_to_int(ch);
+					}
+					cnk->min_star->num = num;
+					if (ch != '$') /* what ?? */
+						goto done;
+				} else {
+					cnk->min_star->num = ++pnum;
+				}
+				max_pos = add_cnk_list_entry(&clist, max_pos, cnk->min_star);
+				if (max_pos == 0) /* out of memory :-( */
+					goto done;
+				ch = *format++;
+				state = DP_S_DOT;
+			} else {
+				if (pfirst) pfirst = 0;
+				state = DP_S_DOT;
+			}
+			break;
+		case DP_S_DOT:
+			if (ch == '.') {
+				state = DP_S_MAX;
+				ch = *format++;
+			} else { 
+				state = DP_S_MOD;
+			}
+			break;
+		case DP_S_MAX:
+			if (isdigit((unsigned char)ch)) {
+				if (cnk->max < 0)
+					cnk->max = 0;
+				cnk->max = 10 * cnk->max + char_to_int (ch);
+				ch = *format++;
+			} else if (ch == '$') {
+				if (!pfirst && !pflag) {
+					/* parameters must be all positioned or none */
+					goto done;
+				}
+				if (cnk->max <= 0) /* what ?? */
+					goto done;
+				cnk->num = cnk->max;
+				cnk->max = -1;
+				ch = *format++;
+			} else if (ch == '*') {
+				cnk->max_star = new_chunk();
+				if (!cnk->max_star) /* out of memory :-( */
+					goto done;
+				cnk->max_star->type = CNK_INT;
+				if (pflag) {
+					int num;
+					ch = *format++;
+					if (!isdigit((unsigned char)ch)) {
+						/* parameters must be all positioned or none */
+						goto done;
+					}
+					for (num = 0; isdigit((unsigned char)ch); ch = *format++) {
+						num = 10 * num + char_to_int(ch);
+					}
+					cnk->max_star->num = num;
+					if (ch != '$') /* what ?? */
+						goto done;
+				} else {
+					cnk->max_star->num = ++pnum;
+				}
+				max_pos = add_cnk_list_entry(&clist, max_pos, cnk->max_star);
+				if (max_pos == 0) /* out of memory :-( */
+					goto done;
+
+				ch = *format++;
+				state = DP_S_MOD;
+			} else {
+				state = DP_S_MOD;
+			}
+			break;
+		case DP_S_MOD:
+			switch (ch) {
+			case 'h':
+				cnk->cflags = DP_C_SHORT;
+				ch = *format++;
+				if (ch == 'h') {
+					cnk->cflags = DP_C_CHAR;
+					ch = *format++;
+				}
+				break;
+			case 'l':
+				cnk->cflags = DP_C_LONG;
+				ch = *format++;
+				if (ch == 'l') {	/* It's a long long */
+					cnk->cflags = DP_C_LLONG;
+					ch = *format++;
+				}
+				break;
+			case 'L':
+				cnk->cflags = DP_C_LDOUBLE;
+				ch = *format++;
+				break;
+			case 'z':
+				cnk->cflags = DP_C_SIZET;
+				ch = *format++;
+				break;
+			default:
+				break;
+			}
+			state = DP_S_CONV;
+			break;
+		case DP_S_CONV:
+			if (cnk->num == 0) cnk->num = ++pnum;
+			max_pos = add_cnk_list_entry(&clist, max_pos, cnk);
+			if (max_pos == 0) /* out of memory :-( */
+				goto done;
+			
+			switch (ch) {
+			case 'd':
+			case 'i':
+				cnk->type = CNK_INT;
+				break;
+			case 'o':
+				cnk->type = CNK_OCTAL;
+				cnk->flags |= DP_F_UNSIGNED;
+				break;
+			case 'u':
+				cnk->type = CNK_UINT;
+				cnk->flags |= DP_F_UNSIGNED;
+				break;
+			case 'X':
+				cnk->flags |= DP_F_UP;
+			case 'x':
+				cnk->type = CNK_HEX;
+				cnk->flags |= DP_F_UNSIGNED;
+				break;
+			case 'A':
+				/* hex float not supported yet */
+			case 'E':
+			case 'G':
+			case 'F':
+				cnk->flags |= DP_F_UP;
+			case 'a':
+				/* hex float not supported yet */
+			case 'e':
+			case 'f':
+			case 'g':
+				cnk->type = CNK_FLOAT;
+				break;
+			case 'c':
+				cnk->type = CNK_CHAR;
+				break;
+			case 's':
+				cnk->type = CNK_STRING;
+				break;
+			case 'p':
+				cnk->type = CNK_PTR;
+				cnk->flags |= DP_F_UNSIGNED;
+				break;
+			case 'n':
+				cnk->type = CNK_NUM;
+				break;
+			case '%':
+				cnk->type = CNK_PRCNT;
+				break;
+			default:
+				/* Unknown, bail out*/
+				goto done;
+			}
+			ch = *format++;
+			state = DP_S_DEFAULT;
+			break;
+		case DP_S_DONE:
+			break;
+		default:
+			/* hmm? */
+			break; /* some picky compilers need this */
+		}
+	}
+
+	/* retrieve the format arguments */
+	for (pnum = 0; pnum < max_pos; pnum++) {
+		int i;
+
+		if (clist[pnum].num == 0) {
+			/* ignoring a parameter should not be permitted
+			 * all parameters must be matched at least once
+			 * BUT seem some system ignore this rule ...
+			 * at least my glibc based system does --SSS
+			 */
+#ifdef DEBUG_SNPRINTF
+			printf("parameter at position %d not used\n", pnum+1);
+#endif
+			/* eat the parameter */
+			va_arg (args, int);
+			continue;
+		}
+		for (i = 1; i < clist[pnum].num; i++) {
+			if (clist[pnum].chunks[0]->type != clist[pnum].chunks[i]->type) {
+				/* nooo noo no!
+				 * all the references to a parameter
+				 * must be of the same type
+				 */
+				goto done;
+			}
+		}
+		cnk = clist[pnum].chunks[0];
+		switch (cnk->type) {
+		case CNK_INT:
+			if (cnk->cflags == DP_C_SHORT) 
+				cnk->value = va_arg (args, int);
+			else if (cnk->cflags == DP_C_LONG)
+				cnk->value = va_arg (args, long int);
+			else if (cnk->cflags == DP_C_LLONG)
+				cnk->value = va_arg (args, LLONG);
+			else if (cnk->cflags == DP_C_SIZET)
+				cnk->value = va_arg (args, ssize_t);
+			else
+				cnk->value = va_arg (args, int);
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->value = cnk->value;
+			}
+			break;
+
+		case CNK_OCTAL:
+		case CNK_UINT:
+		case CNK_HEX:
+			if (cnk->cflags == DP_C_SHORT)
+				cnk->value = va_arg (args, unsigned int);
+			else if (cnk->cflags == DP_C_LONG)
+				cnk->value = (unsigned long int)va_arg (args, unsigned long int);
+			else if (cnk->cflags == DP_C_LLONG)
+				cnk->value = (LLONG)va_arg (args, unsigned LLONG);
+			else if (cnk->cflags == DP_C_SIZET)
+				cnk->value = (size_t)va_arg (args, size_t);
+			else
+				cnk->value = (unsigned int)va_arg (args, unsigned int);
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->value = cnk->value;
+			}
+			break;
+
+		case CNK_FLOAT:
+			if (cnk->cflags == DP_C_LDOUBLE)
+				cnk->fvalue = va_arg (args, LDOUBLE);
+			else
+				cnk->fvalue = va_arg (args, double);
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->fvalue = cnk->fvalue;
+			}
+			break;
+
+		case CNK_CHAR:
+			cnk->value = va_arg (args, int);
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->value = cnk->value;
+			}
+			break;
+
+		case CNK_STRING:
+			cnk->strvalue = va_arg (args, char *);
+			if (!cnk->strvalue) cnk->strvalue = "(NULL)";
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->strvalue = cnk->strvalue;
+			}
+			break;
+
+		case CNK_PTR:
+			cnk->strvalue = va_arg (args, void *);
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->strvalue = cnk->strvalue;
+			}
+			break;
+
+		case CNK_NUM:
+			if (cnk->cflags == DP_C_CHAR)
+				cnk->pnum = va_arg (args, char *);
+			else if (cnk->cflags == DP_C_SHORT)
+				cnk->pnum = va_arg (args, short int *);
+			else if (cnk->cflags == DP_C_LONG)
+				cnk->pnum = va_arg (args, long int *);
+			else if (cnk->cflags == DP_C_LLONG)
+				cnk->pnum = va_arg (args, LLONG *);
+			else if (cnk->cflags == DP_C_SIZET)
+				cnk->pnum = va_arg (args, ssize_t *);
+			else
+				cnk->pnum = va_arg (args, int *);
+
+			for (i = 1; i < clist[pnum].num; i++) {
+				clist[pnum].chunks[i]->pnum = cnk->pnum;
+			}
+			break;
+
+		case CNK_PRCNT:
+			break;
+
+		default:
+			/* what ?? */
+			goto done;
+		}
+	}
+	/* print out the actual string from chunks */
+	currlen = 0;
+	cnk = chunks;
+	while (cnk) {
+		int len, min, max;
+
+		if (cnk->min_star) min = cnk->min_star->value;
+		else min = cnk->min;
+		if (cnk->max_star) max = cnk->max_star->value;
+		else max = cnk->max;
+
+		switch (cnk->type) {
+
+		case CNK_FMT_STR:
+			if (maxlen != 0 && maxlen > currlen) {
+				if (maxlen > (currlen + cnk->len)) len = cnk->len;
+				else len = maxlen - currlen;
+
+				memcpy(&(buffer[currlen]), &(base[cnk->start]), len);
+			}
+			currlen += cnk->len;
+				
+			break;
+
+		case CNK_INT:
+		case CNK_UINT:
+			fmtint (buffer, &currlen, maxlen, cnk->value, 10, min, max, cnk->flags);
+			break;
+
+		case CNK_OCTAL:
+			fmtint (buffer, &currlen, maxlen, cnk->value, 8, min, max, cnk->flags);
+			break;
+
+		case CNK_HEX:
+			fmtint (buffer, &currlen, maxlen, cnk->value, 16, min, max, cnk->flags);
+			break;
+
+		case CNK_FLOAT:
+			fmtfp (buffer, &currlen, maxlen, cnk->fvalue, min, max, cnk->flags);
+			break;
+
+		case CNK_CHAR:
+			dopr_outch (buffer, &currlen, maxlen, cnk->value);
+			break;
+
+		case CNK_STRING:
+			if (max == -1) {
+				max = strlen(cnk->strvalue);
+			}
+			fmtstr (buffer, &currlen, maxlen, cnk->strvalue, cnk->flags, min, max);
+			break;
+
+		case CNK_PTR:
+			fmtint (buffer, &currlen, maxlen, (long)(cnk->strvalue), 16, min, max, cnk->flags);
+			break;
+
+		case CNK_NUM:
+			if (cnk->cflags == DP_C_CHAR)
+				*((char *)(cnk->pnum)) = (char)currlen;
+			else if (cnk->cflags == DP_C_SHORT)
+				*((short int *)(cnk->pnum)) = (short int)currlen;
+			else if (cnk->cflags == DP_C_LONG)
+				*((long int *)(cnk->pnum)) = (long int)currlen;
+			else if (cnk->cflags == DP_C_LLONG)
+				*((LLONG *)(cnk->pnum)) = (LLONG)currlen;
+			else if (cnk->cflags == DP_C_SIZET)
+				*((ssize_t *)(cnk->pnum)) = (ssize_t)currlen;
+			else
+				*((int *)(cnk->pnum)) = (int)currlen;
+			break;
+
+		case CNK_PRCNT:
+			dopr_outch (buffer, &currlen, maxlen, '%');
+			break;
+
+		default:
+			/* what ?? */
+			goto done;
+		}
+		cnk = cnk->next;
+	}
+	if (maxlen != 0) {
+		if (currlen < maxlen - 1) 
+			buffer[currlen] = '\0';
+		else if (maxlen > 0) 
+			buffer[maxlen - 1] = '\0';
+	}
+	ret = currlen;
+
+done:
+	va_end(args);
+
+	while (chunks) {
+		cnk = chunks->next;
+		free(chunks);
+		chunks = cnk;
+	}
+	if (clist) {
+		for (pnum = 0; pnum < max_pos; pnum++) {
+			if (clist[pnum].chunks) free(clist[pnum].chunks);
+		}
+		free(clist);
+	}
+	return ret;
+}
+
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+		    char *value, int flags, int min, int max)
+{
+	int padlen, strln;     /* amount to pad */
+	int cnt = 0;
+
+#ifdef DEBUG_SNPRINTF
+	printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value);
+#endif
+	if (value == 0) {
+		value = "<NULL>";
+	}
+
+	for (strln = 0; strln < max && value[strln]; ++strln); /* strlen */
+	padlen = min - strln;
+	if (padlen < 0) 
+		padlen = 0;
+	if (flags & DP_F_MINUS) 
+		padlen = -padlen; /* Left Justify */
+	
+	while (padlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--padlen;
+	}
+	while (*value && (cnt < max)) {
+		dopr_outch (buffer, currlen, maxlen, *value++);
+		++cnt;
+	}
+	while (padlen < 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++padlen;
+	}
+}
+
+/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
+
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+		    LLONG value, int base, int min, int max, int flags)
+{
+	int signvalue = 0;
+	unsigned LLONG uvalue;
+	char convert[20];
+	int place = 0;
+	int spadlen = 0; /* amount to space pad */
+	int zpadlen = 0; /* amount to zero pad */
+	int caps = 0;
+	
+	if (max < 0)
+		max = 0;
+	
+	uvalue = value;
+	
+	if(!(flags & DP_F_UNSIGNED)) {
+		if( value < 0 ) {
+			signvalue = '-';
+			uvalue = -value;
+		} else {
+			if (flags & DP_F_PLUS)  /* Do a sign (+/i) */
+				signvalue = '+';
+			else if (flags & DP_F_SPACE)
+				signvalue = ' ';
+		}
+	}
+  
+	if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+
+	do {
+		convert[place++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")
+			[uvalue % (unsigned)base  ];
+		uvalue = (uvalue / (unsigned)base );
+	} while(uvalue && (place < 20));
+	if (place == 20) place--;
+	convert[place] = 0;
+
+	zpadlen = max - place;
+	spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
+	if (zpadlen < 0) zpadlen = 0;
+	if (spadlen < 0) spadlen = 0;
+	if (flags & DP_F_ZERO) {
+		zpadlen = MAX(zpadlen, spadlen);
+		spadlen = 0;
+	}
+	if (flags & DP_F_MINUS) 
+		spadlen = -spadlen; /* Left Justifty */
+
+#ifdef DEBUG_SNPRINTF
+	printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
+	       zpadlen, spadlen, min, max, place);
+#endif
+
+	/* Spaces */
+	while (spadlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--spadlen;
+	}
+
+	/* Sign */
+	if (signvalue) 
+		dopr_outch (buffer, currlen, maxlen, signvalue);
+
+	/* Zeros */
+	if (zpadlen > 0) {
+		while (zpadlen > 0) {
+			dopr_outch (buffer, currlen, maxlen, '0');
+			--zpadlen;
+		}
+	}
+
+	/* Digits */
+	while (place > 0) 
+		dopr_outch (buffer, currlen, maxlen, convert[--place]);
+  
+	/* Left Justified spaces */
+	while (spadlen < 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++spadlen;
+	}
+}
+
+static LDOUBLE abs_val(LDOUBLE value)
+{
+	LDOUBLE result = value;
+
+	if (value < 0)
+		result = -value;
+	
+	return result;
+}
+
+static LDOUBLE POW10(int exp)
+{
+	LDOUBLE result = 1;
+	
+	while (exp) {
+		result *= 10;
+		exp--;
+	}
+  
+	return result;
+}
+
+static LLONG ROUND(LDOUBLE value)
+{
+	LLONG intpart;
+
+	intpart = (LLONG)value;
+	value = value - intpart;
+	if (value >= 0.5) intpart++;
+	
+	return intpart;
+}
+
+/* a replacement for modf that doesn't need the math library. Should
+   be portable, but slow */
+static double my_modf(double x0, double *iptr)
+{
+	int i;
+	LLONG l=0;
+	double x = x0;
+	double f = 1.0;
+
+	for (i=0;i<100;i++) {
+		l = (long)x;
+		if (l <= (x+1) && l >= (x-1)) break;
+		x *= 0.1;
+		f *= 10.0;
+	}
+
+	if (i == 100) {
+		/* yikes! the number is beyond what we can handle. What do we do? */
+		(*iptr) = 0;
+		return 0;
+	}
+
+	if (i != 0) {
+		double i2;
+		double ret;
+
+		ret = my_modf(x0-l*f, &i2);
+		(*iptr) = l*f + i2;
+		return ret;
+	} 
+
+	(*iptr) = l;
+	return x - (*iptr);
+}
+
+
+static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
+		   LDOUBLE fvalue, int min, int max, int flags)
+{
+	int signvalue = 0;
+	double ufvalue;
+	char iconvert[311];
+	char fconvert[311];
+	int iplace = 0;
+	int fplace = 0;
+	int padlen = 0; /* amount to pad */
+	int zpadlen = 0; 
+	int caps = 0;
+	int idx;
+	double intpart;
+	double fracpart;
+	double temp;
+  
+	/* 
+	 * AIX manpage says the default is 0, but Solaris says the default
+	 * is 6, and sprintf on AIX defaults to 6
+	 */
+	if (max < 0)
+		max = 6;
+
+	ufvalue = abs_val (fvalue);
+
+	if (fvalue < 0) {
+		signvalue = '-';
+	} else {
+		if (flags & DP_F_PLUS) { /* Do a sign (+/i) */
+			signvalue = '+';
+		} else {
+			if (flags & DP_F_SPACE)
+				signvalue = ' ';
+		}
+	}
+
+#if 0
+	if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+#endif
+
+#if 0
+	 if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */
+#endif
+
+	/* 
+	 * Sorry, we only support 9 digits past the decimal because of our 
+	 * conversion method
+	 */
+	if (max > 9)
+		max = 9;
+
+	/* We "cheat" by converting the fractional part to integer by
+	 * multiplying by a factor of 10
+	 */
+
+	temp = ufvalue;
+	my_modf(temp, &intpart);
+
+	fracpart = ROUND((POW10(max)) * (ufvalue - intpart));
+	
+	if (fracpart >= POW10(max)) {
+		intpart++;
+		fracpart -= POW10(max);
+	}
+
+
+	/* Convert integer part */
+	do {
+		temp = intpart*0.1;
+		my_modf(temp, &intpart);
+		idx = (int) ((temp -intpart +0.05)* 10.0);
+		/* idx = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
+		/* printf ("%llf, %f, %x\n", temp, intpart, idx); */
+		iconvert[iplace++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+	} while (intpart && (iplace < 311));
+	if (iplace == 311) iplace--;
+	iconvert[iplace] = 0;
+
+	/* Convert fractional part */
+	if (fracpart)
+	{
+		do {
+			temp = fracpart*0.1;
+			my_modf(temp, &fracpart);
+			idx = (int) ((temp -fracpart +0.05)* 10.0);
+			/* idx = (int) ((((temp/10) -fracpart) +0.05) *10); */
+			/* printf ("%lf, %lf, %ld\n", temp, fracpart, idx ); */
+			fconvert[fplace++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+		} while(fracpart && (fplace < 311));
+		if (fplace == 311) fplace--;
+	}
+	fconvert[fplace] = 0;
+  
+	/* -1 for decimal point, another -1 if we are printing a sign */
+	padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); 
+	zpadlen = max - fplace;
+	if (zpadlen < 0) zpadlen = 0;
+	if (padlen < 0) 
+		padlen = 0;
+	if (flags & DP_F_MINUS) 
+		padlen = -padlen; /* Left Justifty */
+	
+	if ((flags & DP_F_ZERO) && (padlen > 0)) {
+		if (signvalue) {
+			dopr_outch (buffer, currlen, maxlen, signvalue);
+			--padlen;
+			signvalue = 0;
+		}
+		while (padlen > 0) {
+			dopr_outch (buffer, currlen, maxlen, '0');
+			--padlen;
+		}
+	}
+	while (padlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--padlen;
+	}
+	if (signvalue) 
+		dopr_outch (buffer, currlen, maxlen, signvalue);
+	
+	while (iplace > 0) 
+		dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
+
+#ifdef DEBUG_SNPRINTF
+	printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen);
+#endif
+
+	/*
+	 * Decimal point.  This should probably use locale to find the correct
+	 * char to print out.
+	 */
+	if (max > 0) {
+		dopr_outch (buffer, currlen, maxlen, '.');
+		
+		while (zpadlen > 0) {
+			dopr_outch (buffer, currlen, maxlen, '0');
+			--zpadlen;
+		}
+
+		while (fplace > 0) 
+			dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
+	}
+
+	while (padlen < 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++padlen;
+	}
+}
+
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c)
+{
+	if (*currlen < maxlen) {
+		buffer[(*currlen)] = c;
+	}
+	(*currlen)++;
+}
+
+static struct pr_chunk *new_chunk(void) {
+	struct pr_chunk *new_c = (struct pr_chunk *)malloc(sizeof(struct pr_chunk));
+
+	if (!new_c)
+		return NULL;
+
+	new_c->type = 0;
+	new_c->num = 0;
+	new_c->min = 0;
+	new_c->min_star = NULL;
+	new_c->max = -1;
+	new_c->max_star = NULL;
+	new_c->flags = 0;
+	new_c->cflags = 0;
+	new_c->start = 0;
+	new_c->len = 0;
+	new_c->value = 0;
+	new_c->fvalue = 0;
+	new_c->strvalue = NULL;
+	new_c->pnum = NULL;
+	new_c->next = NULL;
+
+	return new_c;
+}
+
+static int add_cnk_list_entry(struct pr_chunk_x **list,
+				int max_num, struct pr_chunk *chunk) {
+	struct pr_chunk_x *l;
+	struct pr_chunk **c;
+	int max;
+	int cnum;
+	int i, pos;
+
+	if (chunk->num > max_num) {
+		max = chunk->num;
+	
+		if (*list == NULL) {
+			l = (struct pr_chunk_x *)malloc(sizeof(struct pr_chunk_x) * max);
+			pos = 0;
+		} else {
+			l = (struct pr_chunk_x *)realloc(*list, sizeof(struct pr_chunk_x) * max);
+			pos = max_num;
+		}
+		if (l == NULL) {
+			for (i = 0; i < max; i++) {
+				if ((*list)[i].chunks) free((*list)[i].chunks);
+			}
+			return 0;
+		}
+		for (i = pos; i < max; i++) {
+			l[i].chunks = NULL;
+			l[i].num = 0;
+		}
+	} else {
+		l = *list;
+		max = max_num;
+	}
+
+	i = chunk->num - 1;
+	cnum = l[i].num + 1;
+	if (l[i].chunks == NULL) {
+		c = (struct pr_chunk **)malloc(sizeof(struct pr_chunk *) * cnum); 
+	} else {
+		c = (struct pr_chunk **)realloc(l[i].chunks, sizeof(struct pr_chunk *) * cnum);
+	}
+	if (c == NULL) {
+		for (i = 0; i < max; i++) {
+			if (l[i].chunks) free(l[i].chunks);
+		}
+		return 0;
+	}
+	c[l[i].num] = chunk;
+	l[i].chunks = c;
+	l[i].num = cnum;
+
+	*list = l;
+	return max;
+}
+
+ int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
+{
+	return dopr(str, count, fmt, args);
+}
+#endif
+
+/* yes this really must be a ||. Don't muck with this (tridge)
+ *
+ * The logic for these two is that we need our own definition if the
+ * OS *either* has no definition of *sprintf, or if it does have one
+ * that doesn't work properly according to the autoconf test.
+ */
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+ int snprintf(char *str,size_t count,const char *fmt,...)
+{
+	size_t ret;
+	va_list ap;
+    
+	va_start(ap, fmt);
+	ret = vsnprintf(str, count, fmt, ap);
+	va_end(ap);
+	return ret;
+}
+#endif
+
+#ifndef HAVE_C99_VSNPRINTF
+ int printf(const char *fmt, ...)
+{
+	va_list ap;
+	int ret;
+	char *s;
+
+	s = NULL;
+	va_start(ap, fmt);
+	ret = vasprintf(&s, fmt, ap);
+	va_end(ap);
+
+	if (s) {
+		fwrite(s, 1, strlen(s), stdout);
+	}
+	free(s);
+
+	return ret;
+}
+#endif
+
+#ifndef HAVE_C99_VSNPRINTF
+ int fprintf(FILE *stream, const char *fmt, ...)
+{
+	va_list ap;
+	int ret;
+	char *s;
+
+	s = NULL;
+	va_start(ap, fmt);
+	ret = vasprintf(&s, fmt, ap);
+	va_end(ap);
+
+	if (s) {
+		fwrite(s, 1, strlen(s), stream);
+	}
+	free(s);
+
+	return ret;
+}
+#endif
+
+#endif 
+
+#ifndef HAVE_VASPRINTF
+ int vasprintf(char **ptr, const char *format, va_list ap)
+{
+	int ret;
+	va_list ap2;
+
+	VA_COPY(ap2, ap);
+	ret = vsnprintf(NULL, 0, format, ap2);
+	va_end(ap2);
+	if (ret < 0) return ret;
+
+	(*ptr) = (char *)malloc(ret+1);
+	if (!*ptr) return -1;
+
+	VA_COPY(ap2, ap);
+	ret = vsnprintf(*ptr, ret+1, format, ap2);
+	va_end(ap2);
+
+	return ret;
+}
+#endif
+
+
+#ifndef HAVE_ASPRINTF
+ int asprintf(char **ptr, const char *format, ...)
+{
+	va_list ap;
+	int ret;
+	
+	*ptr = NULL;
+	va_start(ap, format);
+	ret = vasprintf(ptr, format, ap);
+	va_end(ap);
+
+	return ret;
+}
+#endif
+
+#ifdef TEST_SNPRINTF
+
+ int sprintf(char *str,const char *fmt,...);
+ int printf(const char *fmt,...);
+
+ int main (void)
+{
+	char buf1[1024];
+	char buf2[1024];
+	char *buf3;
+	char *fp_fmt[] = {
+		"%1.1f",
+		"%-1.5f",
+		"%1.5f",
+		"%123.9f",
+		"%10.5f",
+		"% 10.5f",
+		"%+22.9f",
+		"%+4.9f",
+		"%01.3f",
+		"%4f",
+		"%3.1f",
+		"%3.2f",
+		"%.0f",
+		"%f",
+		"%-8.8f",
+		"%-9.9f",
+		NULL
+	};
+	double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 203.9, 0.96, 0.996, 
+			     0.9996, 1.996, 4.136, 5.030201, 0.00205,
+			     /* END LIST */ 0};
+	char *int_fmt[] = {
+		"%-1.5d",
+		"%1.5d",
+		"%123.9d",
+		"%5.5d",
+		"%10.5d",
+		"% 10.5d",
+		"%+22.33d",
+		"%01.3d",
+		"%4d",
+		"%d",
+		NULL
+	};
+	long int_nums[] = { -1, 134, 91340, 341, 0203, 1234567890, 0};
+	char *str_fmt[] = {
+		"%10.5s",
+		"%-10.5s",
+		"%5.10s",
+		"%-5.10s",
+		"%10.1s",
+		"%0.10s",
+		"%10.0s",
+		"%1.10s",
+		"%s",
+		"%.1s",
+		"%.10s",
+		"%10s",
+		NULL
+	};
+	char *str_vals[] = {"hello", "a", "", "a longer string", NULL};
+#ifdef HAVE_LONG_LONG
+	char *ll_fmt[] = {
+		"%llu",
+		NULL
+	};
+	LLONG ll_nums[] = { 134, 91340, 341, 0203, 1234567890, 128006186140000000LL, 0};
+#endif
+	int x, y;
+	int fail = 0;
+	int num = 0;
+	int l1, l2;
+	char *ss_fmt[] = {
+		"%zd",
+		"%zu",
+		NULL
+	};
+	size_t ss_nums[] = {134, 91340, 123456789, 0203, 1234567890, 0};
+
+	printf ("Testing snprintf format codes against system sprintf...\n");
+
+	for (x = 0; fp_fmt[x] ; x++) {
+		for (y = 0; fp_nums[y] != 0 ; y++) {
+			buf1[0] = buf2[0] = '\0';
+			l1 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]);
+			l2 = sprintf (buf2, fp_fmt[x], fp_nums[y]);
+			buf1[1023] = buf2[1023] = '\0';
+			if (strcmp (buf1, buf2) || (l1 != l2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n", 
+				       fp_fmt[x], l1, buf1, l2, buf2);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+	for (x = 0; int_fmt[x] ; x++) {
+		for (y = 0; int_nums[y] != 0 ; y++) {
+			buf1[0] = buf2[0] = '\0';
+			l1 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]);
+			l2 = sprintf (buf2, int_fmt[x], int_nums[y]);
+			buf1[1023] = buf2[1023] = '\0';
+			if (strcmp (buf1, buf2) || (l1 != l2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n", 
+				       int_fmt[x], l1, buf1, l2, buf2);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+	for (x = 0; str_fmt[x] ; x++) {
+		for (y = 0; str_vals[y] != 0 ; y++) {
+			buf1[0] = buf2[0] = '\0';
+			l1 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]);
+			l2 = sprintf (buf2, str_fmt[x], str_vals[y]);
+			buf1[1023] = buf2[1023] = '\0';
+			if (strcmp (buf1, buf2) || (l1 != l2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n", 
+				       str_fmt[x], l1, buf1, l2, buf2);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+#ifdef HAVE_LONG_LONG
+	for (x = 0; ll_fmt[x] ; x++) {
+		for (y = 0; ll_nums[y] != 0 ; y++) {
+			buf1[0] = buf2[0] = '\0';
+			l1 = snprintf(buf1, sizeof(buf1), ll_fmt[x], ll_nums[y]);
+			l2 = sprintf (buf2, ll_fmt[x], ll_nums[y]);
+			buf1[1023] = buf2[1023] = '\0';
+			if (strcmp (buf1, buf2) || (l1 != l2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n", 
+				       ll_fmt[x], l1, buf1, l2, buf2);
+				fail++;
+			}
+			num++;
+		}
+	}
+#endif
+
+#define BUFSZ 2048
+
+	buf1[0] = buf2[0] = '\0';
+	if ((buf3 = malloc(BUFSZ)) == NULL) {
+		fail++;
+	} else {
+		num++;
+		memset(buf3, 'a', BUFSZ);
+		snprintf(buf1, sizeof(buf1), "%.*s", 1, buf3);
+		buf1[1023] = '\0';
+		if (strcmp(buf1, "a") != 0) {
+			printf("length limit buf1 '%s' expected 'a'\n", buf1);
+			fail++;
+		}
+        }
+
+	buf1[0] = buf2[0] = '\0';
+	l1 = snprintf(buf1, sizeof(buf1), "%4$*1$d %2$s %3$*1$.*1$f", 3, "pos test", 12.3456, 9);
+	l2 = sprintf(buf2, "%4$*1$d %2$s %3$*1$.*1$f", 3, "pos test", 12.3456, 9);
+	buf1[1023] = buf2[1023] = '\0';
+	if (strcmp(buf1, buf2) || (l1 != l2)) {
+		printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n",
+				"%4$*1$d %2$s %3$*1$.*1$f", l1, buf1, l2, buf2);
+		fail++;
+	}
+
+	buf1[0] = buf2[0] = '\0';
+	l1 = snprintf(buf1, sizeof(buf1), "%4$*4$d %2$s %3$*4$.*4$f", 3, "pos test", 12.3456, 9);
+	l2 = sprintf(buf2, "%4$*4$d %2$s %3$*4$.*4$f", 3, "pos test", 12.3456, 9);
+	buf1[1023] = buf2[1023] = '\0';
+	if (strcmp(buf1, buf2)) {
+		printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n",
+				"%4$*1$d %2$s %3$*1$.*1$f", l1, buf1, l2, buf2);
+		fail++;
+	}
+
+	for (x = 0; ss_fmt[x] ; x++) {
+		for (y = 0; ss_nums[y] != 0 ; y++) {
+			buf1[0] = buf2[0] = '\0';
+			l1 = snprintf(buf1, sizeof(buf1), ss_fmt[x], ss_nums[y]);
+			l2 = sprintf (buf2, ss_fmt[x], ss_nums[y]);
+			buf1[1023] = buf2[1023] = '\0';
+			if (strcmp (buf1, buf2) || (l1 != l2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n", 
+				       ss_fmt[x], l1, buf1, l2, buf2);
+				fail++;
+			}
+			num++;
+		}
+	}
+#if 0
+	buf1[0] = buf2[0] = '\0';
+	l1 = snprintf(buf1, sizeof(buf1), "%lld", (LLONG)1234567890);
+	l2 = sprintf(buf2, "%lld", (LLONG)1234567890);
+	buf1[1023] = buf2[1023] = '\0';
+	if (strcmp(buf1, buf2)) {
+		printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n",
+				"%lld", l1, buf1, l2, buf2);
+		fail++;
+	}
+
+	buf1[0] = buf2[0] = '\0';
+	l1 = snprintf(buf1, sizeof(buf1), "%Lf", (LDOUBLE)890.1234567890123);
+	l2 = sprintf(buf2, "%Lf", (LDOUBLE)890.1234567890123);
+	buf1[1023] = buf2[1023] = '\0';
+	if (strcmp(buf1, buf2)) {
+		printf("snprintf doesn't match Format: %s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n",
+				"%Lf", l1, buf1, l2, buf2);
+		fail++;
+	}
+#endif
+	printf ("%d tests failed out of %d.\n", fail, num);
+
+	printf("seeing how many digits we support\n");
+	{
+		double v0 = 0.12345678901234567890123456789012345678901;
+		for (x=0; x<100; x++) {
+			double p = pow(10, x); 
+			double r = v0*p;
+			snprintf(buf1, sizeof(buf1), "%1.1f", r);
+			sprintf(buf2,                "%1.1f", r);
+			if (strcmp(buf1, buf2)) {
+				printf("we seem to support %d digits\n", x-1);
+				break;
+			}
+		}
+	}
+
+	return 0;
+}
+#endif /* TEST_SNPRINTF */

Added: branches/talloc/experimental/lib/replace/socket.c
===================================================================
--- branches/talloc/experimental/lib/replace/socket.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/socket.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,35 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * Dummy replacements for socket functions.
+ *
+ * Copyright (C) Michael Adam <obnox at samba.org> 2008
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+int rep_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+struct hostent *rep_gethostbyname(const char *name)
+{
+	errno = ENOSYS;
+	return NULL;
+}

Added: branches/talloc/experimental/lib/replace/socketpair.c
===================================================================
--- branches/talloc/experimental/lib/replace/socketpair.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/socketpair.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,46 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * replacement routines for broken systems
+ * Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2006
+ * Copyright (C) Michael Adam <obnox at samba.org> 2008
+ *
+ *  ** NOTE! The following LGPL license applies to the replace
+ *  ** library. This does NOT imply that all of Samba is released
+ *  ** under the LGPL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+int rep_socketpair(int d, int type, int protocol, int sv[2])
+{
+	if (d != AF_UNIX) {
+		errno = EAFNOSUPPORT;
+		return -1;
+	}
+
+	if (protocol != 0) {
+		errno = EPROTONOSUPPORT;
+		return -1;
+	}
+
+	if (type != SOCK_STREAM) {
+		errno = EOPNOTSUPP;
+		return -1;
+	}
+
+	return pipe(sv);
+}

Added: branches/talloc/experimental/lib/replace/strptime.c
===================================================================
--- branches/talloc/experimental/lib/replace/strptime.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/strptime.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,990 @@
+/* Convert a string representation of time to a time value.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 3 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not, 
+   see <http://www.gnu.org/licenses/>.  */
+
+/* XXX This version of the implementation is not really complete.
+   Some of the fields cannot add information alone.  But if seeing
+   some of them in the same format (such as year, week and weekday)
+   this is enough information for determining the date.  */
+
+#include "replace.h"
+#include "system/locale.h"
+#include "system/time.h"
+
+#ifndef __P
+# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
+#  define __P(args) args
+# else
+#  define __P(args) ()
+# endif  /* GCC.  */
+#endif  /* Not __P.  */
+
+#if ! HAVE_LOCALTIME_R && ! defined localtime_r
+# ifdef _LIBC
+#  define localtime_r __localtime_r
+# else
+/* Approximate localtime_r as best we can in its absence.  */
+#  define localtime_r my_localtime_r
+static struct tm *localtime_r __P ((const time_t *, struct tm *));
+static struct tm *
+localtime_r (t, tp)
+     const time_t *t;
+     struct tm *tp;
+{
+  struct tm *l = localtime (t);
+  if (! l)
+    return 0;
+  *tp = *l;
+  return tp;
+}
+# endif /* ! _LIBC */
+#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
+
+
+#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
+#if defined __GNUC__ && __GNUC__ >= 2
+# define match_string(cs1, s2) \
+  ({ size_t len = strlen (cs1);						      \
+     int result = strncasecmp ((cs1), (s2), len) == 0;			      \
+     if (result) (s2) += len;						      \
+     result; })
+#else
+/* Oh come on.  Get a reasonable compiler.  */
+# define match_string(cs1, s2) \
+  (strncasecmp ((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1))
+#endif
+/* We intentionally do not use isdigit() for testing because this will
+   lead to problems with the wide character version.  */
+#define get_number(from, to, n) \
+  do {									      \
+    int __n = n;							      \
+    val = 0;								      \
+    while (*rp == ' ')							      \
+      ++rp;								      \
+    if (*rp < '0' || *rp > '9')						      \
+      return NULL;							      \
+    do {								      \
+      val *= 10;							      \
+      val += *rp++ - '0';						      \
+    } while (--__n > 0 && val * 10 <= to && *rp >= '0' && *rp <= '9');	      \
+    if (val < from || val > to)						      \
+      return NULL;							      \
+  } while (0)
+#ifdef _NL_CURRENT
+# define get_alt_number(from, to, n) \
+  ({									      \
+    __label__ do_normal;						      \
+    if (*decided != raw)						      \
+      {									      \
+	const char *alts = _NL_CURRENT (LC_TIME, ALT_DIGITS);		      \
+	int __n = n;							      \
+	int any = 0;							      \
+	while (*rp == ' ')						      \
+	  ++rp;								      \
+	val = 0;							      \
+	do {								      \
+	  val *= 10;							      \
+	  while (*alts != '\0')						      \
+	    {								      \
+	      size_t len = strlen (alts);				      \
+	      if (strncasecmp (alts, rp, len) == 0)			      \
+	        break;							      \
+	      alts += len + 1;						      \
+	      ++val;							      \
+	    }								      \
+	  if (*alts == '\0')						      \
+	    {								      \
+	      if (*decided == not && ! any)				      \
+		goto do_normal;						      \
+	      /* If we haven't read anything it's an error.  */		      \
+	      if (! any)						      \
+		return NULL;						      \
+	      /* Correct the premature multiplication.  */		      \
+	      val /= 10;						      \
+	      break;							      \
+	    }								      \
+	  else								      \
+	    *decided = loc;						      \
+	} while (--__n > 0 && val * 10 <= to);				      \
+	if (val < from || val > to)					      \
+	  return NULL;							      \
+      }									      \
+    else								      \
+      {									      \
+       do_normal:							      \
+        get_number (from, to, n);					      \
+      }									      \
+    0;									      \
+  })
+#else
+# define get_alt_number(from, to, n) \
+  /* We don't have the alternate representation.  */			      \
+  get_number(from, to, n)
+#endif
+#define recursive(new_fmt) \
+  (*(new_fmt) != '\0'							      \
+   && (rp = strptime_internal (rp, (new_fmt), tm, decided, era_cnt)) != NULL)
+
+
+#ifdef _LIBC
+/* This is defined in locale/C-time.c in the GNU libc.  */
+extern const struct locale_data _nl_C_LC_TIME;
+extern const unsigned short int __mon_yday[2][13];
+
+# define weekday_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (DAY_1)].string)
+# define ab_weekday_name \
+  (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string)
+# define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string)
+# define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string)
+# define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string)
+# define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string)
+# define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string)
+# define HERE_PM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (PM_STR)].string)
+# define HERE_T_FMT_AMPM \
+  (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT_AMPM)].string)
+# define HERE_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT)].string)
+
+# define strncasecmp(s1, s2, n) __strncasecmp (s1, s2, n)
+#else
+static char const weekday_name[][10] =
+  {
+    "Sunday", "Monday", "Tuesday", "Wednesday",
+    "Thursday", "Friday", "Saturday"
+  };
+static char const ab_weekday_name[][4] =
+  {
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+  };
+static char const month_name[][10] =
+  {
+    "January", "February", "March", "April", "May", "June",
+    "July", "August", "September", "October", "November", "December"
+  };
+static char const ab_month_name[][4] =
+  {
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+  };
+# define HERE_D_T_FMT "%a %b %e %H:%M:%S %Y"
+# define HERE_D_FMT "%m/%d/%y"
+# define HERE_AM_STR "AM"
+# define HERE_PM_STR "PM"
+# define HERE_T_FMT_AMPM "%I:%M:%S %p"
+# define HERE_T_FMT "%H:%M:%S"
+
+static const unsigned short int __mon_yday[2][13] =
+  {
+    /* Normal years.  */
+    { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
+    /* Leap years.  */
+    { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
+  };
+#endif
+
+/* Status of lookup: do we use the locale data or the raw data?  */
+enum locale_status { not, loc, raw };
+
+
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+   except every 100th isn't, and every 400th is).  */
+# define __isleap(year)	\
+  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+/* Compute the day of the week.  */
+static void
+day_of_the_week (struct tm *tm)
+{
+  /* We know that January 1st 1970 was a Thursday (= 4).  Compute the
+     the difference between this data in the one on TM and so determine
+     the weekday.  */
+  int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);
+  int wday = (-473
+	      + (365 * (tm->tm_year - 70))
+	      + (corr_year / 4)
+	      - ((corr_year / 4) / 25) + ((corr_year / 4) % 25 < 0)
+	      + (((corr_year / 4) / 25) / 4)
+	      + __mon_yday[0][tm->tm_mon]
+	      + tm->tm_mday - 1);
+  tm->tm_wday = ((wday % 7) + 7) % 7;
+}
+
+/* Compute the day of the year.  */
+static void
+day_of_the_year (struct tm *tm)
+{
+  tm->tm_yday = (__mon_yday[__isleap (1900 + tm->tm_year)][tm->tm_mon]
+		 + (tm->tm_mday - 1));
+}
+
+static char *
+#ifdef _LIBC
+internal_function
+#endif
+strptime_internal __P ((const char *rp, const char *fmt, struct tm *tm,
+			enum locale_status *decided, int era_cnt));
+
+static char *
+#ifdef _LIBC
+internal_function
+#endif
+strptime_internal (rp, fmt, tm, decided, era_cnt)
+     const char *rp;
+     const char *fmt;
+     struct tm *tm;
+     enum locale_status *decided;
+     int era_cnt;
+{
+  const char *rp_backup;
+  int cnt;
+  size_t val;
+  int have_I, is_pm;
+  int century, want_century;
+  int want_era;
+  int have_wday, want_xday;
+  int have_yday;
+  int have_mon, have_mday;
+#ifdef _NL_CURRENT
+  size_t num_eras;
+#endif
+  struct era_entry *era;
+
+  have_I = is_pm = 0;
+  century = -1;
+  want_century = 0;
+  want_era = 0;
+  era = NULL;
+
+  have_wday = want_xday = have_yday = have_mon = have_mday = 0;
+
+  while (*fmt != '\0')
+    {
+      /* A white space in the format string matches 0 more or white
+	 space in the input string.  */
+      if (isspace (*fmt))
+	{
+	  while (isspace (*rp))
+	    ++rp;
+	  ++fmt;
+	  continue;
+	}
+
+      /* Any character but `%' must be matched by the same character
+	 in the iput string.  */
+      if (*fmt != '%')
+	{
+	  match_char (*fmt++, *rp++);
+	  continue;
+	}
+
+      ++fmt;
+#ifndef _NL_CURRENT
+      /* We need this for handling the `E' modifier.  */
+    start_over:
+#endif
+
+      /* Make back up of current processing pointer.  */
+      rp_backup = rp;
+
+      switch (*fmt++)
+	{
+	case '%':
+	  /* Match the `%' character itself.  */
+	  match_char ('%', *rp++);
+	  break;
+	case 'a':
+	case 'A':
+	  /* Match day of week.  */
+	  for (cnt = 0; cnt < 7; ++cnt)
+	    {
+#ifdef _NL_CURRENT
+	      if (*decided !=raw)
+		{
+		  if (match_string (_NL_CURRENT (LC_TIME, DAY_1 + cnt), rp))
+		    {
+		      if (*decided == not
+			  && strcmp (_NL_CURRENT (LC_TIME, DAY_1 + cnt),
+				     weekday_name[cnt]))
+			*decided = loc;
+		      break;
+		    }
+		  if (match_string (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt), rp))
+		    {
+		      if (*decided == not
+			  && strcmp (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt),
+				     ab_weekday_name[cnt]))
+			*decided = loc;
+		      break;
+		    }
+		}
+#endif
+	      if (*decided != loc
+		  && (match_string (weekday_name[cnt], rp)
+		      || match_string (ab_weekday_name[cnt], rp)))
+		{
+		  *decided = raw;
+		  break;
+		}
+	    }
+	  if (cnt == 7)
+	    /* Does not match a weekday name.  */
+	    return NULL;
+	  tm->tm_wday = cnt;
+	  have_wday = 1;
+	  break;
+	case 'b':
+	case 'B':
+	case 'h':
+	  /* Match month name.  */
+	  for (cnt = 0; cnt < 12; ++cnt)
+	    {
+#ifdef _NL_CURRENT
+	      if (*decided !=raw)
+		{
+		  if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), rp))
+		    {
+		      if (*decided == not
+			  && strcmp (_NL_CURRENT (LC_TIME, MON_1 + cnt),
+				     month_name[cnt]))
+			*decided = loc;
+		      break;
+		    }
+		  if (match_string (_NL_CURRENT (LC_TIME, ABMON_1 + cnt), rp))
+		    {
+		      if (*decided == not
+			  && strcmp (_NL_CURRENT (LC_TIME, ABMON_1 + cnt),
+				     ab_month_name[cnt]))
+			*decided = loc;
+		      break;
+		    }
+		}
+#endif
+	      if (match_string (month_name[cnt], rp)
+		  || match_string (ab_month_name[cnt], rp))
+		{
+		  *decided = raw;
+		  break;
+		}
+	    }
+	  if (cnt == 12)
+	    /* Does not match a month name.  */
+	    return NULL;
+	  tm->tm_mon = cnt;
+	  want_xday = 1;
+	  break;
+	case 'c':
+	  /* Match locale's date and time format.  */
+#ifdef _NL_CURRENT
+	  if (*decided != raw)
+	    {
+	      if (!recursive (_NL_CURRENT (LC_TIME, D_T_FMT)))
+		{
+		  if (*decided == loc)
+		    return NULL;
+		  else
+		    rp = rp_backup;
+		}
+	      else
+		{
+		  if (*decided == not &&
+		      strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT))
+		    *decided = loc;
+		  want_xday = 1;
+		  break;
+		}
+	      *decided = raw;
+	    }
+#endif
+	  if (!recursive (HERE_D_T_FMT))
+	    return NULL;
+	  want_xday = 1;
+	  break;
+	case 'C':
+	  /* Match century number.  */
+#ifdef _NL_CURRENT
+	match_century:
+#endif
+	  get_number (0, 99, 2);
+	  century = val;
+	  want_xday = 1;
+	  break;
+	case 'd':
+	case 'e':
+	  /* Match day of month.  */
+	  get_number (1, 31, 2);
+	  tm->tm_mday = val;
+	  have_mday = 1;
+	  want_xday = 1;
+	  break;
+	case 'F':
+	  if (!recursive ("%Y-%m-%d"))
+	    return NULL;
+	  want_xday = 1;
+	  break;
+	case 'x':
+#ifdef _NL_CURRENT
+	  if (*decided != raw)
+	    {
+	      if (!recursive (_NL_CURRENT (LC_TIME, D_FMT)))
+		{
+		  if (*decided == loc)
+		    return NULL;
+		  else
+		    rp = rp_backup;
+		}
+	      else
+		{
+		  if (*decided == not
+		      && strcmp (_NL_CURRENT (LC_TIME, D_FMT), HERE_D_FMT))
+		    *decided = loc;
+		  want_xday = 1;
+		  break;
+		}
+	      *decided = raw;
+	    }
+#endif
+	  /* Fall through.  */
+	case 'D':
+	  /* Match standard day format.  */
+	  if (!recursive (HERE_D_FMT))
+	    return NULL;
+	  want_xday = 1;
+	  break;
+	case 'k':
+	case 'H':
+	  /* Match hour in 24-hour clock.  */
+	  get_number (0, 23, 2);
+	  tm->tm_hour = val;
+	  have_I = 0;
+	  break;
+	case 'I':
+	  /* Match hour in 12-hour clock.  */
+	  get_number (1, 12, 2);
+	  tm->tm_hour = val % 12;
+	  have_I = 1;
+	  break;
+	case 'j':
+	  /* Match day number of year.  */
+	  get_number (1, 366, 3);
+	  tm->tm_yday = val - 1;
+	  have_yday = 1;
+	  break;
+	case 'm':
+	  /* Match number of month.  */
+	  get_number (1, 12, 2);
+	  tm->tm_mon = val - 1;
+	  have_mon = 1;
+	  want_xday = 1;
+	  break;
+	case 'M':
+	  /* Match minute.  */
+	  get_number (0, 59, 2);
+	  tm->tm_min = val;
+	  break;
+	case 'n':
+	case 't':
+	  /* Match any white space.  */
+	  while (isspace (*rp))
+	    ++rp;
+	  break;
+	case 'p':
+	  /* Match locale's equivalent of AM/PM.  */
+#ifdef _NL_CURRENT
+	  if (*decided != raw)
+	    {
+	      if (match_string (_NL_CURRENT (LC_TIME, AM_STR), rp))
+		{
+		  if (strcmp (_NL_CURRENT (LC_TIME, AM_STR), HERE_AM_STR))
+		    *decided = loc;
+		  break;
+		}
+	      if (match_string (_NL_CURRENT (LC_TIME, PM_STR), rp))
+		{
+		  if (strcmp (_NL_CURRENT (LC_TIME, PM_STR), HERE_PM_STR))
+		    *decided = loc;
+		  is_pm = 1;
+		  break;
+		}
+	      *decided = raw;
+	    }
+#endif
+	  if (!match_string (HERE_AM_STR, rp)) {
+	    if (match_string (HERE_PM_STR, rp)) {
+	      is_pm = 1;
+	    } else {
+	      return NULL;
+	    }
+	  }
+	  break;
+	case 'r':
+#ifdef _NL_CURRENT
+	  if (*decided != raw)
+	    {
+	      if (!recursive (_NL_CURRENT (LC_TIME, T_FMT_AMPM)))
+		{
+		  if (*decided == loc)
+		    return NULL;
+		  else
+		    rp = rp_backup;
+		}
+	      else
+		{
+		  if (*decided == not &&
+		      strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM),
+			      HERE_T_FMT_AMPM))
+		    *decided = loc;
+		  break;
+		}
+	      *decided = raw;
+	    }
+#endif
+	  if (!recursive (HERE_T_FMT_AMPM))
+	    return NULL;
+	  break;
+	case 'R':
+	  if (!recursive ("%H:%M"))
+	    return NULL;
+	  break;
+	case 's':
+	  {
+	    /* The number of seconds may be very high so we cannot use
+	       the `get_number' macro.  Instead read the number
+	       character for character and construct the result while
+	       doing this.  */
+	    time_t secs = 0;
+	    if (*rp < '0' || *rp > '9')
+	      /* We need at least one digit.  */
+	      return NULL;
+
+	    do
+	      {
+		secs *= 10;
+		secs += *rp++ - '0';
+	      }
+	    while (*rp >= '0' && *rp <= '9');
+
+	    if (localtime_r (&secs, tm) == NULL)
+	      /* Error in function.  */
+	      return NULL;
+	  }
+	  break;
+	case 'S':
+	  get_number (0, 61, 2);
+	  tm->tm_sec = val;
+	  break;
+	case 'X':
+#ifdef _NL_CURRENT
+	  if (*decided != raw)
+	    {
+	      if (!recursive (_NL_CURRENT (LC_TIME, T_FMT)))
+		{
+		  if (*decided == loc)
+		    return NULL;
+		  else
+		    rp = rp_backup;
+		}
+	      else
+		{
+		  if (strcmp (_NL_CURRENT (LC_TIME, T_FMT), HERE_T_FMT))
+		    *decided = loc;
+		  break;
+		}
+	      *decided = raw;
+	    }
+#endif
+	  /* Fall through.  */
+	case 'T':
+	  if (!recursive (HERE_T_FMT))
+	    return NULL;
+	  break;
+	case 'u':
+	  get_number (1, 7, 1);
+	  tm->tm_wday = val % 7;
+	  have_wday = 1;
+	  break;
+	case 'g':
+	  get_number (0, 99, 2);
+	  /* XXX This cannot determine any field in TM.  */
+	  break;
+	case 'G':
+	  if (*rp < '0' || *rp > '9')
+	    return NULL;
+	  /* XXX Ignore the number since we would need some more
+	     information to compute a real date.  */
+	  do
+	    ++rp;
+	  while (*rp >= '0' && *rp <= '9');
+	  break;
+	case 'U':
+	case 'V':
+	case 'W':
+	  get_number (0, 53, 2);
+	  /* XXX This cannot determine any field in TM without some
+	     information.  */
+	  break;
+	case 'w':
+	  /* Match number of weekday.  */
+	  get_number (0, 6, 1);
+	  tm->tm_wday = val;
+	  have_wday = 1;
+	  break;
+	case 'y':
+#ifdef _NL_CURRENT
+	match_year_in_century:
+#endif
+	  /* Match year within century.  */
+	  get_number (0, 99, 2);
+	  /* The "Year 2000: The Millennium Rollover" paper suggests that
+	     values in the range 69-99 refer to the twentieth century.  */
+	  tm->tm_year = val >= 69 ? val : val + 100;
+	  /* Indicate that we want to use the century, if specified.  */
+	  want_century = 1;
+	  want_xday = 1;
+	  break;
+	case 'Y':
+	  /* Match year including century number.  */
+	  get_number (0, 9999, 4);
+	  tm->tm_year = val - 1900;
+	  want_century = 0;
+	  want_xday = 1;
+	  break;
+	case 'Z':
+	  /* XXX How to handle this?  */
+	  break;
+	case 'E':
+#ifdef _NL_CURRENT
+	  switch (*fmt++)
+	    {
+	    case 'c':
+	      /* Match locale's alternate date and time format.  */
+	      if (*decided != raw)
+		{
+		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
+
+		  if (*fmt == '\0')
+		    fmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+
+		  if (!recursive (fmt))
+		    {
+		      if (*decided == loc)
+			return NULL;
+		      else
+			rp = rp_backup;
+		    }
+		  else
+		    {
+		      if (strcmp (fmt, HERE_D_T_FMT))
+			*decided = loc;
+		      want_xday = 1;
+		      break;
+		    }
+		  *decided = raw;
+		}
+	      /* The C locale has no era information, so use the
+		 normal representation.  */
+	      if (!recursive (HERE_D_T_FMT))
+		return NULL;
+	      want_xday = 1;
+	      break;
+	    case 'C':
+	      if (*decided != raw)
+		{
+		  if (era_cnt >= 0)
+		    {
+		      era = _nl_select_era_entry (era_cnt);
+		      if (match_string (era->era_name, rp))
+			{
+			  *decided = loc;
+			  break;
+			}
+		      else
+			return NULL;
+		    }
+		  else
+		    {
+		      num_eras = _NL_CURRENT_WORD (LC_TIME,
+						   _NL_TIME_ERA_NUM_ENTRIES);
+		      for (era_cnt = 0; era_cnt < (int) num_eras;
+			   ++era_cnt, rp = rp_backup)
+			{
+			  era = _nl_select_era_entry (era_cnt);
+			  if (match_string (era->era_name, rp))
+			    {
+			      *decided = loc;
+			      break;
+			    }
+			}
+		      if (era_cnt == (int) num_eras)
+			{
+			  era_cnt = -1;
+			  if (*decided == loc)
+			    return NULL;
+			}
+		      else
+			break;
+		    }
+
+		  *decided = raw;
+		}
+	      /* The C locale has no era information, so use the
+		 normal representation.  */
+	      goto match_century;
+ 	    case 'y':
+	      if (*decided == raw)
+		goto match_year_in_century;
+
+	      get_number(0, 9999, 4);
+	      tm->tm_year = val;
+	      want_era = 1;
+	      want_xday = 1;
+	      break;
+	    case 'Y':
+	      if (*decided != raw)
+		{
+		  num_eras = _NL_CURRENT_WORD (LC_TIME,
+					       _NL_TIME_ERA_NUM_ENTRIES);
+		  for (era_cnt = 0; era_cnt < (int) num_eras;
+		       ++era_cnt, rp = rp_backup)
+		    {
+		      era = _nl_select_era_entry (era_cnt);
+		      if (recursive (era->era_format))
+			break;
+		    }
+		  if (era_cnt == (int) num_eras)
+		    {
+		      era_cnt = -1;
+		      if (*decided == loc)
+			return NULL;
+		      else
+			rp = rp_backup;
+		    }
+		  else
+		    {
+		      *decided = loc;
+		      era_cnt = -1;
+		      break;
+		    }
+
+		  *decided = raw;
+		}
+	      get_number (0, 9999, 4);
+	      tm->tm_year = val - 1900;
+	      want_century = 0;
+	      want_xday = 1;
+	      break;
+	    case 'x':
+	      if (*decided != raw)
+		{
+		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
+
+		  if (*fmt == '\0')
+		    fmt = _NL_CURRENT (LC_TIME, D_FMT);
+
+		  if (!recursive (fmt))
+		    {
+		      if (*decided == loc)
+			return NULL;
+		      else
+			rp = rp_backup;
+		    }
+		  else
+		    {
+		      if (strcmp (fmt, HERE_D_FMT))
+			*decided = loc;
+		      break;
+		    }
+		  *decided = raw;
+		}
+	      if (!recursive (HERE_D_FMT))
+		return NULL;
+	      break;
+	    case 'X':
+	      if (*decided != raw)
+		{
+		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
+
+		  if (*fmt == '\0')
+		    fmt = _NL_CURRENT (LC_TIME, T_FMT);
+
+		  if (!recursive (fmt))
+		    {
+		      if (*decided == loc)
+			return NULL;
+		      else
+			rp = rp_backup;
+		    }
+		  else
+		    {
+		      if (strcmp (fmt, HERE_T_FMT))
+			*decided = loc;
+		      break;
+		    }
+		  *decided = raw;
+		}
+	      if (!recursive (HERE_T_FMT))
+		return NULL;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+#else
+	  /* We have no information about the era format.  Just use
+	     the normal format.  */
+	  if (*fmt != 'c' && *fmt != 'C' && *fmt != 'y' && *fmt != 'Y'
+	      && *fmt != 'x' && *fmt != 'X')
+	    /* This is an illegal format.  */
+	    return NULL;
+
+	  goto start_over;
+#endif
+	case 'O':
+	  switch (*fmt++)
+	    {
+	    case 'd':
+	    case 'e':
+	      /* Match day of month using alternate numeric symbols.  */
+	      get_alt_number (1, 31, 2);
+	      tm->tm_mday = val;
+	      have_mday = 1;
+	      want_xday = 1;
+	      break;
+	    case 'H':
+	      /* Match hour in 24-hour clock using alternate numeric
+		 symbols.  */
+	      get_alt_number (0, 23, 2);
+	      tm->tm_hour = val;
+	      have_I = 0;
+	      break;
+	    case 'I':
+	      /* Match hour in 12-hour clock using alternate numeric
+		 symbols.  */
+	      get_alt_number (1, 12, 2);
+	      tm->tm_hour = val - 1;
+	      have_I = 1;
+	      break;
+	    case 'm':
+	      /* Match month using alternate numeric symbols.  */
+	      get_alt_number (1, 12, 2);
+	      tm->tm_mon = val - 1;
+	      have_mon = 1;
+	      want_xday = 1;
+	      break;
+	    case 'M':
+	      /* Match minutes using alternate numeric symbols.  */
+	      get_alt_number (0, 59, 2);
+	      tm->tm_min = val;
+	      break;
+	    case 'S':
+	      /* Match seconds using alternate numeric symbols.  */
+	      get_alt_number (0, 61, 2);
+	      tm->tm_sec = val;
+	      break;
+	    case 'U':
+	    case 'V':
+	    case 'W':
+	      get_alt_number (0, 53, 2);
+	      /* XXX This cannot determine any field in TM without
+		 further information.  */
+	      break;
+	    case 'w':
+	      /* Match number of weekday using alternate numeric symbols.  */
+	      get_alt_number (0, 6, 1);
+	      tm->tm_wday = val;
+	      have_wday = 1;
+	      break;
+	    case 'y':
+	      /* Match year within century using alternate numeric symbols.  */
+	      get_alt_number (0, 99, 2);
+	      tm->tm_year = val >= 69 ? val : val + 100;
+	      want_xday = 1;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+	default:
+	  return NULL;
+	}
+    }
+
+  if (have_I && is_pm)
+    tm->tm_hour += 12;
+
+  if (century != -1)
+    {
+      if (want_century)
+	tm->tm_year = tm->tm_year % 100 + (century - 19) * 100;
+      else
+	/* Only the century, but not the year.  Strange, but so be it.  */
+	tm->tm_year = (century - 19) * 100;
+    }
+
+#ifdef _NL_CURRENT
+  if (era_cnt != -1)
+    {
+      era = _nl_select_era_entry(era_cnt);
+      if (want_era)
+	tm->tm_year = (era->start_date[0]
+		       + ((tm->tm_year - era->offset)
+			  * era->absolute_direction));
+      else
+	/* Era start year assumed.  */
+	tm->tm_year = era->start_date[0];
+    }
+  else
+#endif
+    if (want_era)
+      return NULL;
+
+  if (want_xday && !have_wday)
+    {
+      if ( !(have_mon && have_mday) && have_yday)
+	{
+	  /* We don't have tm_mon and/or tm_mday, compute them.  */
+	  int t_mon = 0;
+	  while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon] <= tm->tm_yday)
+	      t_mon++;
+	  if (!have_mon)
+	      tm->tm_mon = t_mon - 1;
+	  if (!have_mday)
+	      tm->tm_mday =
+		(tm->tm_yday
+		 - __mon_yday[__isleap(1900 + tm->tm_year)][t_mon - 1] + 1);
+	}
+      day_of_the_week (tm);
+    }
+  if (want_xday && !have_yday)
+    day_of_the_year (tm);
+
+  return discard_const_p(char, rp);
+}
+
+
+char *rep_strptime(const char *buf, const char *format, struct tm *tm)
+{
+  enum locale_status decided;
+
+#ifdef _NL_CURRENT
+  decided = not;
+#else
+  decided = raw;
+#endif
+  return strptime_internal (buf, format, tm, &decided, -1);
+}

Added: branches/talloc/experimental/lib/replace/strptime.m4
===================================================================
--- branches/talloc/experimental/lib/replace/strptime.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/strptime.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,13 @@
+AC_CACHE_CHECK([whether strptime is available and works],libreplace_cv_STRPTIME_OK,[
+	AC_TRY_RUN([
+		#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
+		#include "$libreplacedir/test/strptime.c"
+		],
+		[libreplace_cv_STRPTIME_OK=yes],
+		[libreplace_cv_STRPTIME_OK=no],
+		[libreplace_cv_STRPTIME_OK="assuming not"])
+])
+if test x"$libreplace_cv_STRPTIME_OK" != x"yes"; then
+        AC_DEFINE(REPLACE_STRPTIME,1,[Whether strptime should be replaced])
+        LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/strptime.o"
+fi

Added: branches/talloc/experimental/lib/replace/system/README
===================================================================
--- branches/talloc/experimental/lib/replace/system/README	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/README	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,4 @@
+This directory contains wrappers around logical groups of system
+include files. The idea is to avoid #ifdef blocks in the main code,
+and instead put all the necessary conditional includes in subsystem
+specific header files in this directory.

Added: branches/talloc/experimental/lib/replace/system/aio.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/aio.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/aio.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,32 @@
+#ifndef _system_aio_h
+#define _system_aio_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   AIO system include wrappers
+
+   Copyright (C) Andrew Tridgell 2006
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifdef HAVE_LIBAIO_H
+#include <libaio.h>
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/capability.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/capability.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/capability.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,55 @@
+#ifndef _system_capability_h
+#define _system_capability_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   capability system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifdef HAVE_SYS_CAPABILITY_H
+
+#if defined(BROKEN_REDHAT_7_SYSTEM_HEADERS) && !defined(_I386_STATFS_H) && !defined(_PPC_STATFS_H)
+#define _I386_STATFS_H
+#define _PPC_STATFS_H
+#define BROKEN_REDHAT_7_STATFS_WORKAROUND
+#endif
+
+#if defined(BROKEN_RHEL5_SYS_CAP_HEADER) && !defined(_LINUX_TYPES_H)
+#define BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#endif
+
+#include <sys/capability.h>
+
+#ifdef BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#undef _LINUX_TYPES_H
+#undef BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#endif
+
+#ifdef BROKEN_REDHAT_7_STATFS_WORKAROUND
+#undef _PPC_STATFS_H
+#undef _I386_STATFS_H
+#undef BROKEN_REDHAT_7_STATFS_WORKAROUND
+#endif
+
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/config.m4
===================================================================
--- branches/talloc/experimental/lib/replace/system/config.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/config.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,131 @@
+# filesys
+AC_HEADER_DIRENT 
+AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/resource.h sys/ioctl.h sys/mode.h sys/filio.h sys/fs/s5param.h sys/filsys.h)
+AC_CHECK_HEADERS(sys/acl.h acl/libacl.h)
+
+# select
+AC_CHECK_HEADERS(sys/select.h)
+
+# time
+AC_CHECK_HEADERS(sys/time.h utime.h)
+AC_HEADER_TIME
+AC_CHECK_FUNCS(utime utimes)
+
+# wait
+AC_HEADER_SYS_WAIT
+
+# capability
+AC_CHECK_HEADERS(sys/capability.h)
+
+case "$host_os" in
+*linux*)
+AC_CACHE_CHECK([for broken RedHat 7.2 system header files],libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
+AC_TRY_COMPILE([
+	#ifdef HAVE_SYS_VFS_H
+	#include <sys/vfs.h>
+	#endif
+	#ifdef HAVE_SYS_CAPABILITY_H
+	#include <sys/capability.h>
+	#endif
+	],[
+	int i;
+	],
+	libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,
+	libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes
+)])
+if test x"$libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
+	AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
+fi
+
+AC_CACHE_CHECK([for broken RHEL5 sys/capability.h],libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER,[
+AC_TRY_COMPILE([
+	#ifdef HAVE_SYS_CAPABILITY_H
+	#include <sys/capability.h>
+	#endif
+	#include <linux/types.h>
+	],[
+	__s8 i;
+	],
+	libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=no,
+	libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=yes
+)])
+if test x"$libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER" = x"yes"; then
+	AC_DEFINE(BROKEN_RHEL5_SYS_CAP_HEADER,1,[Broken RHEL5 sys/capability.h])
+fi
+;;
+esac
+
+# passwd
+AC_CHECK_HEADERS(grp.h sys/id.h compat.h shadow.h sys/priv.h pwd.h sys/security.h)
+AC_CHECK_FUNCS(getpwnam_r getpwuid_r getpwent_r)
+AC_HAVE_DECL(getpwent_r, [
+	#include <unistd.h>
+	#include <pwd.h>
+	])
+AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)],
+	[
+	#ifndef HAVE_GETPWENT_R_DECL
+	#error missing getpwent_r prototype
+	#endif
+	return NULL;
+	],[
+	AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r solaris function prototype])
+	],[],[
+	#include <unistd.h>
+	#include <pwd.h>
+	])
+AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)],
+	[
+	#ifndef HAVE_GETPWENT_R_DECL
+	#error missing getpwent_r prototype
+	#endif
+	return NULL;
+	],[
+	AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r irix (similar to solaris) function prototype])
+	],[],[
+	#include <unistd.h>
+	#include <pwd.h>
+	])
+AC_CHECK_FUNCS(getgrnam_r getgrgid_r getgrent_r)
+AC_HAVE_DECL(getgrent_r, [
+	#include <unistd.h>
+	#include <grp.h>
+	])
+AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, int buflen)],
+	[
+	#ifndef HAVE_GETGRENT_R_DECL
+	#error missing getgrent_r prototype
+	#endif
+	return NULL;
+	],[
+	AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r solaris function prototype])
+	],[],[
+	#include <unistd.h>
+	#include <grp.h>
+	])
+
+AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, size_t buflen)],
+	[
+	#ifndef HAVE_GETGRENT_R_DECL
+	#error missing getgrent_r prototype
+	#endif
+	return NULL;
+	],[
+	AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r irix (similar to solaris)  function prototype])
+	],[],[
+	#include <unistd.h>
+	#include <grp.h>
+	])
+AC_CHECK_FUNCS(getgrouplist)
+
+# locale
+AC_CHECK_HEADERS(ctype.h locale.h langinfo.h)
+
+# glob
+AC_CHECK_HEADERS(fnmatch.h)
+
+# shmem
+AC_CHECK_HEADERS(sys/ipc.h sys/mman.h sys/shm.h )
+
+# terminal
+AC_CHECK_HEADERS(termios.h termio.h sys/termio.h )

Added: branches/talloc/experimental/lib/replace/system/dir.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/dir.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/dir.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,67 @@
+#ifndef _system_dir_h
+#define _system_dir_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   directory system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+#ifndef HAVE_MKDIR_MODE
+#define mkdir(dir, mode) mkdir(dir)
+#endif
+
+/* Test whether a file name is the "." or ".." directory entries.
+ * These really should be inline functions.
+ */
+#ifndef ISDOT
+#define ISDOT(path) ( \
+			*((const char *)(path)) == '.' && \
+			*(((const char *)(path)) + 1) == '\0' \
+		    )
+#endif
+
+#ifndef ISDOTDOT
+#define ISDOTDOT(path)	( \
+			    *((const char *)(path)) == '.' && \
+			    *(((const char *)(path)) + 1) == '.' && \
+			    *(((const char *)(path)) + 2) == '\0' \
+			)
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/filesys.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/filesys.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/filesys.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,186 @@
+#ifndef _system_filesys_h
+#define _system_filesys_h
+/*
+   Unix SMB/CIFS implementation.
+
+   filesystem system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
+#endif
+
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+
+#ifdef HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+
+#ifdef HAVE_SYS_FS_S5PARAM_H
+#include <sys/fs/s5param.h>
+#endif
+
+#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
+#include <sys/filsys.h>
+#endif
+
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+#endif
+
+#ifdef HAVE_DUSTAT_H
+#include <sys/dustat.h>
+#endif
+
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+#include <sys/file.h>
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#else
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_MODE_H
+/* apparently AIX needs this for S_ISLNK */
+#ifndef S_ISLNK
+#include <sys/mode.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+/*
+ * Veritas File System.  Often in addition to native.
+ * Quotas different.
+ */
+#if defined(HAVE_SYS_FS_VX_QUOTA_H)
+#define VXFS_QUOTA
+#endif
+
+#if HAVE_SYS_ATTRIBUTES_H
+#include <sys/attributes.h>
+#endif
+
+/* mutually exclusive (SuSE 8.2) */
+#if HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#elif HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+/* Some POSIX definitions for those without */
+
+#ifndef S_IFDIR
+#define S_IFDIR         0x4000
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(mode)   ((mode & 0xF000) == S_IFDIR)
+#endif
+#ifndef S_IRWXU
+#define S_IRWXU 00700           /* read, write, execute: owner */
+#endif
+#ifndef S_IRUSR
+#define S_IRUSR 00400           /* read permission: owner */
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR 00200           /* write permission: owner */
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR 00100           /* execute permission: owner */
+#endif
+#ifndef S_IRWXG
+#define S_IRWXG 00070           /* read, write, execute: group */
+#endif
+#ifndef S_IRGRP
+#define S_IRGRP 00040           /* read permission: group */
+#endif
+#ifndef S_IWGRP
+#define S_IWGRP 00020           /* write permission: group */
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP 00010           /* execute permission: group */
+#endif
+#ifndef S_IRWXO
+#define S_IRWXO 00007           /* read, write, execute: other */
+#endif
+#ifndef S_IROTH
+#define S_IROTH 00004           /* read permission: other */
+#endif
+#ifndef S_IWOTH
+#define S_IWOTH 00002           /* write permission: other */
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH 00001           /* execute permission: other */
+#endif
+
+#ifndef O_ACCMODE
+#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
+#endif
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/glob.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/glob.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/glob.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,37 @@
+#ifndef _system_glob_h
+#define _system_glob_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   glob system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_GLOB_H
+#include <glob.h>
+#endif
+
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/iconv.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/iconv.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/iconv.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,57 @@
+#ifndef _system_iconv_h
+#define _system_iconv_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   iconv memory system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+#define HAVE_ICONV
+#endif
+
+#if !defined(HAVE_GICONV) && defined(HAVE_GICONV_H)
+#define HAVE_GICONV
+#endif
+
+#if !defined(HAVE_BICONV) && defined(HAVE_BICONV_H)
+#define HAVE_BICONV
+#endif
+
+#ifdef HAVE_NATIVE_ICONV
+#if defined(HAVE_ICONV)
+#include <iconv.h>
+#elif defined(HAVE_GICONV)
+#include <giconv.h>
+#elif defined(HAVE_BICONV)
+#include <biconv.h>
+#endif
+#endif /* HAVE_NATIVE_ICONV */
+
+/* needed for some systems without iconv. Doesn't really matter
+   what error code we use */
+#ifndef EILSEQ
+#define EILSEQ EIO
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/kerberos.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/kerberos.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/kerberos.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,141 @@
+#ifndef _system_kerberos_h
+#define _system_kerberos_h
+
+/* 
+   Unix SMB/CIFS implementation.
+
+   kerberos system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_KRB5
+/* Whether the krb5_address struct has a addrtype property */
+/* #undef HAVE_ADDRTYPE_IN_KRB5_ADDRESS */
+/* Whether the krb5_address struct has a addr_type property */
+#define HAVE_ADDR_TYPE_IN_KRB5_ADDRESS 1
+/* Define to 1 if you have the `gsskrb5_extract_authz_data_from_sec_context' */
+#define HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT 1
+/* Define to 1 if you have the `gsskrb5_get_initiator_subkey' function. */
+#define HAVE_GSSKRB5_GET_INITIATOR_SUBKEY 1
+/* Define to 1 if you have the `gsskrb5_register_acceptor_identity' function. */
+#define HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY 1
+/* Define to 1 if you have the `gss_krb5_ccache_name' function. */
+#define HAVE_GSS_KRB5_CCACHE_NAME 1
+/* Define to 1 if you have the `krb5_addlog_func' function. */
+#define HAVE_KRB5_ADDLOG_FUNC 1
+/* Define to 1 if you have the `krb5_auth_con_setkey' function. */
+#define HAVE_KRB5_AUTH_CON_SETKEY 1
+/* Define to 1 if you have the `krb5_auth_con_setuseruserkey' function. */
+/* #undef HAVE_KRB5_AUTH_CON_SETUSERUSERKEY */
+/* Define to 1 if you have the `krb5_c_enctype_compare' function. */
+#define HAVE_KRB5_C_ENCTYPE_COMPARE 1
+/* Define to 1 if you have the `krb5_c_verify_checksum' function. */
+#define HAVE_KRB5_C_VERIFY_CHECKSUM 1
+/* Whether the type krb5_encrypt_block exists */
+/* #undef HAVE_KRB5_ENCRYPT_BLOCK */
+/* Define to 1 if you have the `krb5_encrypt_data' function. */
+/* #undef HAVE_KRB5_ENCRYPT_DATA */
+/* Define to 1 if you have the `krb5_enctypes_compatible_keys' function. */
+#define HAVE_KRB5_ENCTYPES_COMPATIBLE_KEYS 1
+/* Define to 1 if you have the `krb5_free_data_contents' function. */
+#define HAVE_KRB5_FREE_DATA_CONTENTS 1
+/* Define to 1 if you have the `krb5_free_error_string' function. */
+/* #undef HAVE_KRB5_FREE_ERROR_STRING */
+/* Define to 1 if you have the `krb5_free_error_message' function. */
+#define HAVE_KRB5_FREE_ERROR_MESSAGE 1
+/* Define to 1 if you have the `krb5_free_keytab_entry_contents' function. */
+/* #undef HAVE_KRB5_FREE_KEYTAB_ENTRY_CONTENTS */
+/* Define to 1 if you have the `krb5_free_ktypes' function. */
+/* #undef HAVE_KRB5_FREE_KTYPES */
+/* Define to 1 if you have the `krb5_free_unparsed_name' function. */
+/* #undef HAVE_KRB5_FREE_UNPARSED_NAME */
+/* Define to 1 if you have the `krb5_get_default_in_tkt_etypes' function. */
+#define HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES 1
+/* Define to 1 if you have the `krb5_get_error_string' function. */
+#define HAVE_KRB5_GET_ERROR_STRING 1
+/* Define to 1 if you have the `krb5_get_error_message' function. */
+#define HAVE_KRB5_GET_ERROR_MESSAGE 1
+/* Define to 1 if you have the `krb5_get_permitted_enctypes' function. */
+/* #undef HAVE_KRB5_GET_PERMITTED_ENCTYPES */
+/* Define to 1 if you have the `krb5_get_pw_salt' function. */
+#define HAVE_KRB5_GET_PW_SALT 1
+/* Define to 1 if you have the <krb5.h> header file. */
+#define HAVE_KRB5_H 1
+/* Define to 1 if you have the `krb5_initlog' function. */
+#define HAVE_KRB5_INITLOG 1
+/* Define to 1 if you have the `krb5_kdc_default_config' function. */
+#define HAVE_KRB5_KDC_DEFAULT_CONFIG 1
+/* Whether the krb5_creds struct has a keyblock property */
+/* #undef HAVE_KRB5_KEYBLOCK_IN_CREDS */
+/* Whether the krb5_keyblock struct has a keyvalue property */
+#define HAVE_KRB5_KEYBLOCK_KEYVALUE 1
+/* Whether krb5_keytab_entry has key member */
+/* #undef HAVE_KRB5_KEYTAB_ENTRY_KEY */
+/* Whether krb5_keytab_entry has keyblock member */
+#define HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK 1
+/* Define to 1 if you have the `krb5_krbhst_get_addrinfo' function. */
+#define HAVE_KRB5_KRBHST_GET_ADDRINFO 1
+/* Define to 1 if you have the `krb5_kt_compare' function. */
+#define HAVE_KRB5_KT_COMPARE 1
+/* Define to 1 if you have the `krb5_kt_free_entry' function. */
+#define HAVE_KRB5_KT_FREE_ENTRY 1
+/* Whether the type krb5_log_facility exists */
+#define HAVE_KRB5_LOG_FACILITY 1
+/* Define to 1 if you have the `krb5_mk_req_extended' function. */
+#define HAVE_KRB5_MK_REQ_EXTENDED 1
+/* Define to 1 if you have the `krb5_principal2salt' function. */
+/* #undef HAVE_KRB5_PRINCIPAL2SALT */
+/* Define to 1 if you have the `krb5_principal_get_comp_string' function. */
+#define HAVE_KRB5_PRINCIPAL_GET_COMP_STRING 1
+/* Whether krb5_princ_component is available */
+/* #undef HAVE_KRB5_PRINC_COMPONENT */
+/* Whether the krb5_creds struct has a session property */
+#define HAVE_KRB5_SESSION_IN_CREDS 1
+/* Define to 1 if you have the `krb5_set_default_in_tkt_etypes' function. */
+#define HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES 1
+/* Define to 1 if you have the `krb5_set_default_tgs_ktypes' function. */
+/* #undef HAVE_KRB5_SET_DEFAULT_TGS_KTYPES */
+/* Define to 1 if you have the `krb5_set_real_time' function. */
+#define HAVE_KRB5_SET_REAL_TIME 1
+/* Define to 1 if you have the `krb5_set_warn_dest' function. */
+#define HAVE_KRB5_SET_WARN_DEST 1
+/* Define to 1 if you have the `krb5_string_to_key' function. */
+#define HAVE_KRB5_STRING_TO_KEY 1
+/* Define to 1 if you have the `krb5_string_to_key_salt' function. */
+#define HAVE_KRB5_STRING_TO_KEY_SALT 1
+/* Define to 1 if you have the `krb5_ticket_get_authorization_data_type' */
+#define HAVE_KRB5_TICKET_GET_AUTHORIZATION_DATA_TYPE 1
+/* Whether the krb5_ticket struct has a enc_part2 property */
+/* #undef HAVE_KRB5_TKT_ENC_PART2 */
+/* Define to 1 if you have the `krb5_use_enctype' function. */
+/* #undef HAVE_KRB5_USE_ENCTYPE */
+/* Define to 1 if you have the `krb5_verify_checksum' function. */
+#define HAVE_KRB5_VERIFY_CHECKSUM 1
+/* Whether krb5_princ_realm returns krb5_realm or krb5_data */
+#define KRB5_PRINC_REALM_RETURNS_REALM 1
+
+#include <krb5.h>
+#include <com_err.h>
+
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/locale.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/locale.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/locale.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,42 @@
+#ifndef _system_locale_h
+#define _system_locale_h
+
+/* 
+   Unix SMB/CIFS implementation.
+
+   locale include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/network.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/network.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/network.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,379 @@
+#ifndef _system_network_h
+#define _system_network_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   networking system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   Copyright (C) Jelmer Vernooij 2007
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef LIBREPLACE_NETWORK_CHECKS
+#error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure"
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_UNIXSOCKET
+#include <sys/un.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+/*
+ * The next three defines are needed to access the IPTOS_* options
+ * on some systems.
+ */
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_IP_H
+#include <netinet/in_ip.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+
+#ifndef HAVE_SOCKLEN_T
+#define HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
+#if !defined (HAVE_INET_NTOA) || defined(REPLACE_INET_NTOA)
+/* define is in "replace.h" */
+char *rep_inet_ntoa(struct in_addr ip);
+#endif
+
+#ifndef HAVE_INET_PTON
+/* define is in "replace.h" */
+int rep_inet_pton(int af, const char *src, void *dst);
+#endif
+
+#ifndef HAVE_INET_NTOP
+/* define is in "replace.h" */
+const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
+#endif
+
+#ifndef HAVE_INET_ATON
+/* define is in "replace.h" */
+int rep_inet_aton(const char *src, struct in_addr *dst);
+#endif
+
+#ifndef HAVE_CONNECT
+/* define is in "replace.h" */
+int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
+#endif
+
+#ifndef HAVE_GETHOSTBYNAME
+/* define is in "replace.h" */
+struct hostent *rep_gethostbyname(const char *name);
+#endif
+
+#ifdef HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+
+#ifndef HAVE_STRUCT_IFADDRS
+struct ifaddrs {
+	struct ifaddrs   *ifa_next;         /* Pointer to next struct */
+	char             *ifa_name;         /* Interface name */
+	unsigned int     ifa_flags;         /* Interface flags */
+	struct sockaddr  *ifa_addr;         /* Interface address */
+	struct sockaddr  *ifa_netmask;      /* Interface netmask */
+#undef ifa_dstaddr
+	struct sockaddr  *ifa_dstaddr;      /* P2P interface destination */
+	void             *ifa_data;         /* Address specific data */
+};
+#endif
+
+#ifndef HAVE_GETIFADDRS
+int rep_getifaddrs(struct ifaddrs **);
+#endif
+
+#ifndef HAVE_FREEIFADDRS
+void rep_freeifaddrs(struct ifaddrs *);
+#endif
+
+#ifndef HAVE_SOCKETPAIR
+/* define is in "replace.h" */
+int rep_socketpair(int d, int type, int protocol, int sv[2]);
+#endif
+
+/*
+ * Some systems have getaddrinfo but not the
+ * defines needed to use it.
+ */
+
+/* Various macros that ought to be in <netdb.h>, but might not be */
+
+#ifndef EAI_FAIL
+#define EAI_BADFLAGS	(-1)
+#define EAI_NONAME	(-2)
+#define EAI_AGAIN	(-3)
+#define EAI_FAIL	(-4)
+#define EAI_FAMILY	(-6)
+#define EAI_SOCKTYPE	(-7)
+#define EAI_SERVICE	(-8)
+#define EAI_MEMORY	(-10)
+#define EAI_SYSTEM	(-11)
+#endif   /* !EAI_FAIL */
+
+#ifndef AI_PASSIVE
+#define AI_PASSIVE	0x0001
+#endif
+
+#ifndef AI_CANONNAME
+#define AI_CANONNAME	0x0002
+#endif
+
+#ifndef AI_NUMERICHOST
+/*
+ * some platforms don't support AI_NUMERICHOST; define as zero if using
+ * the system version of getaddrinfo...
+ */
+#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#define AI_NUMERICHOST	0
+#else
+#define AI_NUMERICHOST	0x0004
+#endif
+#endif
+
+/*
+ * Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG. On QNX
+ * 6.3.0, this macro is defined but, if it's used, getaddrinfo will fail. This
+ * prevents smbd from opening any sockets.
+ *
+ * If I undefine AI_ADDRCONFIG on such systems and define it to be 0,
+ * this works around the issue.
+ */
+#ifdef __QNX__
+#include <sys/neutrino.h>
+#if _NTO_VERSION == 630
+#undef AI_ADDRCONFIG
+#endif
+#endif
+#ifndef AI_ADDRCONFIG
+/*
+ * logic copied from AI_NUMERICHOST
+ */
+#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#define AI_ADDRCONFIG	0
+#else
+#define AI_ADDRCONFIG	0x0020
+#endif
+#endif
+
+#ifndef AI_NUMERICSERV
+/*
+ * logic copied from AI_NUMERICHOST
+ */
+#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#define AI_NUMERICSERV	0
+#else
+#define AI_NUMERICSERV	0x0400
+#endif
+#endif
+
+#ifndef NI_NUMERICHOST
+#define NI_NUMERICHOST	1
+#endif
+
+#ifndef NI_NUMERICSERV
+#define NI_NUMERICSERV	2
+#endif
+
+#ifndef NI_NOFQDN
+#define NI_NOFQDN	4
+#endif
+
+#ifndef NI_NAMEREQD
+#define NI_NAMEREQD 	8
+#endif
+
+#ifndef NI_DGRAM
+#define NI_DGRAM	16
+#endif
+
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST	1025
+#endif
+
+#ifndef NI_MAXSERV
+#define NI_MAXSERV	32
+#endif
+
+/*
+ * glibc on linux doesn't seem to have MSG_WAITALL
+ * defined. I think the kernel has it though..
+ */
+#ifndef MSG_WAITALL
+#define MSG_WAITALL 0
+#endif
+
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
+#endif
+
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT EINVAL
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN 46
+#endif
+
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN HOST_NAME_MAX
+#endif
+
+#ifndef HAVE_SA_FAMILY_T
+#define HAVE_SA_FAMILY_T
+typedef unsigned short int sa_family_t;
+#endif
+
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
+#define HAVE_STRUCT_SOCKADDR_STORAGE
+#ifdef HAVE_STRUCT_SOCKADDR_IN6
+#define sockaddr_storage sockaddr_in6
+#define ss_family sin6_family
+#define HAVE_SS_FAMILY 1
+#else
+#define sockaddr_storage sockaddr_in
+#define ss_family sin_family
+#define HAVE_SS_FAMILY 1
+#endif
+#endif
+
+#ifndef HAVE_SS_FAMILY
+#ifdef HAVE___SS_FAMILY
+#define ss_family __ss_family
+#define HAVE_SS_FAMILY 1
+#endif
+#endif
+
+#ifndef IOV_MAX
+# ifdef UIO_MAXIOV
+#  define IOV_MAX UIO_MAXIOV
+# else
+#  ifdef __sgi
+    /*
+     * IRIX 6.5 has sysconf(_SC_IOV_MAX)
+     * which might return 512 or bigger
+     */
+#   define IOV_MAX 512
+#  else
+#   error IOV_MAX and UIO_MAXIOV undefined
+#  endif
+# endif
+#endif
+
+#ifndef HAVE_STRUCT_ADDRINFO
+#define HAVE_STRUCT_ADDRINFO
+struct addrinfo {
+	int			ai_flags;
+	int			ai_family;
+	int			ai_socktype;
+	int			ai_protocol;
+	socklen_t		ai_addrlen;
+	struct sockaddr 	*ai_addr;
+	char			*ai_canonname;
+	struct addrinfo		*ai_next;
+};
+#endif   /* HAVE_STRUCT_ADDRINFO */
+
+#if !defined(HAVE_GETADDRINFO)
+#include "getaddrinfo.h"
+#endif
+
+/* Needed for some systems that don't define it (Solaris). */
+#ifndef ifr_netmask
+#define ifr_netmask ifr_addr
+#endif
+
+/* Some old Linux systems have broken header files */
+#ifdef HAVE_IPV6
+#ifdef HAVE_LINUX_IPV6_V6ONLY_26
+#define IPV6_V6ONLY 26
+#endif /* HAVE_LINUX_IPV6_V6ONLY_26 */
+#endif /* HAVE_IPV6 */
+
+#ifdef SOCKET_WRAPPER
+#ifndef SOCKET_WRAPPER_DISABLE
+#ifndef SOCKET_WRAPPER_NOT_REPLACE
+#define SOCKET_WRAPPER_REPLACE
+#endif /* SOCKET_WRAPPER_NOT_REPLACE */
+#include "../socket_wrapper/socket_wrapper.h"
+#endif /* SOCKET_WRAPPER_DISABLE */
+#endif /* SOCKET_WRAPPER */
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/passwd.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/passwd.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/passwd.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,112 @@
+#ifndef _system_passwd_h
+#define _system_passwd_h
+
+/*
+   Unix SMB/CIFS implementation.
+
+   passwd system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+/* this needs to be included before nss_wrapper.h on some systems */
+#include <unistd.h>
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+#ifdef HAVE_SYS_PRIV_H
+#include <sys/priv.h>
+#endif
+#ifdef HAVE_SYS_ID_H
+#include <sys/id.h>
+#endif
+
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+
+#ifdef HAVE_SHADOW_H
+#include <shadow.h>
+#endif
+
+#ifdef HAVE_SYS_SECURITY_H
+#include <sys/security.h>
+#include <prot.h>
+#define PASSWORD_LENGTH 16
+#endif  /* HAVE_SYS_SECURITY_H */
+
+#ifdef HAVE_GETPWANAM
+#include <sys/label.h>
+#include <sys/audit.h>
+#include <pwdadj.h>
+#endif
+
+#ifdef HAVE_COMPAT_H
+#include <compat.h>
+#endif
+
+#ifdef REPLACE_GETPASS
+#if defined(REPLACE_GETPASS_BY_GETPASSPHRASE)
+#define getpass(prompt) getpassphrase(prompt)
+#else
+#define getpass(prompt) rep_getpass(prompt)
+char *rep_getpass(const char *prompt);
+#endif
+#endif
+
+#ifndef NGROUPS_MAX
+#define NGROUPS_MAX 32 /* Guess... */
+#endif
+
+/* what is the longest significant password available on your system?
+ Knowing this speeds up password searches a lot */
+#ifndef PASSWORD_LENGTH
+#define PASSWORD_LENGTH 8
+#endif
+
+#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
+#define OSF1_ENH_SEC 1
+#endif
+
+#ifndef ALLOW_CHANGE_PASSWORD
+#if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
+#define ALLOW_CHANGE_PASSWORD 1
+#endif
+#endif
+
+#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
+#define ULTRIX_AUTH 1
+#endif
+
+#ifdef NSS_WRAPPER
+#ifndef NSS_WRAPPER_DISABLE
+#ifndef NSS_WRAPPER_NOT_REPLACE
+#define NSS_WRAPPER_REPLACE
+#endif /* NSS_WRAPPER_NOT_REPLACE */
+#include "../nss_wrapper/nss_wrapper.h"
+#endif /* NSS_WRAPPER_DISABLE */
+#endif /* NSS_WRAPPER */
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/readline.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/readline.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/readline.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,52 @@
+#ifndef _system_readline_h
+#define _system_readline_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   Readline wrappers
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_LIBREADLINE
+#  ifdef HAVE_READLINE_READLINE_H
+#    include <readline/readline.h>
+#    ifdef HAVE_READLINE_HISTORY_H
+#      include <readline/history.h>
+#    endif
+#  else
+#    ifdef HAVE_READLINE_H
+#      include <readline.h>
+#      ifdef HAVE_HISTORY_H
+#        include <history.h>
+#      endif
+#    else
+#      undef HAVE_LIBREADLINE
+#    endif
+#  endif
+#endif
+
+#ifdef HAVE_NEW_LIBREADLINE
+#  define RL_COMPLETION_CAST (rl_completion_func_t *)
+#else
+/* This type is missing from libreadline<4.0  (approximately) */
+#  define RL_COMPLETION_CAST
+#endif /* HAVE_NEW_LIBREADLINE */
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/select.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/select.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/select.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,41 @@
+#ifndef _system_select_h
+#define _system_select_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   select system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#ifdef HAVE_SYS_EPOLL_H
+#include <sys/epoll.h>
+#endif
+
+#ifndef SELECT_CAST
+#define SELECT_CAST
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/shmem.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/shmem.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/shmem.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,59 @@
+#ifndef _system_shmem_h
+#define _system_shmem_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   shared memory system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#if defined(HAVE_SYS_IPC_H)
+#include <sys/ipc.h>
+#endif /* HAVE_SYS_IPC_H */
+
+#if defined(HAVE_SYS_SHM_H)
+#include <sys/shm.h>
+#endif /* HAVE_SYS_SHM_H */
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+/* NetBSD doesn't have these */
+#ifndef SHM_R
+#define SHM_R 0400
+#endif
+
+#ifndef SHM_W
+#define SHM_W 0200
+#endif
+
+
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/syslog.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/syslog.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/syslog.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,70 @@
+#ifndef _system_syslog_h
+#define _system_syslog_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   syslog system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#else
+#ifdef HAVE_SYS_SYSLOG_H
+#include <sys/syslog.h>
+#endif
+#endif
+
+/* For sys_adminlog(). */
+#ifndef LOG_EMERG
+#define LOG_EMERG       0       /* system is unusable */
+#endif
+
+#ifndef LOG_ALERT
+#define LOG_ALERT       1       /* action must be taken immediately */
+#endif
+
+#ifndef LOG_CRIT
+#define LOG_CRIT        2       /* critical conditions */
+#endif
+
+#ifndef LOG_ERR
+#define LOG_ERR         3       /* error conditions */
+#endif
+
+#ifndef LOG_WARNING
+#define LOG_WARNING     4       /* warning conditions */
+#endif
+
+#ifndef LOG_NOTICE
+#define LOG_NOTICE      5       /* normal but significant condition */
+#endif
+
+#ifndef LOG_INFO
+#define LOG_INFO        6       /* informational */
+#endif
+
+#ifndef LOG_DEBUG
+#define LOG_DEBUG       7       /* debug-level messages */
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/terminal.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/terminal.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/terminal.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,46 @@
+#ifndef _system_terminal_h
+#define _system_terminal_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   terminal system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef SUNOS4
+/* on SUNOS4 termios.h conflicts with sys/ioctl.h */
+#undef HAVE_TERMIOS_H
+#endif
+
+
+#if defined(HAVE_TERMIOS_H)
+/* POSIX terminal handling. */
+#include <termios.h>
+#elif defined(HAVE_TERMIO_H)
+/* Older SYSV terminal handling - don't use if we can avoid it. */
+#include <termio.h>
+#elif defined(HAVE_SYS_TERMIO_H)
+/* Older SYSV terminal handling - don't use if we can avoid it. */
+#include <sys/termio.h>
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/time.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/time.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/time.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,69 @@
+#ifndef _system_time_h
+#define _system_time_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   time system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#else
+struct utimbuf {
+	time_t actime;       /* access time */
+	time_t modtime;      /* modification time */
+};
+#endif
+
+#ifndef HAVE_MKTIME
+/* define is in "replace.h" */
+time_t rep_mktime(struct tm *t);
+#endif
+
+#ifndef HAVE_TIMEGM
+/* define is in "replace.h" */
+time_t rep_timegm(struct tm *tm);
+#endif
+
+#ifndef HAVE_UTIME
+/* define is in "replace.h" */
+int rep_utime(const char *filename, const struct utimbuf *buf);
+#endif
+
+#ifndef HAVE_UTIMES
+/* define is in "replace.h" */
+int rep_utimes(const char *filename, const struct timeval tv[2]);
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/wait.h
===================================================================
--- branches/talloc/experimental/lib/replace/system/wait.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/wait.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,55 @@
+#ifndef _system_wait_h
+#define _system_wait_h
+/* 
+   Unix SMB/CIFS implementation.
+
+   waitpid system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#include <signal.h>
+
+#ifndef SIGCLD
+#define SIGCLD SIGCHLD
+#endif
+
+#ifdef HAVE_SETJMP_H
+#include <setjmp.h>
+#endif
+
+#ifndef SA_RESETHAND
+#define SA_RESETHAND SA_ONESHOT
+#endif
+
+#if !defined(HAVE_SIG_ATOMIC_T_TYPE)
+typedef int sig_atomic_t;
+#endif
+
+#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
+int rep_waitpid(pid_t pid,int *status,int options)
+#endif
+
+#endif

Added: branches/talloc/experimental/lib/replace/system/wscript_configure
===================================================================
--- branches/talloc/experimental/lib/replace/system/wscript_configure	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/system/wscript_configure	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+conf.CHECK_HEADERS('sys/capability.h')
+conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
+
+# solaris varients of getXXent_r
+conf.CHECK_C_PROTOTYPE('getpwent_r',
+                       'struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)',
+                       define='SOLARIS_GETPWENT_R', headers='pwd.h')
+conf.CHECK_C_PROTOTYPE('getgrent_r',
+                       'struct group *getgrent_r(struct group *src, char *buf, int buflen)',
+                       define='SOLARIS_GETGRENT_R', headers='grp.h')
+
+# the irix varients
+conf.CHECK_C_PROTOTYPE('getpwent_r',
+                       'struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)',
+                       define='SOLARIS_GETPWENT_R', headers='pwd.h')
+conf.CHECK_C_PROTOTYPE('getgrent_r',
+                       'struct group *getgrent_r(struct group *src, char *buf, size_t buflen)',
+                       define='SOLARIS_GETGRENT_R', headers='grp.h')
+
+conf.CHECK_FUNCS('getgrouplist')
+conf.CHECK_HEADERS('ctype.h locale.h langinfo.h')
+conf.CHECK_HEADERS('fnmatch.h locale.h langinfo.h')
+conf.CHECK_HEADERS('sys/ipc.h sys/mman.h sys/shm.h')
+conf.CHECK_HEADERS('termios.h termio.h sys/termio.h')

Added: branches/talloc/experimental/lib/replace/test/getifaddrs.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/getifaddrs.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/getifaddrs.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,100 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * libreplace getifaddrs test
+ *
+ * Copyright (C) Michael Adam <obnox at samba.org> 2008
+ *
+ *  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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef AUTOCONF_TEST
+#include "replace.h"
+#include "system/network.h"
+#endif
+
+#ifdef HAVE_INET_NTOP
+#define rep_inet_ntop inet_ntop
+#endif
+
+static const char *format_sockaddr(struct sockaddr *addr,
+				   char *addrstring,
+				   socklen_t addrlen)
+{
+	const char *result = NULL;
+
+	if (addr->sa_family == AF_INET) {
+		result = rep_inet_ntop(AF_INET,
+				       &((struct sockaddr_in *)addr)->sin_addr,
+				       addrstring,
+				       addrlen);
+#ifdef HAVE_STRUCT_SOCKADDR_IN6
+	} else if (addr->sa_family == AF_INET6) {
+		result = rep_inet_ntop(AF_INET6,
+				       &((struct sockaddr_in6 *)addr)->sin6_addr,
+				       addrstring,
+				       addrlen);
+#endif
+	}
+	return result;
+}
+
+int getifaddrs_test(void)
+{
+	struct ifaddrs *ifs = NULL;
+	struct ifaddrs *ifs_head = NULL;
+	int ret;
+
+	ret = getifaddrs(&ifs);
+	ifs_head = ifs;
+	if (ret != 0) {
+		fprintf(stderr, "getifaddrs() failed: %s\n", strerror(errno));
+		return 1;
+	}
+
+	while (ifs) {
+		printf("%-10s ", ifs->ifa_name);
+		if (ifs->ifa_addr != NULL) {
+			char addrstring[INET6_ADDRSTRLEN];
+			const char *result;
+
+			result = format_sockaddr(ifs->ifa_addr,
+						 addrstring,
+						 sizeof(addrstring));
+			if (result != NULL) {
+				printf("IP=%s ", addrstring);
+			}
+
+			if (ifs->ifa_netmask != NULL) {
+				result = format_sockaddr(ifs->ifa_netmask,
+							 addrstring,
+							 sizeof(addrstring));
+				if (result != NULL) {
+					printf("NETMASK=%s", addrstring);
+				}
+			} else {
+				printf("AF=%d ", ifs->ifa_addr->sa_family);
+			}
+		} else {
+			printf("<no address>");
+		}
+
+		printf("\n");
+		ifs = ifs->ifa_next;
+	}
+
+	freeifaddrs(ifs_head);
+
+	return 0;
+}

Added: branches/talloc/experimental/lib/replace/test/main.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/main.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/main.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,37 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   libreplace tests
+
+   Copyright (C) Jelmer Vernooij 2006
+
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+struct torture_context;
+bool torture_local_replace(struct torture_context *ctx);
+
+int main(void)
+{
+	bool ret = torture_local_replace(NULL);
+	if (ret)
+		return 0;
+	return -1;
+}

Added: branches/talloc/experimental/lib/replace/test/os2_delete.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/os2_delete.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/os2_delete.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,132 @@
+/*
+  test readdir/unlink pattern that OS/2 uses
+  tridge at samba.org July 2005
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+
+#define NUM_FILES 700
+#define READDIR_SIZE 100
+#define DELETE_SIZE 4
+
+#define TESTDIR "test.dir"
+
+static int test_readdir_os2_delete_ret;
+
+#define FAILED(d) (printf("failure: readdir [\nFailed for %s - %d = %s\n]\n", d, errno, strerror(errno)), test_readdir_os2_delete_ret = 1, 1)
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
+static void cleanup(void)
+{
+	/* I'm a lazy bastard */
+	if (system("rm -rf " TESTDIR)) {
+		FAILED("system");
+	}
+	mkdir(TESTDIR, 0700) == 0 || FAILED("mkdir");
+}
+
+static void create_files(void)
+{
+	int i;
+	for (i=0;i<NUM_FILES;i++) {
+		char fname[40];
+		int fd;
+		sprintf(fname, TESTDIR "/test%u.txt", i);
+		fd = open(fname, O_CREAT|O_RDWR, 0600);
+		if (fd < 0) {
+			FAILED("open");
+		}
+		if (close(fd) != 0) {
+			FAILED("close");
+		}
+	}
+}
+
+static int os2_delete(DIR *d)
+{
+	off_t offsets[READDIR_SIZE];
+	int i, j;
+	struct dirent *de;
+	char names[READDIR_SIZE][30];
+
+	/* scan, remembering offsets */
+	for (i=0, de=readdir(d); 
+	     de && i < READDIR_SIZE; 
+	     de=readdir(d), i++) {
+		offsets[i] = telldir(d);
+		strcpy(names[i], de->d_name);
+	}
+
+	if (i == 0) {
+		return 0;
+	}
+
+	/* delete the first few */
+	for (j=0; j<MIN(i, DELETE_SIZE); j++) {
+		char fname[40];
+		sprintf(fname, TESTDIR "/%s", names[j]);
+		unlink(fname) == 0 || FAILED("unlink");
+	}
+
+	/* seek to just after the deletion */
+	seekdir(d, offsets[j-1]);
+
+	/* return number deleted */
+	return j;
+}
+
+int test_readdir_os2_delete(void)
+{
+	int total_deleted = 0;
+	DIR *d;
+	struct dirent *de;
+
+	test_readdir_os2_delete_ret = 0;
+
+	cleanup();
+	create_files();
+
+	d = opendir(TESTDIR "/test0.txt");
+	if (d != NULL) FAILED("opendir() on file succeed");
+	if (errno != ENOTDIR) FAILED("opendir() on file didn't give ENOTDIR");
+
+	d = opendir(TESTDIR);
+
+	/* skip past . and .. */
+	de = readdir(d);
+	strcmp(de->d_name, ".") == 0 || FAILED("match .");
+	de = readdir(d);
+	strcmp(de->d_name, "..") == 0 || FAILED("match ..");
+
+	while (1) {
+		int n = os2_delete(d);
+		if (n == 0) break;
+		total_deleted += n;
+	}
+	closedir(d);
+
+	fprintf(stderr, "Deleted %d files of %d\n", total_deleted, NUM_FILES);
+
+	rmdir(TESTDIR) == 0 || FAILED("rmdir");
+
+	if (system("rm -rf " TESTDIR) == -1) {
+		FAILED("system");
+	}
+
+	return test_readdir_os2_delete_ret;
+}

Added: branches/talloc/experimental/lib/replace/test/shared_mmap.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/shared_mmap.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/shared_mmap.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,68 @@
+/* this tests whether we can use a shared writeable mmap on a file -
+   as needed for the mmap variant of FAST_SHARE_MODES */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define DATA "conftest.mmap"
+
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+
+main()
+{
+	int *buf;
+	int i; 
+	int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666);
+	int count=7;
+
+	if (fd == -1) exit(1);
+
+	for (i=0;i<10000;i++) {
+		write(fd,&i,sizeof(i));
+	}
+
+	close(fd);
+
+	if (fork() == 0) {
+		fd = open(DATA,O_RDWR);
+		if (fd == -1) exit(1);
+
+		buf = (int *)mmap(NULL, 10000*sizeof(int), 
+				   (PROT_READ | PROT_WRITE), 
+				   MAP_FILE | MAP_SHARED, 
+				   fd, 0);
+
+		while (count-- && buf[9124] != 55732) sleep(1);
+
+		if (count <= 0) exit(1);
+
+		buf[1763] = 7268;
+		exit(0);
+	}
+
+	fd = open(DATA,O_RDWR);
+	if (fd == -1) exit(1);
+
+	buf = (int *)mmap(NULL, 10000*sizeof(int), 
+			   (PROT_READ | PROT_WRITE), 
+			   MAP_FILE | MAP_SHARED, 
+			   fd, 0);
+
+	if (buf == (int *)-1) exit(1);
+
+	buf[9124] = 55732;
+
+	while (count-- && buf[1763] != 7268) sleep(1);
+
+	unlink(DATA);
+		
+	if (count > 0) exit(0);
+	exit(1);
+}

Added: branches/talloc/experimental/lib/replace/test/snprintf.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/snprintf.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/snprintf.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,29 @@
+void foo(const char *format, ...)
+{
+	va_list ap;
+	int len;
+	char buf[20];
+	long long l = 1234567890;
+	l *= 100;
+
+	va_start(ap, format);
+	len = vsnprintf(buf, 0, format, ap);
+	va_end(ap);
+	if (len != 5) exit(1);
+
+	va_start(ap, format);
+	len = vsnprintf(0, 0, format, ap);
+	va_end(ap);
+	if (len != 5) exit(2);
+
+	if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(3);
+
+	if (snprintf(buf, 20, "%lld", l) != 12 || strcmp(buf, "123456789000") != 0) exit(4);
+	if (snprintf(buf, 20, "%zu", 123456789) != 9 || strcmp(buf, "123456789") != 0) exit(5);
+	if (snprintf(buf, 20, "%2\$d %1\$d", 3, 4) != 3 || strcmp(buf, "4 3") != 0) exit(6);
+	if (snprintf(buf, 20, "%s", 0) < 3) exit(7);
+
+	printf("1");
+	exit(0);
+}
+main() { foo("hello"); }

Added: branches/talloc/experimental/lib/replace/test/strptime.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/strptime.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/strptime.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,172 @@
+
+#ifdef LIBREPLACE_CONFIGURE_TEST_STRPTIME
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#define true 1
+#define false 0
+
+#ifndef __STRING
+#define __STRING(x)    #x
+#endif
+
+/* make printf a no-op */
+#define printf if(0) printf
+
+#else /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */
+
+#include "replace.h"
+#include "system/time.h"
+
+#endif /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */
+
+int libreplace_test_strptime(void)
+{
+	const char *s = "20070414101546Z";
+	char *ret;
+	struct tm t, t2;
+
+	memset(&t, 0, sizeof(t));
+	memset(&t2, 0, sizeof(t2));
+
+	printf("test: strptime\n");
+
+	ret = strptime(s, "%Y%m%d%H%M%S", &t);
+	if ( ret == NULL ) {
+		printf("failure: strptime [\n"
+		       "returned NULL\n"
+		       "]\n");
+		return false;
+	}
+
+	if ( *ret != 'Z' ) {
+		printf("failure: strptime [\n"
+		       "ret doesn't point to 'Z'\n"
+		       "]\n");
+		return false;
+	}
+
+	ret = strptime(s, "%Y%m%d%H%M%SZ", &t2);
+	if ( ret == NULL ) {
+		printf("failure: strptime [\n"
+		       "returned NULL with Z\n"
+		       "]\n");
+		return false;
+	}
+
+	if ( *ret != '\0' ) {
+		printf("failure: strptime [\n"
+		       "ret doesn't point to '\\0'\n"
+		       "]\n");
+		return false;
+	}
+
+#define CMP_TM_ELEMENT(t1,t2,elem) \
+	if (t1.elem != t2.elem) { \
+		printf("failure: strptime [\n" \
+		       "result differs if the format string has a 'Z' at the end\n" \
+		       "element: %s %d != %d\n" \
+		       "]\n", \
+		       __STRING(elen), t1.elem, t2.elem); \
+		return false; \
+	}
+
+	CMP_TM_ELEMENT(t,t2,tm_sec);
+	CMP_TM_ELEMENT(t,t2,tm_min);
+	CMP_TM_ELEMENT(t,t2,tm_hour);
+	CMP_TM_ELEMENT(t,t2,tm_mday);
+	CMP_TM_ELEMENT(t,t2,tm_mon);
+	CMP_TM_ELEMENT(t,t2,tm_year);
+	CMP_TM_ELEMENT(t,t2,tm_wday);
+	CMP_TM_ELEMENT(t,t2,tm_yday);
+	CMP_TM_ELEMENT(t,t2,tm_isdst);
+
+	if (t.tm_sec != 46) {
+		printf("failure: strptime [\n"
+		       "tm_sec: expected: 46, got: %d\n"
+		       "]\n",
+		       t.tm_sec);
+		return false;
+	}
+
+	if (t.tm_min != 15) {
+		printf("failure: strptime [\n"
+		       "tm_min: expected: 15, got: %d\n"
+		       "]\n",
+		       t.tm_min);
+		return false;
+	}
+
+	if (t.tm_hour != 10) {
+		printf("failure: strptime [\n"
+		       "tm_hour: expected: 10, got: %d\n"
+		       "]\n",
+		       t.tm_hour);
+		return false;
+	}
+
+	if (t.tm_mday != 14) {
+		printf("failure: strptime [\n"
+		       "tm_mday: expected: 14, got: %d\n"
+		       "]\n",
+		       t.tm_mday);
+		return false;
+	}
+
+	if (t.tm_mon != 3) {
+		printf("failure: strptime [\n"
+		       "tm_mon: expected: 3, got: %d\n"
+		       "]\n",
+		       t.tm_mon);
+		return false;
+	}
+
+	if (t.tm_year != 107) {
+		printf("failure: strptime [\n"
+		       "tm_year: expected: 107, got: %d\n"
+		       "]\n",
+		       t.tm_year);
+		return false;
+	}
+
+	if (t.tm_wday != 6) { /* saturday */
+		printf("failure: strptime [\n"
+		       "tm_wday: expected: 6, got: %d\n"
+		       "]\n",
+		       t.tm_wday);
+		return false;
+	}
+
+	if (t.tm_yday != 103) {
+		printf("failure: strptime [\n"
+		       "tm_yday: expected: 103, got: %d\n"
+		       "]\n",
+		       t.tm_yday);
+		return false;
+	}
+
+	/* we don't test this as it depends on the host configuration
+	if (t.tm_isdst != 0) {
+		printf("failure: strptime [\n"
+		       "tm_isdst: expected: 0, got: %d\n"
+		       "]\n",
+		       t.tm_isdst);
+		return false;
+	}*/
+
+	printf("success: strptime\n");
+
+	return true;
+}
+
+#ifdef LIBREPLACE_CONFIGURE_TEST_STRPTIME
+int main (void)
+{
+	int ret;
+	ret = libreplace_test_strptime();
+	if (ret == false) return 1;
+	return 0;
+}
+#endif

Added: branches/talloc/experimental/lib/replace/test/testsuite.c
===================================================================
--- branches/talloc/experimental/lib/replace/test/testsuite.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/test/testsuite.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,1108 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   libreplace tests
+
+   Copyright (C) Jelmer Vernooij 2006
+
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+/*
+  we include all the system/ include files here so that libreplace tests
+  them in the build farm
+*/
+#include "system/capability.h"
+#include "system/dir.h"
+#include "system/filesys.h"
+#include "system/glob.h"
+#include "system/iconv.h"
+#include "system/locale.h"
+#include "system/network.h"
+#include "system/passwd.h"
+#include "system/readline.h"
+#include "system/select.h"
+#include "system/shmem.h"
+#include "system/syslog.h"
+#include "system/terminal.h"
+#include "system/time.h"
+#include "system/wait.h"
+#include "system/aio.h"
+
+#define TESTFILE "testfile.dat"
+
+/*
+  test ftruncate() function
+ */
+static int test_ftruncate(void)
+{
+	struct stat st;
+	int fd;
+	const int size = 1234;
+	printf("test: ftruncate\n");
+	unlink(TESTFILE);
+	fd = open(TESTFILE, O_RDWR|O_CREAT, 0600);
+	if (fd == -1) {
+		printf("failure: ftruncate [\n"
+			   "creating '%s' failed - %s\n]\n", TESTFILE, strerror(errno));
+		return false;
+	}
+	if (ftruncate(fd, size) != 0) {
+		printf("failure: ftruncate [\n%s\n]\n", strerror(errno));
+		return false;
+	}
+	if (fstat(fd, &st) != 0) {
+		printf("failure: ftruncate [\nfstat failed - %s\n]\n", strerror(errno));
+		return false;
+	}
+	if (st.st_size != size) {
+		printf("failure: ftruncate [\ngave wrong size %d - expected %d\n]\n",
+		       (int)st.st_size, size);
+		return false;
+	}
+	unlink(TESTFILE);
+	printf("success: ftruncate\n");
+	return true;
+}
+
+/*
+  test strlcpy() function.
+  see http://www.gratisoft.us/todd/papers/strlcpy.html
+ */
+static int test_strlcpy(void)
+{
+	char buf[4];
+	const struct {
+		const char *src;
+		size_t result;
+	} tests[] = {
+		{ "abc", 3 },
+		{ "abcdef", 6 },
+		{ "abcd", 4 },
+		{ "", 0 },
+		{ NULL, 0 }
+	};
+	int i;
+	printf("test: strlcpy\n");
+	for (i=0;tests[i].src;i++) {
+		if (strlcpy(buf, tests[i].src, sizeof(buf)) != tests[i].result) {
+			printf("failure: strlcpy [\ntest %d failed\n]\n", i);
+			return false;
+		}
+	}
+	printf("success: strlcpy\n");
+	return true;
+}
+
+static int test_strlcat(void)
+{
+	char tmp[10];
+	printf("test: strlcat\n");
+	strlcpy(tmp, "", sizeof(tmp));
+	if (strlcat(tmp, "bla", 3) != 3) {
+		printf("failure: strlcat [\ninvalid return code\n]\n");
+		return false;
+	}
+	if (strcmp(tmp, "bl") != 0) {
+		printf("failure: strlcat [\nexpected \"bl\", got \"%s\"\n]\n", 
+			   tmp);
+		return false;
+	}
+
+	strlcpy(tmp, "da", sizeof(tmp));
+	if (strlcat(tmp, "me", 4) != 4) {
+		printf("failure: strlcat [\nexpected \"dam\", got \"%s\"\n]\n",
+			   tmp);
+		return false;
+	}
+
+	printf("success: strlcat\n");
+	return true;
+}
+
+static int test_mktime(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_initgroups(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_memmove(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_strdup(void)
+{
+	char *x;
+	printf("test: strdup\n");
+	x = strdup("bla");
+	if (strcmp("bla", x) != 0) {
+		printf("failure: strdup [\nfailed: expected \"bla\", got \"%s\"\n]\n",
+			   x);
+		return false;
+	}
+	free(x);
+	printf("success: strdup\n");
+	return true;
+}	
+
+static int test_setlinebuf(void)
+{
+	printf("test: setlinebuf\n");
+	setlinebuf(stdout);
+	printf("success: setlinebuf\n");
+	return true;
+}
+
+static int test_vsyslog(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_timegm(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_setenv(void)
+{
+#define TEST_SETENV(key, value, overwrite, result) do { \
+	int _ret; \
+	char *_v; \
+	_ret = setenv(key, value, overwrite); \
+	if (_ret != 0) { \
+		printf("failure: setenv [\n" \
+			"setenv(%s, %s, %d) failed\n" \
+			"]\n", \
+			key, value, overwrite); \
+		return false; \
+	} \
+	_v=getenv(key); \
+	if (!_v) { \
+		printf("failure: setenv [\n" \
+			"getenv(%s) returned NULL\n" \
+			"]\n", \
+			key); \
+		return false; \
+	} \
+	if (strcmp(result, _v) != 0) { \
+		printf("failure: setenv [\n" \
+			"getenv(%s): '%s' != '%s'\n" \
+			"]\n", \
+			key, result, _v); \
+		return false; \
+	} \
+} while(0)
+
+#define TEST_UNSETENV(key) do { \
+	char *_v; \
+	unsetenv(key); \
+	_v=getenv(key); \
+	if (_v) { \
+		printf("failure: setenv [\n" \
+			"getenv(%s): NULL != '%s'\n" \
+			"]\n", \
+			SETENVTEST_KEY, _v); \
+		return false; \
+	} \
+} while (0)
+
+#define SETENVTEST_KEY "SETENVTESTKEY"
+#define SETENVTEST_VAL "SETENVTESTVAL"
+
+	printf("test: setenv\n");
+	TEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL"1", 0, SETENVTEST_VAL"1");
+	TEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL"2", 0, SETENVTEST_VAL"1");
+	TEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL"3", 1, SETENVTEST_VAL"3");
+	TEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL"4", 1, SETENVTEST_VAL"4");
+	TEST_UNSETENV(SETENVTEST_KEY);
+	TEST_UNSETENV(SETENVTEST_KEY);
+	TEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL"5", 0, SETENVTEST_VAL"5");
+	TEST_UNSETENV(SETENVTEST_KEY);
+	TEST_UNSETENV(SETENVTEST_KEY);
+	printf("success: setenv\n");
+	return true;
+}
+
+static int test_strndup(void)
+{
+	char *x;
+	printf("test: strndup\n");
+	x = strndup("bla", 0);
+	if (strcmp(x, "") != 0) {
+		printf("failure: strndup [\ninvalid\n]\n");
+		return false;
+	}
+	free(x);
+	x = strndup("bla", 2);
+	if (strcmp(x, "bl") != 0) {
+		printf("failure: strndup [\ninvalid\n]\n");
+		return false;
+	}
+	free(x);
+	x = strndup("bla", 10);
+	if (strcmp(x, "bla") != 0) {
+		printf("failure: strndup [\ninvalid\n]\n");
+		return false;
+	}
+	free(x);
+	printf("success: strndup\n");
+	return true;
+}
+
+static int test_strnlen(void)
+{
+	printf("test: strnlen\n");
+	if (strnlen("bla", 2) != 2) {
+		printf("failure: strnlen [\nunexpected length\n]\n");
+		return false;
+	}
+
+	if (strnlen("some text\n", 0) != 0) {
+		printf("failure: strnlen [\nunexpected length\n]\n");
+		return false;
+	}
+
+	if (strnlen("some text", 20) != 9) {
+		printf("failure: strnlen [\nunexpected length\n]\n");
+		return false;
+	}
+
+	printf("success: strnlen\n");
+	return true;
+}
+
+static int test_waitpid(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_seteuid(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_setegid(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_asprintf(void)
+{
+	char *x;
+	printf("test: asprintf\n");
+	if (asprintf(&x, "%d", 9) != 1) {
+		printf("failure: asprintf [\ngenerate asprintf\n]\n");
+		return false;
+	}
+	if (strcmp(x, "9") != 0) {
+		printf("failure: asprintf [\ngenerate asprintf\n]\n");
+		return false;
+	}
+	if (asprintf(&x, "dat%s", "a") != 4) {
+		printf("failure: asprintf [\ngenerate asprintf\n]\n");
+		return false;
+	}
+	if (strcmp(x, "data") != 0) {
+		printf("failure: asprintf [\ngenerate asprintf\n]\n");
+		return false;
+	}
+	printf("success: asprintf\n");
+	return true;
+}
+
+static int test_snprintf(void)
+{
+	char tmp[10];
+	printf("test: snprintf\n");
+	if (snprintf(tmp, 3, "foo%d", 9) != 4) {
+		printf("failure: snprintf [\nsnprintf return code failed\n]\n");
+		return false;
+	}
+
+	if (strcmp(tmp, "fo") != 0) {
+		printf("failure: snprintf [\nsnprintf failed\n]\n");
+		return false;
+	}
+
+	printf("success: snprintf\n");
+	return true;
+}
+
+static int test_vasprintf(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_vsnprintf(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_opendir(void)
+{
+	/* FIXME */
+	return true;
+}
+
+extern int test_readdir_os2_delete(void);
+
+static int test_readdir(void)
+{
+	printf("test: readdir\n");
+	if (test_readdir_os2_delete() != 0) {
+		return false;
+	}
+	printf("success: readdir\n");
+	return true;
+}
+
+static int test_telldir(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_seekdir(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_dlopen(void)
+{
+	/* FIXME: test dlopen, dlsym, dlclose, dlerror */
+	return true;
+}
+
+
+static int test_chroot(void)
+{
+	/* FIXME: chroot() */
+	return true;
+}
+
+static int test_bzero(void)
+{
+	/* FIXME: bzero */
+	return true;
+}
+
+static int test_strerror(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_errno(void)
+{
+	printf("test: errno\n");
+	errno = 3;
+	if (errno != 3) {
+		printf("failure: errno [\nerrno failed\n]\n");
+		return false;
+	}
+
+	printf("success: errno\n");
+	return true;
+}
+
+static int test_mkdtemp(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_mkstemp(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_pread(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_pwrite(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_getpass(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_inet_ntoa(void)
+{
+	/* FIXME */
+	return true;
+}
+
+#define TEST_STRTO_X(type,fmt,func,str,base,res,diff,rrnoo) do {\
+	type _v; \
+	char _s[64]; \
+	char *_p = NULL;\
+	char *_ep = NULL; \
+	strlcpy(_s, str, sizeof(_s));\
+	if (diff >= 0) { \
+		_ep = &_s[diff]; \
+	} \
+	errno = 0; \
+	_v = func(_s, &_p, base); \
+	if (errno != rrnoo) { \
+		printf("failure: %s [\n" \
+		       "\t%s\n" \
+		       "\t%s(\"%s\",%d,%d): " fmt " (=/!)= " fmt "\n" \
+		       "\terrno: %d != %d\n" \
+		       "]\n", \
+		        __STRING(func), __location__, __STRING(func), \
+		       str, diff, base, res, _v, rrnoo, errno); \
+		return false; \
+	} else if (_v != res) { \
+		printf("failure: %s [\n" \
+		       "\t%s\n" \
+		       "\t%s(\"%s\",%d,%d): " fmt " != " fmt "\n" \
+		       "]\n", \
+		       __STRING(func), __location__, __STRING(func), \
+		       str, diff, base, res, _v); \
+		return false; \
+	} else if (_p != _ep) { \
+		printf("failure: %s [\n" \
+		       "\t%s\n" \
+		       "\t%s(\"%s\",%d,%d): " fmt " (=/!)= " fmt "\n" \
+		       "\tptr: %p - %p = %d != %d\n" \
+		       "]\n", \
+		       __STRING(func), __location__, __STRING(func), \
+		       str, diff, base, res, _v, _ep, _p, (int)(diff - (_ep - _p)), diff); \
+		return false; \
+	} \
+} while (0)
+
+static int test_strtoll(void)
+{
+	printf("test: strtoll\n");
+
+#define TEST_STRTOLL(str,base,res,diff,errnoo) TEST_STRTO_X(long long int, "%lld", strtoll,str,base,res,diff,errnoo)
+
+	TEST_STRTOLL("15",	10,	15LL,	2, 0);
+	TEST_STRTOLL("  15",	10,	15LL,	4, 0);
+	TEST_STRTOLL("15",	0,	15LL,	2, 0);
+	TEST_STRTOLL(" 15 ",	0,	15LL,	3, 0);
+	TEST_STRTOLL("+15",	10,	15LL,	3, 0);
+	TEST_STRTOLL("  +15",	10,	15LL,	5, 0);
+	TEST_STRTOLL("+15",	0,	15LL,	3, 0);
+	TEST_STRTOLL(" +15 ",	0,	15LL,	4, 0);
+	TEST_STRTOLL("-15",	10,	-15LL,	3, 0);
+	TEST_STRTOLL("  -15",	10,	-15LL,	5, 0);
+	TEST_STRTOLL("-15",	0,	-15LL,	3, 0);
+	TEST_STRTOLL(" -15 ",	0,	-15LL,	4, 0);
+	TEST_STRTOLL("015",	10,	15LL,	3, 0);
+	TEST_STRTOLL("  015",	10,	15LL,	5, 0);
+	TEST_STRTOLL("015",	0,	13LL,	3, 0);
+	TEST_STRTOLL("  015",	0,	13LL,	5, 0);
+	TEST_STRTOLL("0x15",	10,	0LL,	1, 0);
+	TEST_STRTOLL("  0x15",	10,	0LL,	3, 0);
+	TEST_STRTOLL("0x15",	0,	21LL,	4, 0);
+	TEST_STRTOLL("  0x15",	0,	21LL,	6, 0);
+
+	TEST_STRTOLL("10",	16,	16LL,	2, 0);
+	TEST_STRTOLL("  10 ",	16,	16LL,	4, 0);
+	TEST_STRTOLL("0x10",	16,	16LL,	4, 0);
+	TEST_STRTOLL("0x10",	0,	16LL,	4, 0);
+	TEST_STRTOLL(" 0x10 ",	0,	16LL,	5, 0);
+	TEST_STRTOLL("+10",	16,	16LL,	3, 0);
+	TEST_STRTOLL("  +10 ",	16,	16LL,	5, 0);
+	TEST_STRTOLL("+0x10",	16,	16LL,	5, 0);
+	TEST_STRTOLL("+0x10",	0,	16LL,	5, 0);
+	TEST_STRTOLL(" +0x10 ",	0,	16LL,	6, 0);
+	TEST_STRTOLL("-10",	16,	-16LL,	3, 0);
+	TEST_STRTOLL("  -10 ",	16,	-16LL,	5, 0);
+	TEST_STRTOLL("-0x10",	16,	-16LL,	5, 0);
+	TEST_STRTOLL("-0x10",	0,	-16LL,	5, 0);
+	TEST_STRTOLL(" -0x10 ",	0,	-16LL,	6, 0);
+	TEST_STRTOLL("010",	16,	16LL,	3, 0);
+	TEST_STRTOLL("  010 ",	16,	16LL,	5, 0);
+	TEST_STRTOLL("-010",	16,	-16LL,	4, 0);
+
+	TEST_STRTOLL("11",	8,	9LL,	2, 0);
+	TEST_STRTOLL("011",	8,	9LL,	3, 0);
+	TEST_STRTOLL("011",	0,	9LL,	3, 0);
+	TEST_STRTOLL("-11",	8,	-9LL,	3, 0);
+	TEST_STRTOLL("-011",	8,	-9LL,	4, 0);
+	TEST_STRTOLL("-011",	0,	-9LL,	4, 0);
+
+	TEST_STRTOLL("011",	8,	9LL,	3, 0);
+	TEST_STRTOLL("011",	0,	9LL,	3, 0);
+	TEST_STRTOLL("-11",	8,	-9LL,	3, 0);
+	TEST_STRTOLL("-011",	8,	-9LL,	4, 0);
+	TEST_STRTOLL("-011",	0,	-9LL,	4, 0);
+
+	TEST_STRTOLL("Text",	0,	0LL,	0, 0);
+
+	TEST_STRTOLL("9223372036854775807",	10,	9223372036854775807LL,	19, 0);
+	TEST_STRTOLL("9223372036854775807",	0,	9223372036854775807LL,	19, 0);
+	TEST_STRTOLL("9223372036854775808",	0,	9223372036854775807LL,	19, ERANGE);
+	TEST_STRTOLL("9223372036854775808",	10,	9223372036854775807LL,	19, ERANGE);
+	TEST_STRTOLL("0x7FFFFFFFFFFFFFFF",	0,	9223372036854775807LL,	18, 0);
+	TEST_STRTOLL("0x7FFFFFFFFFFFFFFF",	16,	9223372036854775807LL,	18, 0);
+	TEST_STRTOLL("7FFFFFFFFFFFFFFF",	16,	9223372036854775807LL,	16, 0);
+	TEST_STRTOLL("0x8000000000000000",	0,	9223372036854775807LL,	18, ERANGE);
+	TEST_STRTOLL("0x8000000000000000",	16,	9223372036854775807LL,	18, ERANGE);
+	TEST_STRTOLL("80000000000000000",	16,	9223372036854775807LL,	17, ERANGE);
+	TEST_STRTOLL("0777777777777777777777",	0,	9223372036854775807LL,	22, 0);
+	TEST_STRTOLL("0777777777777777777777",	8,	9223372036854775807LL,	22, 0);
+	TEST_STRTOLL("777777777777777777777",	8,	9223372036854775807LL,	21, 0);
+	TEST_STRTOLL("01000000000000000000000",	0,	9223372036854775807LL,	23, ERANGE);
+	TEST_STRTOLL("01000000000000000000000",	8,	9223372036854775807LL,	23, ERANGE);
+	TEST_STRTOLL("1000000000000000000000",	8,	9223372036854775807LL,	22, ERANGE);
+
+	TEST_STRTOLL("-9223372036854775808",	10,	-9223372036854775807LL -1,	20, 0);
+	TEST_STRTOLL("-9223372036854775808",	0,	-9223372036854775807LL -1,	20, 0);
+	TEST_STRTOLL("-9223372036854775809",	0,	-9223372036854775807LL -1,	20, ERANGE);
+	TEST_STRTOLL("-9223372036854775809",	10,	-9223372036854775807LL -1,	20, ERANGE);
+	TEST_STRTOLL("-0x8000000000000000",	0,	-9223372036854775807LL -1,	19, 0);
+	TEST_STRTOLL("-0x8000000000000000",	16,	-9223372036854775807LL -1,	19, 0);
+	TEST_STRTOLL("-8000000000000000",	16,	-9223372036854775807LL -1,	17, 0);
+	TEST_STRTOLL("-0x8000000000000001",	0,	-9223372036854775807LL -1,	19, ERANGE);
+	TEST_STRTOLL("-0x8000000000000001",	16,	-9223372036854775807LL -1,	19, ERANGE);
+	TEST_STRTOLL("-80000000000000001",	16,	-9223372036854775807LL -1,	18, ERANGE);
+	TEST_STRTOLL("-01000000000000000000000",0,	-9223372036854775807LL -1,	24, 0);
+	TEST_STRTOLL("-01000000000000000000000",8,	-9223372036854775807LL -1,	24, 0);
+	TEST_STRTOLL("-1000000000000000000000",	8,	-9223372036854775807LL -1,	23, 0);
+	TEST_STRTOLL("-01000000000000000000001",0,	-9223372036854775807LL -1,	24, ERANGE);
+	TEST_STRTOLL("-01000000000000000000001",8,	-9223372036854775807LL -1,	24, ERANGE);
+	TEST_STRTOLL("-1000000000000000000001",	8,	-9223372036854775807LL -1,	23, ERANGE);
+
+	printf("success: strtoll\n");
+	return true;
+}
+
+static int test_strtoull(void)
+{
+	printf("test: strtoull\n");
+
+#define TEST_STRTOULL(str,base,res,diff,errnoo) TEST_STRTO_X(long long unsigned int,"%llu",strtoull,str,base,res,diff,errnoo)
+
+	TEST_STRTOULL("15",	10,	15LLU,	2, 0);
+	TEST_STRTOULL("  15",	10,	15LLU,	4, 0);
+	TEST_STRTOULL("15",	0,	15LLU,	2, 0);
+	TEST_STRTOULL(" 15 ",	0,	15LLU,	3, 0);
+	TEST_STRTOULL("+15",	10,	15LLU,	3, 0);
+	TEST_STRTOULL("  +15",	10,	15LLU,	5, 0);
+	TEST_STRTOULL("+15",	0,	15LLU,	3, 0);
+	TEST_STRTOULL(" +15 ",	0,	15LLU,	4, 0);
+	TEST_STRTOULL("-15",	10,	18446744073709551601LLU,	3, 0);
+	TEST_STRTOULL("  -15",	10,	18446744073709551601LLU,	5, 0);
+	TEST_STRTOULL("-15",	0,	18446744073709551601LLU,	3, 0);
+	TEST_STRTOULL(" -15 ",	0,	18446744073709551601LLU,	4, 0);
+	TEST_STRTOULL("015",	10,	15LLU,	3, 0);
+	TEST_STRTOULL("  015",	10,	15LLU,	5, 0);
+	TEST_STRTOULL("015",	0,	13LLU,	3, 0);
+	TEST_STRTOULL("  015",	0,	13LLU,	5, 0);
+	TEST_STRTOULL("0x15",	10,	0LLU,	1, 0);
+	TEST_STRTOULL("  0x15",	10,	0LLU,	3, 0);
+	TEST_STRTOULL("0x15",	0,	21LLU,	4, 0);
+	TEST_STRTOULL("  0x15",	0,	21LLU,	6, 0);
+
+	TEST_STRTOULL("10",	16,	16LLU,	2, 0);
+	TEST_STRTOULL("  10 ",	16,	16LLU,	4, 0);
+	TEST_STRTOULL("0x10",	16,	16LLU,	4, 0);
+	TEST_STRTOULL("0x10",	0,	16LLU,	4, 0);
+	TEST_STRTOULL(" 0x10 ",	0,	16LLU,	5, 0);
+	TEST_STRTOULL("+10",	16,	16LLU,	3, 0);
+	TEST_STRTOULL("  +10 ",	16,	16LLU,	5, 0);
+	TEST_STRTOULL("+0x10",	16,	16LLU,	5, 0);
+	TEST_STRTOULL("+0x10",	0,	16LLU,	5, 0);
+	TEST_STRTOULL(" +0x10 ",	0,	16LLU,	6, 0);
+	TEST_STRTOULL("-10",	16,	-16LLU,	3, 0);
+	TEST_STRTOULL("  -10 ",	16,	-16LLU,	5, 0);
+	TEST_STRTOULL("-0x10",	16,	-16LLU,	5, 0);
+	TEST_STRTOULL("-0x10",	0,	-16LLU,	5, 0);
+	TEST_STRTOULL(" -0x10 ",	0,	-16LLU,	6, 0);
+	TEST_STRTOULL("010",	16,	16LLU,	3, 0);
+	TEST_STRTOULL("  010 ",	16,	16LLU,	5, 0);
+	TEST_STRTOULL("-010",	16,	-16LLU,	4, 0);
+
+	TEST_STRTOULL("11",	8,	9LLU,	2, 0);
+	TEST_STRTOULL("011",	8,	9LLU,	3, 0);
+	TEST_STRTOULL("011",	0,	9LLU,	3, 0);
+	TEST_STRTOULL("-11",	8,	-9LLU,	3, 0);
+	TEST_STRTOULL("-011",	8,	-9LLU,	4, 0);
+	TEST_STRTOULL("-011",	0,	-9LLU,	4, 0);
+
+	TEST_STRTOULL("011",	8,	9LLU,	3, 0);
+	TEST_STRTOULL("011",	0,	9LLU,	3, 0);
+	TEST_STRTOULL("-11",	8,	-9LLU,	3, 0);
+	TEST_STRTOULL("-011",	8,	-9LLU,	4, 0);
+	TEST_STRTOULL("-011",	0,	-9LLU,	4, 0);
+
+	TEST_STRTOULL("Text",	0,	0LLU,	0, 0);
+
+	TEST_STRTOULL("9223372036854775807",	10,	9223372036854775807LLU,	19, 0);
+	TEST_STRTOULL("9223372036854775807",	0,	9223372036854775807LLU,	19, 0);
+	TEST_STRTOULL("9223372036854775808",	0,	9223372036854775808LLU,	19, 0);
+	TEST_STRTOULL("9223372036854775808",	10,	9223372036854775808LLU,	19, 0);
+	TEST_STRTOULL("0x7FFFFFFFFFFFFFFF",	0,	9223372036854775807LLU,	18, 0);
+	TEST_STRTOULL("0x7FFFFFFFFFFFFFFF",	16,	9223372036854775807LLU,	18, 0);
+	TEST_STRTOULL("7FFFFFFFFFFFFFFF",	16,	9223372036854775807LLU,	16, 0);
+	TEST_STRTOULL("0x8000000000000000",	0,	9223372036854775808LLU,	18, 0);
+	TEST_STRTOULL("0x8000000000000000",	16,	9223372036854775808LLU,	18, 0);
+	TEST_STRTOULL("8000000000000000",	16,	9223372036854775808LLU,	16, 0);
+	TEST_STRTOULL("0777777777777777777777",	0,	9223372036854775807LLU,	22, 0);
+	TEST_STRTOULL("0777777777777777777777",	8,	9223372036854775807LLU,	22, 0);
+	TEST_STRTOULL("777777777777777777777",	8,	9223372036854775807LLU,	21, 0);
+	TEST_STRTOULL("01000000000000000000000",0,	9223372036854775808LLU,	23, 0);
+	TEST_STRTOULL("01000000000000000000000",8,	9223372036854775808LLU,	23, 0);
+	TEST_STRTOULL("1000000000000000000000",	8,	9223372036854775808LLU,	22, 0);
+
+	TEST_STRTOULL("-9223372036854775808",	10,	9223372036854775808LLU,	20, 0);
+	TEST_STRTOULL("-9223372036854775808",	0,	9223372036854775808LLU,	20, 0);
+	TEST_STRTOULL("-9223372036854775809",	0,	9223372036854775807LLU,	20, 0);
+	TEST_STRTOULL("-9223372036854775809",	10,	9223372036854775807LLU,	20, 0);
+	TEST_STRTOULL("-0x8000000000000000",	0,	9223372036854775808LLU,	19, 0);
+	TEST_STRTOULL("-0x8000000000000000",	16,	9223372036854775808LLU,	19, 0);
+	TEST_STRTOULL("-8000000000000000",	16,	9223372036854775808LLU,	17, 0);
+	TEST_STRTOULL("-0x8000000000000001",	0,	9223372036854775807LLU,	19, 0);
+	TEST_STRTOULL("-0x8000000000000001",	16,	9223372036854775807LLU,	19, 0);
+	TEST_STRTOULL("-8000000000000001",	16,	9223372036854775807LLU,	17, 0);
+	TEST_STRTOULL("-01000000000000000000000",0,	9223372036854775808LLU,	24, 0);
+	TEST_STRTOULL("-01000000000000000000000",8,	9223372036854775808LLU,	24, 0);
+	TEST_STRTOULL("-1000000000000000000000",8,	9223372036854775808LLU,	23, 0);
+	TEST_STRTOULL("-01000000000000000000001",0,	9223372036854775807LLU,	24, 0);
+	TEST_STRTOULL("-01000000000000000000001",8,	9223372036854775807LLU,	24, 0);
+	TEST_STRTOULL("-1000000000000000000001",8,	9223372036854775807LLU,	23, 0);
+
+	TEST_STRTOULL("18446744073709551615",	0,	18446744073709551615LLU,	20, 0);
+	TEST_STRTOULL("18446744073709551615",	10,	18446744073709551615LLU,	20, 0);
+	TEST_STRTOULL("18446744073709551616",	0,	18446744073709551615LLU,	20, ERANGE);
+	TEST_STRTOULL("18446744073709551616",	10,	18446744073709551615LLU,	20, ERANGE);
+	TEST_STRTOULL("0xFFFFFFFFFFFFFFFF",	0,	18446744073709551615LLU,	18, 0);
+	TEST_STRTOULL("0xFFFFFFFFFFFFFFFF",	16,	18446744073709551615LLU,	18, 0);
+	TEST_STRTOULL("FFFFFFFFFFFFFFFF",	16,	18446744073709551615LLU,	16, 0);
+	TEST_STRTOULL("0x10000000000000000",	0,	18446744073709551615LLU,	19, ERANGE);
+	TEST_STRTOULL("0x10000000000000000",	16,	18446744073709551615LLU,	19, ERANGE);
+	TEST_STRTOULL("10000000000000000",	16,	18446744073709551615LLU,	17, ERANGE);
+	TEST_STRTOULL("01777777777777777777777",0,	18446744073709551615LLU,	23, 0);
+	TEST_STRTOULL("01777777777777777777777",8,	18446744073709551615LLU,	23, 0);
+	TEST_STRTOULL("1777777777777777777777",	8,	18446744073709551615LLU,	22, 0);
+	TEST_STRTOULL("02000000000000000000000",0,	18446744073709551615LLU,	23, ERANGE);
+	TEST_STRTOULL("02000000000000000000000",8,	18446744073709551615LLU,	23, ERANGE);
+	TEST_STRTOULL("2000000000000000000000",	8,	18446744073709551615LLU,	22, ERANGE);
+
+	TEST_STRTOULL("-18446744073709551615",	0,	1LLU,				21, 0);
+	TEST_STRTOULL("-18446744073709551615",	10,	1LLU,				21, 0);
+	TEST_STRTOULL("-18446744073709551616",	0,	18446744073709551615LLU,	21, ERANGE);
+	TEST_STRTOULL("-18446744073709551616",	10,	18446744073709551615LLU,	21, ERANGE);
+	TEST_STRTOULL("-0xFFFFFFFFFFFFFFFF",	0,	1LLU,				19, 0);
+	TEST_STRTOULL("-0xFFFFFFFFFFFFFFFF",	16,	1LLU,				19, 0);
+	TEST_STRTOULL("-FFFFFFFFFFFFFFFF",	16,	1LLU,				17, 0);
+	TEST_STRTOULL("-0x10000000000000000",	0,	18446744073709551615LLU,	20, ERANGE);
+	TEST_STRTOULL("-0x10000000000000000",	16,	18446744073709551615LLU,	20, ERANGE);
+	TEST_STRTOULL("-10000000000000000",	16,	18446744073709551615LLU,	18, ERANGE);
+	TEST_STRTOULL("-01777777777777777777777",0,	1LLU,				24, 0);
+	TEST_STRTOULL("-01777777777777777777777",8,	1LLU,				24, 0);
+	TEST_STRTOULL("-1777777777777777777777",8,	1LLU,				23, 0);
+	TEST_STRTOULL("-02000000000000000000000",0,	18446744073709551615LLU,	24, ERANGE);
+	TEST_STRTOULL("-02000000000000000000000",8,	18446744073709551615LLU,	24, ERANGE);
+	TEST_STRTOULL("-2000000000000000000000",8,	18446744073709551615LLU,	23, ERANGE);
+
+	printf("success: strtoull\n");
+	return true;
+}
+
+/* 
+FIXME:
+Types:
+bool
+socklen_t
+uint{8,16,32,64}_t
+int{8,16,32,64}_t
+intptr_t
+
+Constants:
+PATH_NAME_MAX
+UINT{16,32,64}_MAX
+INT32_MAX
+*/
+
+static int test_va_copy(void)
+{
+	/* FIXME */
+	return true;
+}
+
+static int test_FUNCTION(void)
+{
+	printf("test: FUNCTION\n");
+	if (strcmp(__FUNCTION__, "test_FUNCTION") != 0) {
+		printf("failure: FAILURE [\nFAILURE invalid\n]\n");
+		return false;
+	}
+	printf("success: FUNCTION\n");
+	return true;
+}
+
+static int test_MIN(void)
+{
+	printf("test: MIN\n");
+	if (MIN(20, 1) != 1) {
+		printf("failure: MIN [\nMIN invalid\n]\n");
+		return false;
+	}
+	if (MIN(1, 20) != 1) {
+		printf("failure: MIN [\nMIN invalid\n]\n");
+		return false;
+	}
+	printf("success: MIN\n");
+	return true;
+}
+
+static int test_MAX(void)
+{
+	printf("test: MAX\n");
+	if (MAX(20, 1) != 20) {
+		printf("failure: MAX [\nMAX invalid\n]\n");
+		return false;
+	}
+	if (MAX(1, 20) != 20) {
+		printf("failure: MAX [\nMAX invalid\n]\n");
+		return false;
+	}
+	printf("success: MAX\n");
+	return true;
+}
+
+static int test_socketpair(void)
+{
+	int sock[2];
+	char buf[20];
+
+	printf("test: socketpair\n");
+
+	if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) == -1) {
+		printf("failure: socketpair [\n"
+			   "socketpair() failed\n"
+			   "]\n");
+		return false;
+	}
+
+	if (write(sock[1], "automatisch", 12) == -1) {
+		printf("failure: socketpair [\n"
+			   "write() failed: %s\n"
+			   "]\n", strerror(errno));
+		return false;
+	}
+
+	if (read(sock[0], buf, 12) == -1) {
+		printf("failure: socketpair [\n"
+			   "read() failed: %s\n"
+			   "]\n", strerror(errno));
+		return false;
+	}
+
+	if (strcmp(buf, "automatisch") != 0) {
+		printf("failure: socketpair [\n"
+			   "expected: automatisch, got: %s\n"
+			   "]\n", buf);
+		return false;
+	}
+
+	printf("success: socketpair\n");
+
+	return true;
+}
+
+extern int libreplace_test_strptime(void);
+
+static int test_strptime(void)
+{
+	return libreplace_test_strptime();
+}
+
+extern int getifaddrs_test(void);
+
+static int test_getifaddrs(void)
+{
+
+	printf("test: getifaddrs\n");
+
+	if (getifaddrs_test() != 0) {
+		printf("failure: getifaddrs\n");
+		return false;
+	}
+
+	printf("success: getifaddrs\n");
+	return true;
+}
+
+static int test_utime(void)
+{
+	struct utimbuf u;
+	struct stat st1, st2, st3;
+	int fd;
+
+	printf("test: utime\n");
+	unlink(TESTFILE);
+
+	fd = open(TESTFILE, O_RDWR|O_CREAT, 0600);
+	if (fd == -1) {
+		printf("failure: utime [\n"
+		       "creating '%s' failed - %s\n]\n",
+		       TESTFILE, strerror(errno));
+		return false;
+	}
+
+	if (fstat(fd, &st1) != 0) {
+		printf("failure: utime [\n"
+		       "fstat (1) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	u.actime = st1.st_atime + 300;
+	u.modtime = st1.st_mtime - 300;
+	if (utime(TESTFILE, &u) != 0) {
+		printf("failure: utime [\n"
+		       "utime(&u) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	if (fstat(fd, &st2) != 0) {
+		printf("failure: utime [\n"
+		       "fstat (2) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	if (utime(TESTFILE, NULL) != 0) {
+		printf("failure: utime [\n"
+		       "utime(NULL) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	if (fstat(fd, &st3) != 0) {
+		printf("failure: utime [\n"
+		       "fstat (3) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+#define CMP_VAL(a,c,b) do { \
+	if (a c b) { \
+		printf("failure: utime [\n" \
+		       "%s: %s(%d) %s %s(%d)\n]\n", \
+		       __location__, \
+		       #a, (int)a, #c, #b, (int)b); \
+		return false; \
+	} \
+} while(0)
+#define EQUAL_VAL(a,b) CMP_VAL(a,!=,b)
+#define GREATER_VAL(a,b) CMP_VAL(a,<=,b)
+#define LESSER_VAL(a,b) CMP_VAL(a,>=,b)
+
+	EQUAL_VAL(st2.st_atime, st1.st_atime + 300);
+	EQUAL_VAL(st2.st_mtime, st1.st_mtime - 300);
+	LESSER_VAL(st3.st_atime, st2.st_atime);
+	GREATER_VAL(st3.st_mtime, st2.st_mtime);
+
+#undef CMP_VAL
+#undef EQUAL_VAL
+#undef GREATER_VAL
+#undef LESSER_VAL
+
+	unlink(TESTFILE);
+	printf("success: utime\n");
+	return true;
+}
+
+static int test_utimes(void)
+{
+	struct timeval tv[2];
+	struct stat st1, st2;
+	int fd;
+
+	printf("test: utimes\n");
+	unlink(TESTFILE);
+
+	fd = open(TESTFILE, O_RDWR|O_CREAT, 0600);
+	if (fd == -1) {
+		printf("failure: utimes [\n"
+		       "creating '%s' failed - %s\n]\n",
+		       TESTFILE, strerror(errno));
+		return false;
+	}
+
+	if (fstat(fd, &st1) != 0) {
+		printf("failure: utimes [\n"
+		       "fstat (1) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	ZERO_STRUCT(tv);
+	tv[0].tv_sec = st1.st_atime + 300;
+	tv[1].tv_sec = st1.st_mtime - 300;
+	if (utimes(TESTFILE, tv) != 0) {
+		printf("failure: utimes [\n"
+		       "utimes(tv) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+	if (fstat(fd, &st2) != 0) {
+		printf("failure: utimes [\n"
+		       "fstat (2) failed - %s\n]\n",
+		       strerror(errno));
+		return false;
+	}
+
+#define EQUAL_VAL(a,b) do { \
+	if (a != b) { \
+		printf("failure: utimes [\n" \
+		       "%s: %s(%d) != %s(%d)\n]\n", \
+		       __location__, \
+		       #a, (int)a, #b, (int)b); \
+		return false; \
+	} \
+} while(0)
+
+	EQUAL_VAL(st2.st_atime, st1.st_atime + 300);
+	EQUAL_VAL(st2.st_mtime, st1.st_mtime - 300);
+
+#undef EQUAL_VAL
+
+	unlink(TESTFILE);
+	printf("success: utimes\n");
+	return true;
+}
+
+static int test_memmem(void)
+{
+	char *s;
+
+	printf("test: memmem\n");
+
+	s = memmem("foo", 3, "fo", 2);
+	if (strcmp(s, "foo") != 0) {
+		printf(__location__ ": Failed memmem\n");
+		return false;
+	}
+
+	s = memmem("foo", 3, "", 0);
+	/* it is allowable for this to return NULL (as happens on
+	   FreeBSD) */
+	if (s && strcmp(s, "foo") != 0) {
+		printf(__location__ ": Failed memmem\n");
+		return false;
+	}
+
+	s = memmem("foo", 4, "o", 1);
+	if (strcmp(s, "oo") != 0) {
+		printf(__location__ ": Failed memmem\n");
+		return false;
+	}
+
+	s = memmem("foobarfodx", 11, "fod", 3);
+	if (strcmp(s, "fodx") != 0) {
+		printf(__location__ ": Failed memmem\n");
+		return false;
+	}
+
+	printf("success: memmem\n");
+
+	return true;
+}
+
+
+struct torture_context;
+bool torture_local_replace(struct torture_context *ctx)
+{
+	bool ret = true;
+	ret &= test_ftruncate();
+	ret &= test_strlcpy();
+	ret &= test_strlcat();
+	ret &= test_mktime();
+	ret &= test_initgroups();
+	ret &= test_memmove();
+	ret &= test_strdup();
+	ret &= test_setlinebuf();
+	ret &= test_vsyslog();
+	ret &= test_timegm();
+	ret &= test_setenv();
+	ret &= test_strndup();
+	ret &= test_strnlen();
+	ret &= test_waitpid();
+	ret &= test_seteuid();
+	ret &= test_setegid();
+	ret &= test_asprintf();
+	ret &= test_snprintf();
+	ret &= test_vasprintf();
+	ret &= test_vsnprintf();
+	ret &= test_opendir();
+	ret &= test_readdir();
+	ret &= test_telldir();
+	ret &= test_seekdir();
+	ret &= test_dlopen();
+	ret &= test_chroot();
+	ret &= test_bzero();
+	ret &= test_strerror();
+	ret &= test_errno();
+	ret &= test_mkdtemp();
+	ret &= test_mkstemp();
+	ret &= test_pread();
+	ret &= test_pwrite();
+	ret &= test_getpass();
+	ret &= test_inet_ntoa();
+	ret &= test_strtoll();
+	ret &= test_strtoull();
+	ret &= test_va_copy();
+	ret &= test_FUNCTION();
+	ret &= test_MIN();
+	ret &= test_MAX();
+	ret &= test_socketpair();
+	ret &= test_strptime();
+	ret &= test_getifaddrs();
+	ret &= test_utime();
+	ret &= test_utimes();
+	ret &= test_memmem();
+
+	return ret;
+}

Added: branches/talloc/experimental/lib/replace/timegm.c
===================================================================
--- branches/talloc/experimental/lib/replace/timegm.c	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/timegm.c	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 1997 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden). 
+ * 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 the Institute 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 INSTITUTE 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 INSTITUTE 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. 
+ */
+
+/*
+  adapted for Samba4 by Andrew Tridgell
+*/
+
+#include "replace.h"
+#include "system/time.h"
+
+static int is_leap(unsigned y)
+{
+	y += 1900;
+	return (y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0);
+}
+
+time_t rep_timegm(struct tm *tm)
+{
+	static const unsigned ndays[2][12] ={
+		{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+		{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
+	time_t res = 0;
+	unsigned i;
+
+	if (tm->tm_mon > 12 ||
+	    tm->tm_mon < 0 ||
+	    tm->tm_mday > 31 ||
+	    tm->tm_min > 60 ||
+	    tm->tm_sec > 60 ||
+	    tm->tm_hour > 24) {
+		/* invalid tm structure */
+		return 0;
+	}
+	
+	for (i = 70; i < tm->tm_year; ++i)
+		res += is_leap(i) ? 366 : 365;
+	
+	for (i = 0; i < tm->tm_mon; ++i)
+		res += ndays[is_leap(tm->tm_year)][i];
+	res += tm->tm_mday - 1;
+	res *= 24;
+	res += tm->tm_hour;
+	res *= 60;
+	res += tm->tm_min;
+	res *= 60;
+	res += tm->tm_sec;
+	return res;
+}

Added: branches/talloc/experimental/lib/replace/timegm.m4
===================================================================
--- branches/talloc/experimental/lib/replace/timegm.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/timegm.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1 @@
+AC_CHECK_FUNCS(timegm,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/timegm.o"])

Added: branches/talloc/experimental/lib/replace/win32.m4
===================================================================
--- branches/talloc/experimental/lib/replace/win32.m4	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/win32.m4	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,20 @@
+AC_CHECK_HEADERS(direct.h windows.h winsock2.h ws2tcpip.h)
+
+#######################################
+# Check for mkdir mode
+AC_CACHE_CHECK( [whether mkdir supports mode], libreplace_cv_mkdir_has_mode,
+	AC_TRY_COMPILE([
+		#include <stdio.h>
+		#ifdef HAVE_DIRECT_H
+		#include <direct.h>
+		#endif],[
+			mkdir("foo",0777);
+			return 0;
+	],
+    libreplace_cv_mkdir_has_mode="yes",
+    libreplace_cv_mkdir_has_mode="no") )
+
+if test "$libreplace_cv_mkdir_has_mode" = "yes"
+then
+    AC_DEFINE(HAVE_MKDIR_MODE, 1, [Define if target mkdir supports mode option])
+fi

Added: branches/talloc/experimental/lib/replace/win32_replace.h
===================================================================
--- branches/talloc/experimental/lib/replace/win32_replace.h	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/win32_replace.h	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,159 @@
+#ifndef _WIN32_REPLACE_H
+#define _WIN32_REPLACE_H
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+/* Map BSD Socket errorcodes to the WSA errorcodes (if possible) */ 
+
+#define EAFNOSUPPORT	WSAEAFNOSUPPORT
+#define ECONNREFUSED    WSAECONNREFUSED 
+#define EINPROGRESS	WSAEINPROGRESS
+#define EMSGSIZE	WSAEMSGSIZE 
+#define ENOBUFS         WSAENOBUFS
+#define ENOTSOCK	WSAENOTSOCK
+#define ENETUNREACH	WSAENETUNREACH
+#define ENOPROTOOPT	WSAENOPROTOOPT
+#define ENOTCONN	WSAENOTCONN 
+#define ENOTSUP		134 
+
+/* We undefine the following constants due to conflicts with the w32api headers
+ * and the Windows Platform SDK/DDK.
+ */
+
+#undef interface
+
+#undef ERROR_INVALID_PARAMETER
+#undef ERROR_INSUFFICIENT_BUFFER
+#undef ERROR_INVALID_DATATYPE
+
+#undef FILE_GENERIC_READ
+#undef FILE_GENERIC_WRITE
+#undef FILE_GENERIC_EXECUTE
+#undef FILE_ATTRIBUTE_READONLY
+#undef FILE_ATTRIBUTE_HIDDEN
+#undef FILE_ATTRIBUTE_SYSTEM
+#undef FILE_ATTRIBUTE_DIRECTORY
+#undef FILE_ATTRIBUTE_ARCHIVE
+#undef FILE_ATTRIBUTE_DEVICE
+#undef FILE_ATTRIBUTE_NORMAL
+#undef FILE_ATTRIBUTE_TEMPORARY
+#undef FILE_ATTRIBUTE_REPARSE_POINT
+#undef FILE_ATTRIBUTE_COMPRESSED
+#undef FILE_ATTRIBUTE_OFFLINE
+#undef FILE_ATTRIBUTE_ENCRYPTED
+#undef FILE_FLAG_WRITE_THROUGH
+#undef FILE_FLAG_NO_BUFFERING
+#undef FILE_FLAG_RANDOM_ACCESS
+#undef FILE_FLAG_SEQUENTIAL_SCAN
+#undef FILE_FLAG_DELETE_ON_CLOSE
+#undef FILE_FLAG_BACKUP_SEMANTICS
+#undef FILE_FLAG_POSIX_SEMANTICS
+#undef FILE_TYPE_DISK
+#undef FILE_TYPE_UNKNOWN
+#undef FILE_CASE_SENSITIVE_SEARCH
+#undef FILE_CASE_PRESERVED_NAMES
+#undef FILE_UNICODE_ON_DISK
+#undef FILE_PERSISTENT_ACLS
+#undef FILE_FILE_COMPRESSION
+#undef FILE_VOLUME_QUOTAS
+#undef FILE_VOLUME_IS_COMPRESSED
+#undef FILE_NOTIFY_CHANGE_FILE_NAME
+#undef FILE_NOTIFY_CHANGE_DIR_NAME
+#undef FILE_NOTIFY_CHANGE_ATTRIBUTES
+#undef FILE_NOTIFY_CHANGE_SIZE
+#undef FILE_NOTIFY_CHANGE_LAST_WRITE
+#undef FILE_NOTIFY_CHANGE_LAST_ACCESS
+#undef FILE_NOTIFY_CHANGE_CREATION
+#undef FILE_NOTIFY_CHANGE_EA
+#undef FILE_NOTIFY_CHANGE_SECURITY
+#undef FILE_NOTIFY_CHANGE_STREAM_NAME
+#undef FILE_NOTIFY_CHANGE_STREAM_SIZE
+#undef FILE_NOTIFY_CHANGE_STREAM_WRITE
+#undef FILE_NOTIFY_CHANGE_NAME
+
+#undef PRINTER_ATTRIBUTE_QUEUED
+#undef PRINTER_ATTRIBUTE_DIRECT
+#undef PRINTER_ATTRIBUTE_DEFAULT
+#undef PRINTER_ATTRIBUTE_SHARED
+#undef PRINTER_ATTRIBUTE_NETWORK
+#undef PRINTER_ATTRIBUTE_HIDDEN
+#undef PRINTER_ATTRIBUTE_LOCAL
+#undef PRINTER_ATTRIBUTE_ENABLE_DEVQ
+#undef PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS
+#undef PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST
+#undef PRINTER_ATTRIBUTE_WORK_OFFLINE
+#undef PRINTER_ATTRIBUTE_ENABLE_BIDI
+#undef PRINTER_ATTRIBUTE_RAW_ONLY
+#undef PRINTER_ATTRIBUTE_PUBLISHED
+#undef PRINTER_ENUM_DEFAULT
+#undef PRINTER_ENUM_LOCAL
+#undef PRINTER_ENUM_CONNECTIONS
+#undef PRINTER_ENUM_FAVORITE
+#undef PRINTER_ENUM_NAME
+#undef PRINTER_ENUM_REMOTE
+#undef PRINTER_ENUM_SHARED
+#undef PRINTER_ENUM_NETWORK
+#undef PRINTER_ENUM_EXPAND
+#undef PRINTER_ENUM_CONTAINER
+#undef PRINTER_ENUM_ICON1
+#undef PRINTER_ENUM_ICON2
+#undef PRINTER_ENUM_ICON3
+#undef PRINTER_ENUM_ICON4
+#undef PRINTER_ENUM_ICON5
+#undef PRINTER_ENUM_ICON6
+#undef PRINTER_ENUM_ICON7
+#undef PRINTER_ENUM_ICON8
+#undef PRINTER_STATUS_PAUSED
+#undef PRINTER_STATUS_ERROR
+#undef PRINTER_STATUS_PENDING_DELETION
+#undef PRINTER_STATUS_PAPER_JAM
+#undef PRINTER_STATUS_PAPER_OUT
+#undef PRINTER_STATUS_MANUAL_FEED
+#undef PRINTER_STATUS_PAPER_PROBLEM
+#undef PRINTER_STATUS_OFFLINE
+#undef PRINTER_STATUS_IO_ACTIVE
+#undef PRINTER_STATUS_BUSY
+#undef PRINTER_STATUS_PRINTING
+#undef PRINTER_STATUS_OUTPUT_BIN_FULL
+#undef PRINTER_STATUS_NOT_AVAILABLE
+#undef PRINTER_STATUS_WAITING
+#undef PRINTER_STATUS_PROCESSING
+#undef PRINTER_STATUS_INITIALIZING
+#undef PRINTER_STATUS_WARMING_UP
+#undef PRINTER_STATUS_TONER_LOW
+#undef PRINTER_STATUS_NO_TONER
+#undef PRINTER_STATUS_PAGE_PUNT
+#undef PRINTER_STATUS_USER_INTERVENTION
+#undef PRINTER_STATUS_OUT_OF_MEMORY
+#undef PRINTER_STATUS_DOOR_OPEN
+#undef PRINTER_STATUS_SERVER_UNKNOWN
+#undef PRINTER_STATUS_POWER_SAVE
+
+#undef DWORD
+#undef HKEY_CLASSES_ROOT
+#undef HKEY_CURRENT_USER
+#undef HKEY_LOCAL_MACHINE
+#undef HKEY_USERS
+#undef HKEY_PERFORMANCE_DATA
+#undef HKEY_CURRENT_CONFIG
+#undef HKEY_DYN_DATA
+#undef REG_DWORD
+#undef REG_QWORD
+
+#undef SERVICE_STATE_ALL
+
+#undef SE_GROUP_MANDATORY
+#undef SE_GROUP_ENABLED_BY_DEFAULT
+#undef SE_GROUP_ENABLED
+
+#endif /* _WIN32_REPLACE_H */

Added: branches/talloc/experimental/lib/replace/wscript
===================================================================
--- branches/talloc/experimental/lib/replace/wscript	                        (rev 0)
+++ branches/talloc/experimental/lib/replace/wscript	2010-05-23 01:43:30 UTC (rev 3491)
@@ -0,0 +1,393 @@
+#!/usr/bin/env python
+
+APPNAME = 'libreplace'
+VERSION = '1.2.1'
+
+blddir = 'bin'
+
+import sys, os, Utils
+
+# find the buildtools directory
+srcdir = '.'
+while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
+    srcdir = '../' + srcdir
+sys.path.insert(0, srcdir + '/buildtools/wafsamba')
+
+import wafsamba, samba_dist
+import Options, os, preproc
+
+samba_dist.DIST_DIRS('lib/replace buildtools:buildtools')
+
+def set_options(opt):
+    opt.BUILTIN_DEFAULT('NONE')
+    opt.BUNDLED_EXTENSION_DEFAULT('')
+    opt.RECURSE('buildtools/wafsamba')
+
+ at wafsamba.runonce
+def configure(conf):
+    conf.RECURSE('buildtools/wafsamba')
+
+    conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
+
+    # on Tru64 certain features are only available with _OSF_SOURCE
+    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'OSF1':
+        conf.DEFINE('_OSF_SOURCE', 1, add_to_cflags=True)
+
+    conf.CHECK_HEADERS('crypt.h locale.h acl/libacl.h compat.h')
+    conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
+    conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
+    conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+    conf.CHECK_HEADERS('shadow.h sys/acl.h')
+    conf.CHECK_HEADERS('sys/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
+    conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
+    conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
+    conf.CHECK_HEADERS('sys/resource.h sys/security.h sys/shm.h sys/statfs.h sys/statvfs.h sys/termio.h')
+    conf.CHECK_HEADERS('sys/vfs.h sys/xattr.h termio.h termios.h')
+    conf.CHECK_HEADERS('sys/wait.h sys/stat.h malloc.h grp.h')
+    conf.CHECK_HEADERS('sys/select.h setjmp.h utime.h sys/syslog.h syslog.h')
+    conf.CHECK_HEADERS('stdarg.h vararg.h sys/mount.h mntent.h')
+    conf.CHECK_HEADERS('stropts.h unix.h string.h strings.h sys/param.h limits.h')
+    conf.CHECK_HEADERS('''sys/socket.h netinet/in.h netdb.h arpa/inet.h netinet/in_systm.h
+                          netinet/ip.h netinet/tcp.h netinet/in_ip.h
+                          sys/sockio.h sys/un.h''', together=True)
+    conf.CHECK_HEADERS('sys/uio.h ifaddrs.h direct.h dirent.h')
+    conf.CHECK_HEADERS('windows.h winsock2.h ws2tcpip.h')
+    conf.CHECK_HEADERS('libintl.h errno.h')
+    conf.CHECK_HEADERS('gcrypt.h getopt.h iconv.h')
+    conf.CHECK_HEADERS('sys/inotify.h memory.h nss.h sasl/sasl.h')
+    conf.CHECK_HEADERS('security/pam_appl.h sys/inotify.h zlib.h asm/unistd.h')
+    conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h')
+
+    conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/prctl.h sys/sysctl.h')
+    conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
+    conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h rpcsvc/yp_prot.h')
+    conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
+    conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+    conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+    conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+    conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
+
+    conf.CHECK_TYPES('"long long" intptr_t uintptr_t ptrdiff_t')
+    conf.CHECK_TYPES('comparison_fn_t bool')
+    conf.CHECK_TYPE('_Bool', define='HAVE__Bool')
+
+    conf.CHECK_TYPE('int8_t', 'char')
+    conf.CHECK_TYPE('int16_t', 'short')
+    conf.CHECK_TYPE('uint16_t', 'unsigned short')
+    conf.CHECK_TYPE('int32_t', 'int')
+    conf.CHECK_TYPE('uint32_t', 'unsigned')
+    conf.CHECK_TYPE('int64_t', 'long long')
+    conf.CHECK_TYPE('uint64_t', 'unsigned long long')
+    conf.CHECK_TYPE('size_t', 'unsigned int')
+    conf.CHECK_TYPE('ssize_t', 'int')
+    conf.CHECK_TYPE('ino_t', 'unsigned')
+    conf.CHECK_TYPE('loff_t', 'off_t')
+    conf.CHECK_TYPE('bool', 'off_t')
+    conf.CHECK_TYPE('offset_t', 'loff_t')
+    conf.CHECK_TYPE('volatile int', define='HAVE_VOLATILE')
+    conf.CHECK_TYPE('uint_t', 'unsigned int')
+
+    conf.CHECK_TYPES('socklen_t', headers='sys/socket.h')
+    conf.CHECK_TYPE_IN('struct ifaddrs', 'ifaddrs.h')
+    conf.CHECK_TYPE_IN('struct addrinfo', 'netdb.h')
+    conf.CHECK_TYPE_IN('struct sockaddr', 'sys/socket.h')
+    conf.CHECK_CODE('struct sockaddr_in6 x', define='HAVE_STRUCT_SOCKADDR_IN6',
+                    headers='sys/socket.h netdb.h netinet/in.h')
+    conf.CHECK_TYPE_IN('struct sockaddr_storage', 'sys/socket.h')
+    conf.CHECK_TYPE_IN('sa_family_t', 'sys/socket.h')
+
+    conf.CHECK_TYPE_IN('sig_atomic_t', 'signal.h', define='HAVE_SIG_ATOMIC_T_TYPE')
+
+    conf.CHECK_FUNCS_IN('''inet_ntoa inet_aton inet_ntop inet_pton connect gethostbyname
+                           getaddrinfo getnameinfo freeaddrinfo gai_strerror socketpair''',
+                        'socket nsl', checklibc=True,
+                        headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h')
+
+    # Some old Linux systems have broken header files and
+    # miss the IPV6_V6ONLY define in netinet/in.h,
+    # but have it in linux/in6.h.
+    # We can't include both files so we just check if the value
+    # if defined and do the replacement in system/network.h
+    if not conf.CHECK_VARIABLE('IPV6_V6ONLY',
+                               headers='sys/socket.h netdb.h netinet/in.h'):
+        conf.CHECK_CODE('''
+                        #include <linux/in6.h>
+                        #if (IPV6_V6ONLY != 26)
+                        #error no IPV6_V6ONLY support on linux
+                        #endif
+                        int main(void) { return IPV6_V6ONLY; }
+                        ''',
+                        define='HAVE_LINUX_IPV6_V6ONLY_26',
+                        addmain=False,
+                        msg='Checking for IPV6_V6ONLY in linux/in6.h',
+                        local_include=False)
+
+    conf.CHECK_CODE('''
+                       struct sockaddr_storage sa_store;
+                       struct addrinfo *ai = NULL;
+                       struct in6_addr in6addr;
+                       int idx = if_nametoindex("iface1");
+                       int s = socket(AF_INET6, SOCK_STREAM, 0);
+                       int ret = getaddrinfo(NULL, NULL, NULL, &ai);
+                       if (ret != 0) {
+			  const char *es = gai_strerror(ret);
+                       }
+                       freeaddrinfo(ai);
+                       {
+                          int val = 1;
+                          #ifdef HAVE_LINUX_IPV6_V6ONLY_26
+                          #define IPV6_V6ONLY 26
+                          #endif
+                          ret = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+                                           (const void *)&val, sizeof(val));
+                       }
+                       ''',
+                    define='HAVE_IPV6',
+                    lib='nsl socket',
+                    headers='sys/socket.h netdb.h netinet/in.h')
+
+    # these may be builtins, so we need the link=False strategy
+    conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False)
+
+    conf.CHECK_FUNCS('shl_load shl_unload shl_findsym')
+    conf.CHECK_FUNCS('pipe strftime srandom random srand rand usleep setbuffer')
+    conf.CHECK_FUNCS('lstat getpgrp utime utimes seteuid setresuid setegid')
+    conf.CHECK_FUNCS('setresgid chroot strerror vsyslog setlinebuf mktime')
+    conf.CHECK_FUNCS('ftruncate chsize rename waitpid wait4 strlcpy strlcat')
+    conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr')
+    conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+    conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
+    conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq')
+    conf.CHECK_FUNCS('if_nametoindex strerror_r')
+    conf.CHECK_FUNCS('getdirentries getdents syslog')
+    conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
+    conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups setsid')
+    conf.CHECK_FUNCS('getgrent_r getgrgid_r getgrnam_r getgrouplist getpagesize')
+    conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
+
+    conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
+                        checklibc=True, headers='dlfcn.h dl.h')
+
+    conf.CHECK_C_PROTOTYPE('dlopen', 'void *dlopen(const char* filename, unsigned int flags)',
+                           define='DLOPEN_TAKES_UNSIGNED_FLAGS', headers='dlfcn.h dl.h')
+
+    conf.CHECK_FUNCS_IN('fdatasync', 'rt', checklibc=True)
+
+    # these headers need to be tested as a group on freebsd
+    conf.CHECK_HEADERS(headers='sys/socket.h net/if.h', together=True)
+    conf.CHECK_HEADERS(headers='netinet/in.h arpa/nameser.h resolv.h', together=True)
+    conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True,
+                        headers='netinet/in.h arpa/nameser.h resolv.h')
+
+    conf.CHECK_FUNCS_IN('gettext', 'intl', checklibc=True, headers='libintl.h')
+    conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')
+
+    conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)
+
+    conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True,
+                        headers='readline.h readline/readline.h readline/history.h')
+
+    conf.CHECK_DECLS('snprintf vsnprintf asprintf vasprintf')
+
+    conf.CHECK_DECLS('errno', headers='errno.h', reverse=True)
+    conf.CHECK_DECLS('environ getgrent_r getpwent_r', reverse=True, headers='pwd.h grp.h')
+    conf.CHECK_DECLS('pread pwrite setenv setresgid setresuid', reverse=True)
+
+    conf.CHECK_SIZEOF('char int "long long" long off_t short size_t ssize_t')
+    conf.CHECK_SIZEOF('dev_t ino_t time_t')
+    conf.CHECK_SIZEOF('void*', define='SIZEOF_VOID_P')
+
+    if conf.CONFIG_SET('HAVE_EPOLL_CREATE') and conf.CONFIG_SET('HAVE_SYS_EPOLL_H'):
+        conf.DEFINE('HAVE_EPOLL', 1)
+
+    if not conf.CHECK_CODE('''#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
+		       #include "$libreplacedir/test/strptime.c"''',
+                           define='HAVE_STRPTIME',
+                           msg='Checking for working strptime'):
+        conf.DEFINE('REPLACE_STRPTIME', 1)
+
+    if conf.CONFIG_SET('HAVE_KRB5_H'):
+        # Check for KRB5_DEPRECATED handling
+        conf.CHECK_CODE('''#define KRB5_DEPRECATED 1
+#include <krb5.h>''',
+                        'HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER', addmain=False,
+                        link=False,
+                        msg="Checking for KRB5_DEPRECATED define taking an identifier")
+
+    conf.CHECK_CODE('gettimeofday(NULL, NULL)', 'HAVE_GETTIMEOFDAY_TZ', execute=False)
+
+    conf.CHECK_CODE('#include "test/snprintf.c"',
+                    define="HAVE_C99_VSNPRINTF",
+                    execute=1,
+                    addmain=False,
+                    msg="Checking for C99 vsnprintf")
+
+    conf.SAMBA_BUILD_ENV()
+
+    conf.CHECK_CODE('''
+		    typedef struct {unsigned x;} FOOBAR;
+                    #define X_FOOBAR(x) ((FOOBAR) { x })
+                    #define FOO_ONE X_FOOBAR(1)
+                    FOOBAR f = FOO_ONE;
+                    static const struct {
+                        FOOBAR y;
+                    } f2[] = {
+                        {FOO_ONE}
+                    };
+                    static const FOOBAR f3[] = {FOO_ONE};
+                    ''',
+                    define='HAVE_IMMEDIATE_STRUCTURES')
+
+    conf.CHECK_CODE('mkdir("foo",0777)', define='HAVE_MKDIR_MODE', headers='sys/stat.h')
+
+    conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec', define='HAVE_STAT_TV_NSEC',
+                                headers='sys/stat.h')
+    # we need the st_rdev test under two names
+    conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev',
+                                define='HAVE_STRUCT_STAT_ST_RDEV',
+                                headers='sys/stat.h')
+    conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev', define='HAVE_ST_RDEV',
+                                headers='sys/stat.h')
+    conf.CHECK_STRUCTURE_MEMBER('struct sockaddr_storage', 'ss_family',
+                                headers='sys/socket.h netinet/in.h')
+
+
+    if conf.CHECK_STRUCTURE_MEMBER('struct sockaddr', 'sa_len',
+                                   headers='sys/socket.h netinet/in.h',
+                                   define='HAVE_SOCKADDR_SA_LEN'):
+        # the old build system produced both defines
+        conf.DEFINE('HAVE_STRUCT_SOCKADDR_SA_LEN', 1)
+
+    conf.CHECK_STRUCTURE_MEMBER('struct sockaddr_in', 'sin_len',
+                                headers='sys/socket.h netinet/in.h',
+                                define='HAVE_SOCK_SIN_LEN')
+
+    conf.CHECK_CODE('struct sockaddr_un sunaddr; sunaddr.sun_family = AF_UNIX;',
+                    define='HAVE_UNIXSOCKET', headers='sys/socket.h sys/un.h')
+
+
+    conf.CHECK_CODE('''
+                    struct stat st;
+                    char tpl[20]="/tmp/test.XXXXXX";
+                    int fd = mkstemp(tpl);
+                    if (fd == -1) exit(1);
+                    unlink(tpl);
+                    if (fstat(fd, &st) != 0) exit(1);
+                    if ((st.st_mode & 0777) != 0600) exit(1);
+                    exit(0);
+                    ''',
+                    define='HAVE_SECURE_MKSTEMP',
+                    execute=True,
+                    mandatory=True) # lets see if we get a mandatory failure for this one
+
+    if conf.CHECK_CFLAGS('-fvisibility=hidden'):
+        conf.env.VISIBILITY_CFLAGS = '-fvisibility=hidden'
+        conf.CHECK_CODE('''void vis_foo1(void) {}
+                           __attribute__((visibility("default"))) void vis_foo2(void) {}''',
+                        cflags=conf.env.VISIBILITY_CFLAGS,
+                        define='HAVE_VISIBILITY_ATTR')
+
+    if not conf.CHECK_CODE('''#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
+		       #include "$libreplacedir/test/strptime.c"''',
+                           define='HAVE_STRPTIME',
+                           msg='Checking for working strptime'):
+        conf.DEFINE('REPLACE_STRPTIME', 1)
+
+
+    # look for a method of finding the list of network interfaces
+    for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+        if conf.CHECK_CODE('''
+                           #define %s 1
+                           #define NO_CONFIG_H 1
+                           #define AUTOCONF_TEST 1
+                           #define SOCKET_WRAPPER_NOT_REPLACE
+                           #include "replace.c"
+                           #include "inet_ntop.c"
+                           #include "snprintf.c"
+                           #include "getifaddrs.c"
+                           #define getifaddrs_test main
+                           #include "test/getifaddrs.c"
+                           ''' % method,
+                           method,
+                           lib='nsl socket',
+                           addmain=False,
+                           execute=True):
+            break
+
+    if conf.CHECK_FUNCS('getpass getpassphrase'):
+        # if we have both, then we prefer getpassphrase
+        conf.DEFINE('REPLACE_GETPASS_BY_GETPASSPHRASE', 1)
+        conf.DEFINE('REPLACE_GETPASS', 1)
+    else:
+        conf.CHECK_CODE('''#include "getpass.c"
+                       int main(void) { return 0; }''',
+                    addmain=False,
+                    define='REPLACE_GETPASS',
+                    cflags='-DNO_CONFIG_H')
+
+    conf.RECURSE('system')
+    conf.SAMBA_CONFIG_H()
+
+
+def build(bld):
+    bld.RECURSE('buildtools/wafsamba')
+
+    REPLACE_HOSTCC_SOURCE = 'replace.c snprintf.c'
+
+    if bld.CONFIG_SET('REPLACE_STRPTIME'):       REPLACE_HOSTCC_SOURCE += ' strptime.c'
+    if not bld.CONFIG_SET('HAVE_TIMEGM'):        REPLACE_HOSTCC_SOURCE += ' timegm.c'
+
+    bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+        REPLACE_HOSTCC_SOURCE,
+        use_hostcc=True,
+        use_global_deps=False,
+        cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
+        group='compiler_libraries'
+    )
+
+    REPLACE_SOURCE = REPLACE_HOSTCC_SOURCE
+
+    if bld.CONFIG_SET('REPLACE_GETPASS'):        REPLACE_SOURCE += ' getpass.c'
+    if not bld.CONFIG_SET('HAVE_CRYPT'):         REPLACE_SOURCE += ' crypt.c'
+    if not bld.CONFIG_SET('HAVE_DLOPEN'):        REPLACE_SOURCE += ' dlfcn.c'
+
+    if not bld.CONFIG_SET('HAVE_SOCKETPAIR'):    REPLACE_SOURCE += ' socketpair.c'
+    if not bld.CONFIG_SET('HAVE_CONNECT'):       REPLACE_SOURCE += ' socket.c'
+    if not bld.CONFIG_SET('HAVE_GETIFADDRS'):    REPLACE_SOURCE += ' getifaddrs.c'
+    if not bld.CONFIG_SET('HAVE_GETADDRINFO'):   REPLACE_SOURCE += ' getaddrinfo.c'
+    if not bld.CONFIG_SET('HAVE_INET_NTOA'):     REPLACE_SOURCE += ' inet_ntoa.c'
+    if not bld.CONFIG_SET('HAVE_INET_ATON'):     REPLACE_SOURCE += ' inet_aton.c'
+    if not bld.CONFIG_SET('HAVE_INET_NTOP'):     REPLACE_SOURCE += ' inet_ntop.c'
+    if not bld.CONFIG_SET('HAVE_INET_PTON'):     REPLACE_SOURCE += ' inet_pton.c'
+
+    bld.SAMBA_LIBRARY('replace',
+                      source=REPLACE_SOURCE,
+                      group='base_libraries',
+                      hide_symbols=bld.BUILTIN_LIBRARY('replace'),
+                      deps='crypt dl nsl socket')
+
+    TEST_SOURCES = '''test/testsuite.c test/main.c test/strptime.c
+                      test/os2_delete.c test/getifaddrs.c'''
+
+
+    bld.SAMBA_BINARY('replace_testsuite',
+                     TEST_SOURCES,
+                     deps='replace',
+                     install=False)
+
+    # build replacements for stdint.h and stdbool.h if needed
+    bld.SAMBA_GENERATOR('replace_stdint_h',
+                        rule='cp ${SRC} ${TGT}',
+                        source='hdr_replace.h',
+                        target='stdint.h',
+                        enabled = not bld.CONFIG_SET('HAVE_STDINT_H'))
+    bld.SAMBA_GENERATOR('replace_stdbool_h',
+                        rule='cp ${SRC} ${TGT}',
+                        source='hdr_replace.h',
+                        target='stdbool.h',
+                        enabled = not bld.CONFIG_SET('HAVE_STDBOOL_H'))
+
+def dist():
+    '''makes a tarball for distribution'''
+    samba_dist.dist()





More information about the Pkg-samba-maint mailing list