Libidn libc/README -- Instructions for building as a GNU Libc add-on.
Copyright (C) 2003 Simon Josefsson
See the end for copying conditions.

GNU Libidn can be built into GNU Libc if you follow these
instructions.  Note that you should not run configure in Libidn.

1) Unpack Libc:

$ tar xfz glibc-2.3.2.tar.gz  # and glibc-linuxthreads if you need it

2) Unpack Libidn inside the Libc directory:

$ cd glibc-2.3.2
$ tar xfz ~/libidn-0.1.12.tar.gz
$ mv libidn-0.1.12 libidn

3) Set up Libidn for building as a Libc add-on:

$ cp libidn/libc/Makefile libidn/libc/configure libidn/libc/Versions libidn/
$ cp libidn/libc/getaddrinfo.c sysdeps/posix/
$ cp libidn/libc/netdb.h resolv/
$ echo > libidn/libidn.texi

pi) If you are using libidn from CVS build some files at this point:

$ perl gen-unicode-tables.pl -decomp 3.2 UnicodeData-3.2.0.txt \
       LineBreak-3.2.0.txt SpecialCasing-3.2.0.txt CaseFolding-3.2.0.txt \
       CompositionExclusions-3.2.0.txt
$ perl gen-stringprep-tables.pl rfc3454.txt
$ cp stringprep.h.in stringprep.h

4) Configure and build Libc with the Libidn add-on:

$ cd ../..
$ mkdir glibc-2.3.2-obj
$ cd glibc-2.3.2-obj
$ ../glibc-2.3.2-obj/configure --enable-add-ons=linuxthreads,libidn \
	--prefix=/usr/local/glibc
$ make install

5) Run the example:

$ cd ../glibc-2.3.2/libidn/libc
$ gcc -o example example.c -L/usr/local/glibc/lib -Wl,-rpath,/usr/local/glibc/lib -nostdinc -I/usr/local/glibc/include -I/usr/include -I/usr/lib/gcc-lib/i386-linux/2.95.4/include
$ CHARSET=iso-8859-1 ./example
locale charset `iso-8859-1'
gettaddrinfo(rksmrgs.josefsson.org):
address `217.13.230.178'
canonical name `178.230.13.217.in-addr.dgcsystems.net'
$

Internally the domain name xn--rksmrgs-5wao1o.josefsson.org is looked
up in DNS.

The file libc.patch in this directory contains the modifications made
to getaddrinfo.c and netdb.h, should you wish to try this with another
GNU Libc version.  With minor modifications, it has been verified to
work with 2.3.1.

----------------------------------------------------------------------
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
