Update, from libc-alpha post.
[libidn.git] / libc / README
blob96394ad1738f14308c3a5a8479f27ff591a73651
1 Libidn libc/README -- Instructions for building as a GNU Libc add-on.
2 Copyright (C) 2003, 2004 Simon Josefsson
3 See the end for copying conditions.
5 GNU Libidn can be built into GNU Libc if you follow these
6 instructions.  Note that you should not run configure in Libidn.
8 1) Unpack Libc:
10 $ tar xfz glibc-2.3.2.tar.gz  # and glibc-linuxthreads if you need it
12 2) Unpack Libidn:
14 $ tar xfz ~/libidn-0.4.1.tar.gz
16 3) Set up the Libidn add-on inside the Libc directory:
18 $ perl -pi -e 's/idn-int.h/stdint.h/' libidn-0.4.1/lib/{idna,stringprep,punycode}.h
19 $ cp -r libidn-0.4.1/lib glibc-2.3.2/libidn
20 $ cp libidn-0.4.1/libc/* glibc-2.3.2/libidn/
21 $ cp libidn-0.4.1/libc/getaddrinfo.c glibc-2.3.2/sysdeps/posix/
22 $ cp libidn-0.4.1/libc/netdb.h glibc-2.3.2/resolv/
24 4) Configure and build Libc with the Libidn add-on:
26 $ mkdir glibc-2.3.2-obj
27 $ cd glibc-2.3.2-obj
28 $ ../glibc-2.3.2/configure --enable-add-ons=linuxthreads,libidn \
29         --prefix=/usr/local/glibc
30 $ make install
32 5) Run the example:
34 $ cd ../glibc-2.3.2/libidn/libc
35 $ 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
36 $ CHARSET=iso-8859-1 ./example
37 locale charset `iso-8859-1'
38 gettaddrinfo(räksmörgås.josefsson.org):
39 address `217.13.230.178'
40 canonical name `178.230.13.217.in-addr.dgcsystems.net'
43 Internally the domain name xn--rksmrgs-5wao1o.josefsson.org is looked
44 up in DNS.
46 The file libc.patch in this directory contains the modifications made
47 to getaddrinfo.c and netdb.h, should you wish to try this with another
48 GNU Libc version.  With minor modifications, it has been verified to
49 work with 2.3.1.
51 ----------------------------------------------------------------------
52 Copying and distribution of this file, with or without modification,
53 are permitted in any medium without royalty provided the copyright
54 notice and this notice are preserved.