Add command line interface to library.
[libidn.git] / libc / README
blob8e5ffd60835b34de87c3e8a9b0c5b244f5b4dc48
1 Libidn libc/README -- Instructions for building as a GNU Libc add-on.
2 See the end for copying conditions.
4 GNU Libidn can be built as part of GNU Libc if you follow these
5 instructions.  Note that you should not run configure in Libidn.
7 1) Unpack Libc:
9 $ tar xfz glibc-2.3.1.tar.gz
11 2) Unpack Libidn inside the Libc directory:
13 $ cd glibc-2.3.1
14 $ tar xfz ~/libidn-0.1.5.tar.gz
15 $ mv libidn-0.1.5 libidn
17 3) Set up Libidn for building as a Libc add-on:
19 $ cd libidn
20 $ cp libc/Makefile .
21 $ cp libc/configure .
22 $ cp libc/getaddrinfo.c ../sysdeps/posix/
23 $ cp libc/netdb.h ../resolv
25 pi) If you are using libidn from CVS you must build some files manually:
27 $ 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
28 $ perl gen-stringprep-tables.pl rfc3454.txt
29 $ cp stringprep.h.in stringprep.h
31 4) Configure Libc indicating that the Libidn add-on should be built:
33 $ cd ..
34 $ ./configure --enable-add-ons=linuxthreads,libidn --prefix=/usr/local/glibc
35 $ make install
37 5) Run the example
39 $ cd libidn/libc
40 $ 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
41 $ CHARSET=iso-8859-1 ./example
42 locale charset `iso-8859-1'
43 gettaddrinfo(räksmörgås.josefsson.org):
44 address `217.13.230.178'
45 canonical name `178.230.13.217.in-addr.dgcsystems.net'
48 The file libc.patch in this directory contains the modifications made
49 to getaddrinfo.c and netdb.h, should you wish to try this with another
50 GNU Libc version.
52 ----------------------------------------------------------------------
53 Copyright (C) 2003 Simon Josefsson
55 Copying and distribution of this file, with or without modification,
56 are permitted in any medium without royalty provided the copyright
57 notice and this notice are preserved.